Reply
is any body can help me about Make this stored procedure??
Old 02-11-2009, 01:16 PM is any body can help me about Make this stored procedure??
Average Talker

Posts: 21
Name: Hesham
Location: Ismailia , EGYPT
Trades: 0
am try to make Insert stored procedure but after i wrote it and try to save it give me error message says " The operation couldnt be completed " this if i tried to save all and if i want single save icon give me this "Incorrect syntax near the keyword 'AS'

here is my stored peocedure part :

CREATE PROCEDURE dbo.StoredProcedure1
@EmployeeID
OUTPUT,@FirstName varchar(10),@LastName varchar(20),@TitleOfCourtesy varchar(25),
AS
INSERT INTO
Employees
(TitleOfCourtesy,LastName,FirstName,HireDate)
VALUES(@TitleOfCourtesy,@LastName,@FirstName,GetDate());
SET @EmployeeID=@@IDENTITY

RETURN

i hope somebody can help me as soon possible as
blue_way2002 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 02-11-2009, 03:43 PM Re: is any body can help me about Make this stored procedure??
tripy's Avatar
Do not try this at home!

Posts: 3,434
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
First, you have to specify the type of the first parameter. Not just that it's an output parameter.
Second, you have a comma after the last parameter, just before the AS. Drop it.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-11-2009, 05:07 PM Re: is any body can help me about Make this stored procedure??
Average Talker

Posts: 21
Name: Hesham
Location: Ismailia , EGYPT
Trades: 0
ohhhhhhhhhhh thats so cool ,,, i did what you said and its work well thank you soooooooooooooooo much ,, here is my Right Syntax

ALTER PROCEDURE InsertEmployee
@EmployeeID
int output,
@FirstName
varchar(10),
@LastName
varchar(20),
@TitleOfCourtesy
varchar (25)


AS
INSERT INTO
Employees(TitleOfCourtesy,LastName,FirstName,HireD ate)VALUES(@titleOfCourtesy,@LastName,@FirstName,GetDate());
SET @EmployeeID=@@IDENTITY

RETURN

thank you sooooooooooooooooooooooooooo much god bluess you
blue_way2002 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to is any body can help me about Make this stored procedure??
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.09675 seconds with 13 queries