-
creating sql strings in stored procs
Hi Guys,
I have written a piece of code in a stored procedure that builds a string called "filter$" based on fielde in a table.
How do I use this string as my where clause?
in vb I would use:
rs.open filter$,cn
I hope this makes sense and someone can help me
-
creating sql strings in stored procs (reply)
Barney,
if I understand your question right, you are creating a dynamic where clause and then want to execute it.
I am assuming your where clause looks something like this
SET @SQLWHERE = " WHERE column1 = " + @Value1
SET @SQLFinalString = " SELECT * fROM table1 " + @SQLWHERE
exec sp_executesql(@SQLFinalString)
hope this helps
Zoey
------------
barney at 7/31/01 12:37:35 PM
Hi Guys,
I have written a piece of code in a stored procedure that builds a string called "filter$" based on fielde in a table.
How do I use this string as my where clause?
in vb I would use:
rs.open filter$,cn
I hope this makes sense and someone can help me
-
Thanks
Thankyou Zoey, that's exactly what I needed!
Barney
------------
Zoey at 7/31/01 5:37:50 PM
Barney,
if I understand your question right, you are creating a dynamic where clause and then want to execute it.
I am assuming your where clause looks something like this
SET @SQLWHERE = " WHERE column1 = " + @Value1
SET @SQLFinalString = " SELECT * fROM table1 " + @SQLWHERE
exec sp_executesql(@SQLFinalString)
hope this helps
Zoey
------------
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
|
|