Groups | Blog | Home
all groups > sql server programming > february 2004 >

sql server programming : error systax :156


Eselyn
2/15/2004 6:08:06 PM
CREATE PROCEDURE dbo.updateadminpass
(
@adminname1 nvarchar(50) ,
@adminpass1 nvarchar(50)
)
As

UPDATE admin SET
adminpass = @adminpass1,

WHERE adminname = @adminpass1

GO
well here is my coding. I'm new learner in sql.Please tell
me where is my mistake.
Itzik Ben-Gan
2/15/2004 9:16:56 PM
Eselyn,

[quoted text, click to view]

Remove the comma right before the WHERE clause.

--
BG, SQL Server MVP
Principal Mentor, Solid Quality Learning
www.SolidQualityLearning.com
More than just Training...


[quoted text, click to view]

mutex NO[at]SPAM mailinator.com
2/28/2004 9:46:55 AM
....and after you remove the comma, you may want to alter the criteria to read
WHERE adminname = @adminname1

[quoted text, click to view]
Joe Celko
2/28/2004 11:09:09 AM
[quoted text, click to view]

Go to www.mimer.com and look for their validation tools, which will
check for Standard SQL-92 syntax. You ought to learn to write real SQL
and not dialect when you start. Their parser puts an arrow directly
under the syntax errors, so you can see it on the screen.

Also, NVARCHAR(50) is usually a mistake; it is a default that falls out
of certain non-SQL products automatically. Research and carefully
design your data or your tables will fill with garbage.

When I see this one and NVARCHAR(255), I insert a Zen sutra in Chinese.

--CELKO--
===========================
Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are.

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button