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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 MSSQL2000(stored procedure)

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-05-06 : 07:57:43
amit writes "sir,
I want to make a stored proc. through which I can insert the mandatory data to some of the tables of my database of my application.How can i do that"

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2003-05-06 : 08:40:47
quote:

amit writes "sir,
I want to make a stored proc. through which I can insert the mandatory data to some of the tables of my database of my application.How can i do that"


Create a stored proc with specifying input parameters ,
refer to BOL for details.

Expect the UnExpected
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-05-06 : 09:46:25
CREATE PROC myPROC @var1 varchar(10), @var2 int, @var3 datetime --this is up to you
AS

DECLARE @Result int, @ErrorOut

INSERT INTO myTable (col1, col2, col3) SELECT @var1, @var2, @var3

Select @Result = @@Rowcount, @ErrorOut = @@Error

If @Resut = 0 Or @ErrorOut <> 0
Return -1
Else
Return 0
GO


Brett

8-)
Go to Top of Page
   

- Advertisement -