Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT does not find record
Message
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01682735
Message ID:
01682760
Views:
24
So, if I needed to get more than one value from the table into more than one variable, how would you do it?

>set @FieldVar1 = ( select FIELD_NAME from TableName where somecondition)
>
>OK, I hate to tell someone, "I realize your proc has been running, but you should change it....."
>
>About all I can say - general "best practice" to begin with is to use SET @Var = (SELECT etc.).
>My general rule, if I just need to pull in a very small # of variables, that's what I do.
>
> I almost wish SQL Server (and other databases) didn't allow the ability to do a SELECT @var = somecolumns from Table......
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform