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

Click here to load this message in the networking platform