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
 SQL Server Development (2000)
 Stored Procedures Problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-01-14 : 13:29:50
Rajna writes "Hi,
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

-----
If I change this so instead @UserID in a SQL statement put a value it works, I get result on the screen. What's wrong with the parameter I'm passing?

Thanks for your help

Rajna/Clara"

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-01-14 : 13:49:45
you didnt put the size of the nvarchar

something like this

CREATE PROCEDURE GetUserGroup
@UserID nvarchar(20)
AS
SELECT UserID, PWD from tblUser WHERE UserID=@UserID
GO
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-01-14 : 17:59:15
quote:
@UserID nvarchar

if you did not specify the size, the default size will be 1.

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

if you can't beat them, have someone else to beat them
Go to Top of Page
   

- Advertisement -