Could someone please provide an example of a Stored Procedure that inserts records into an existing SQL table please?
Thanks
Printable View
Could someone please provide an example of a Stored Procedure that inserts records into an existing SQL table please?
Thanks
Basically, you may need to create a parameter for every field in your database table.
Code:Create Procedure dbo.insInsertExample
@Field1 As varchar(20),
@Field2 As datetime,
@Field4 As int = 0,
@NewId As int Output
As
Insert Into SomeTable Values (@Field1, @Field2, Default, @Field4)
Set @NewId = @@Identity 'or Scope_Identity if using SQL 2K