SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 error message of store procedure
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jerry1118
Starting Member

1 Posts

Posted - 07/28/2006 :  08:23:21  Show Profile  Reply with Quote


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)

Singapore
17587 Posts

Posted - 07/28/2006 :  08:36:55  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

Sri Lanka
1378 Posts

Posted - 07/28/2006 :  08:37:04  Show Profile  Reply with Quote
.........
.........
@registerdate datetime)

As

Begin
  INSERT into 
  .........
  .........
End

Srinika

Edited by - Srinika on 07/28/2006 08:38:15
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 07/28/2006 :  13:25:52  Show Profile  Reply with Quote
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

United Kingdom
22403 Posts

Posted - 07/29/2006 :  04:27:01  Show Profile  Reply with Quote
"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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000