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 2000 Forums
 Transact-SQL (2000)
 Stored Procedures Problem

Author  Topic 

Clara
Starting Member

4 Posts

Posted - 2006-01-11 : 10:14:08
I hope I posted to the right forum...but here it goes...my problem is related to stored procedures. I have a test stored procedure with a simple sql statement and when I run that statement from the QAnalyzer it works, but with SP it gives just a message - return code = 0 and blank grid, no error, nothing. Here is the code and if somebody can tell me what's wrong with this simple SP, I'd appreciate it...thanks in advance

CREATE PROCEDURE GetUserGroup
@UserID nvarchar
AS
SELECT UserID, PWD from tblUser WHERE UserID=@UserID
GO

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2006-01-11 : 11:42:34
>>but with SP it gives just a message
Did you mean ASP?

If so you may want to post this in either ASP.NET or DEVELOPER forum. But since the SP works in query analyzer it sounds like it's a databinding issue with your Datagrid control.

Be One with the Optimizer
TG
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-01-11 : 12:25:59
Hello Clara,
welcome to sqlteam.

I really dont understand your "question" Are you trying to read the status code from your SP in your ASP page ?

If so, you would use a return value and set a variable in your ASP page to read it
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-12 : 08:02:50
>>when I run that statement from the QAnalyzer it works,

How did you run that from QA?
Make sure the table has records for the UserId you're passing

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-01-12 : 08:22:57
if you use nvarchar without specifying any length, it is default to nvarchar(1)

CREATE PROCEDURE GetUserGroup
@UserID nvarchar(30) -- or set to the length of UserID in tblUser
AS
SELECT UserID, PWD from tblUser WHERE UserID=@UserID
GO


-----------------
'KH'

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
Go to Top of Page
   

- Advertisement -