October 9, 2007 at 3:15 am
Hi,
I am trying to set a value from the following SELECT statement but I am getting an error:
DECLARE @tmp varchar (20)
SET @tmp = TOP 1 Value FROM Table ORDER BY NewID()
but I am getting an error near the keyword 'TOP'
Is this sort of statement possible or is there an alternative way to achieve what I am doing. By the way I am using the ORDER by NewID() to randomly select from a table.
Cheers,
Chris
October 9, 2007 at 6:06 am
Thanks Ramesh, I forgot variables could be assigned that way.
Cheers,
Chris
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply