Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT does not find record
Message
De
21/11/2021 19:39:55
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01682735
Message ID:
01682759
Vues:
31
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......
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform