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
 General SQL Server Forums
 New to SQL Server Programming
 error message of store procedure

Author  Topic 

jerry1118
Starting Member

1 Post

Posted - 2006-07-28 : 08:23:21


create procedure Pr_addsupportor(
@supportornumber varchar(10),
@company varchar(100),
@title char(10),
@firstname char(30),
@surname char(30),
@addressline1 varchar(1000),
@addressline2 varchar(1000),
@addressline3 varchar(1000),
@postcode varchar(20),
@town char(100),
@county char(100),
@country varchar(100),
@phonenumber varchar(15),
@faxnumber varchar(15),
@email varchar(100),
@paymenttitle varchar(100),
@barcode varchar(2000),
@collector varchar(3),
@status varchar(10),
@registerdate datetime)
INSERT into
supportor(
[supportor number],
company,
title,
[first name],
surname,
[address line1],
[address line2],
[addess line3],
[post code],
town,
county,
country,
[phone number],
[fax number],
[e-mail],
[payment title],
barcode,
collector,
status,
[register date])
values
(
@supportornumber,
@company,
@title,
@firstname,
@surname,
@addressline1,
@addressline2,
@addressline3,
@postcode,
@town,
@county,
@country,
@phonenumber,
@faxnumber,
@email,
@paymenttitle,
@barcode,
@collector,
@status,
@registerdate);

Server: Msg 156, Level 15, State 1, Procedure Pr_addsupportor, Line 22
Incorrect syntax near the keyword 'INSERT'.
plz help me to find the error

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-07-28 : 08:36:55
You have a case of wrong syntax used. The syntax for creating procedure is
create procedure proc_name
@para1 int,
@para2 varchar(10)
as
begin
<...>
end


Refer to Books Online for more information


KH

Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-07-28 : 08:37:04
[code].........
.........
@registerdate datetime)

As

Begin
INSERT into
.........
.........
End[/code]
Srinika
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-07-28 : 13:25:52
You don't need BEGIN/END for this

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-07-29 : 04:27:01
"You don't need BEGIN/END for this"

Not a bad idea though ...

... don't need the brackets round the parameters either, but ...

Kristen
Go to Top of Page
   

- Advertisement -