Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Variable Scope
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Variable Scope
Divers
Thread ID:
00663609
Message ID:
00663609
Vues:
48
I know there has to be a way to do this... how do I make the following work?
declare @cwhere as varchar(1000)
declare @csql as varchar(1000)

set @cwhere = 'XXXXXXXX'

set @csql = 'select * from tablename where ckeyfieldname = @cwhere'
exec (@csql)
I am losing me @cwhere variable when I evaluate the @csql string. BTW, this is a simple example of what I am trying to do only for example.
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform