|
-
Dec 6th, 2000, 03:53 PM
#4
Thread Starter
New Member
Thanks for your help, expecially the tip about concatenating everything in the EXEC statement. After several hours running the sp through T-SQL Debugger (a pain to install, but worth it), I could see that any @Str with the @strStock in it failed to work. So I figured I had to concatenate it somehow. Then I checked back here and saw your reply. I've simplified everything, but this is finally what works. Don't forget to put double-quotes around the single quote.
CREATE PROCEDURE sp_Kairos6
@strStock char(4),
@strDate char(10)
AS
begin
declare @Str1 varchar(255)
declare @Str2 varchar(255)
select @Str1 = "select Count(*) from "
select @Str2 = " where Date = " + "'" + @strDate +"'"
exec (@Str1 + @strStock + @Str2)
Thanks again
end
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
|