Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

procedure syntax 1

Status
Not open for further replies.

copeZero

Programmer
Aug 31, 2007
46
CA
Hi i'm getting an error on line one, stating incorect syntax near (

Using sql2k, any suggstions, thanks.
Code:
CREATE PROCEDURE dbo.sp_StoreSecurity
(
@MemberID int,
@SecurStr nvarchar(300),
@Pass nvarchar(40),
@Question nvarchar(50),
@Answer nvarchar(40)
)
AS
SET NOCOUNT ON

INSERT INTO [_Credent] (MID,CredtStr) VALUES (@MemberID, @SecurStr)
GO

UPDATE [_Info] SET (pw=@Pass, sQ=@Question, sA=@Answer, isTemp=0)
WHERE MID=@MemberID
GO

SELECT TOP 1 Gender, PersonalID, EMRID FROM [_MemberDemographics] 
WHERE MemberID = @MemberID
RETURN
GO
 
Remove the first 2 go's and also remove the parenthesis in the update statement.

Code:
CREATE PROCEDURE dbo.sp_StoreSecurity
(
@MemberID int,
@SecurStr nvarchar(300),
@Pass nvarchar(40),
@Question nvarchar(50),
@Answer nvarchar(40)
)
AS
SET NOCOUNT ON

INSERT INTO [_Credent] (MID,CredtStr) VALUES (@MemberID, @SecurStr)
[!][s]GO[/s][/!]

UPDATE [_Info] SET [!][s]([/s][/!]pw=@Pass, sQ=@Question, sA=@Answer, isTemp=0[!][s])[/s][/!]
WHERE MID=@MemberID
[!][s]GO[/s][/!]

SELECT TOP 1 Gender, PersonalID, EMRID FROM [_MemberDemographics]
WHERE MemberID = @MemberID
RETURN
GO

-George

"the screen with the little boxes in the window." - Moron
 
first of all take out those GO, they don't belong inside the proc

and no parenthese after update either

try this

Code:
CREATE PROCEDURE dbo.sp_StoreSecurity

@MemberID int,
@SecurStr nvarchar(300),
@Pass nvarchar(40),
@Question nvarchar(50),
@Answer nvarchar(40)

AS
SET NOCOUNT ON

INSERT INTO [_Credent] (MID,CredtStr) VALUES (@MemberID, @SecurStr)


UPDATE [_Info] SET pw=@Pass, sQ=@Question, sA=@Answer, isTemp=0
WHERE MID=@MemberID

SELECT TOP 1 Gender, PersonalID, EMRID FROM [_MemberDemographics] 
WHERE MemberID = @MemberID
RETURN
GO

Denis The SQL Menace
--------------------
SQL Server Code,Tips and Tricks, Performance Tuning
SQLBlog.com, Google Interview Questions
 
Sorry Denis, do appreciate the pointers, gotta give the star to gmmastros, guess he wasn't on luch at the time...


Thanks to both of yous.
Cheers.
 
[ponder]

Denis posted 1 minute after I did. I appreciate the star, but you should know that you are allowed to give stars to more than 1 person in a thread.

-George

"the screen with the little boxes in the window." - Moron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top