Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 building dynamic sql

Author  Topic 

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2012-02-02 : 12:36:30
How can I solve the parameter being passed to the stored proc please?
Note that the sql is being built dynamically inside the stored proc.
Thanks

exec MyStoredProc @Where=N' field1 IN (''hello'',''you'')'

Caution: Changing any part of an object name could break scripts and stored procedures.

exec MyStoredProc @Where=N' field1 IN ('hello','you')'

Incorrect syntax near 'hello'

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-02 : 12:48:10
can you show how you're using @where instead procoedure?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2012-02-03 : 10:49:59
Solved by using two single quotes around the string
Thanks
Go to Top of Page

imranabbasi
Starting Member

1 Post

Posted - 2012-02-03 : 11:08:42
quote:
Originally posted by arkiboys

Solved by using two single quotes around the string
Thanks



Can you paste the working code here ?
Go to Top of Page

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2012-02-03 : 16:33:00
first exec in my first post
Go to Top of Page
   

- Advertisement -