Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variable Scope
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Variable Scope
Miscellaneous
Thread ID:
00663609
Message ID:
00663609
Views:
49
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
Next
Reply
Map
View

Click here to load this message in the networking platform