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 2005 Forums
 Transact-SQL (2005)
 Create warning message in sqlserver

Author  Topic 

seyha_moth
Yak Posting Veteran

74 Posts

Posted - 2007-03-09 : 06:04:04
Dear sir or Madame

I have problem related to create message error in sqlserver then assign to asp.net. I want to show error message in vb.net when It found existing record in other table.

CREATE PROC proc_SignUpUserVideo
@pUserName nvarchar(50),
@pPassword nvarchar(50),
@pCountry nvarchar(50),
@pPostCode nvarchar(10),
@pGender int,
@pDOB datetime,
@pEmail nvarchar(50),
@pRegisterDate datetime
AS
DECLARE @HasUser nvarchar(1)
SELECT @HasUser=Count(*) FROM tblUser WHERE UserName=@pUserName
IF @HasUser=0 or @HasUser=NULL
BEGIN
INSERT INTO tblVideoUser(UserName,Password,Country,PostCode,Gender,
DOB,Email,RegisterDate)
VALUES(@pUserName,@pPassword,@pCountry,@pPostCode,@pGender,
@pDOB,@pEmail,@pRegisterDate)
END
ELSE
'Show Error Message

How should I do?
Thank you in advance!

Best regard.












seyha moth

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-03-09 : 06:05:39
look into Raiserror in BOL

_____________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -