I used to know how to do this but have forgotten. How do I set a variable to an item returned by a query using TSQL (SQL Server). I have delcared my @variable and need to set it to an item returned by ...
I'm trying to assign rows in a table to a random variable entirely in Transact SQL (This is MS SQL Server 2000, sp3). I've got it working perfectly except I can't use a variable inside my subquery ...