|
-
Oct 11th, 2007, 08:35 AM
#1
Thread Starter
Addicted Member
[RESOLVED] could u tell me how to write a dynamic query which can hold a varchar type?
Hi All,
This is regarding SQL server 2000.
How can i write a Dynamic query so that i can hold a varchar type variable also?
please see the below sample example what i have written..
Declare @varSql varchar(2000)
Declare @varName varchar(30)
set @varName= 'Harvinder'
set @varSql= 'select * from employee where empname = ' + ' ' varName ' '
Execute (@varSql)
I cam to know that i have to use two single quotes to represent a varchar type variable.. still i am getting error.
could u please say how to resolve it?
Thanks:
regards:
raghunadhs.v
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|