Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT does not find record
Message
From
21/11/2021 19:39:55
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01682735
Message ID:
01682759
Views:
30
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......
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform