|
-
Oct 7th, 2002, 02:50 PM
#1
Thread Starter
Lively Member
stored procedure question
I am currently successfully running a stored procedure in sql server 2000 query analyzer, by inputting the proper parameters. However, when I try to run it with the vb data environment, it bugs out telling me there is no recordset. I am supplying the exact same parameters in vb which work in sql?
I have also triple checked that the stored procedure return recordset checkbox is set to true, in the data environment
Has anyone ever had this seemingly simple problem before. My stored procedure contains dynamic SQL that is the only hangup that I can see....
CREATE PROCEDURE sp_GetOverseastoOverseasCost @Region1 char(10), @Region2 char(10), @Rank char(20)
AS
declare @SQLStatement varchar(255)
set @SQLStatement= 'select [' + @Rank + '] from tblIICT where R1= (' + '''' + @Region1 + '''' + ') AND R2=( ' + '''' + @Region2 + '''' +' )'
print @sqlstatement
exec(@SQLStatement)
GO
-
Oct 8th, 2002, 12:23 AM
#2
Fanatic Member
Add these lines after the declare statement:
SET NOCOUNT ON
SET ANSI_WARNINGS OFF
And then may be you should comment the print statement when you run it through VB.
At the end of the stored procedure add
SET NOCOUNT OFF
Last edited by Mr.No; Oct 8th, 2002 at 01:52 AM.
Using VB.NET 2003/.NET 1.1/C# 2.0
http://del.icio.us/rajoo
Blow your mind, smoke gunpowder
Ashes to ashes, dust to dust
If God won't have you, the devil will. - Author unknown
Don't follow me, I'm lost too ...
-
Oct 8th, 2002, 01:21 AM
#3
Hyperactive Member
try to avoid the Dynamic Sql Statements in Stored Procedure. It will reduce the Peroformence.
for more information
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
|