HOW TO CREATE STORED PROCEDURE IN SQLSERVER FOR INSERT STATEMENT.

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
 531  View(s)
Ratings:
Rate this:
Can anyone please help me how to solve this problem.
  1. aditya kumar Patel

    Post:254

    Points:1810
    Re: How to create stored procedure in sqlserver for insert statement.

    
    
    

    --let’s start querying create a table.

      CREATE TABLE UserMasters(        UserId int IDENTITY(1,1) primary key,

           LoginName nvarchar(100) ,

           password nvarchar(100) ,

           UserName nvarchar(100)  

      )

     --Now start querying create a procedure for insert data.

     alter procedure sp_InsertUserMasters

     (

    @LoginName nvarchar(100) ,

           @password nvarchar(400) ,

           @UserName nvarchar(400)  

     )

     as

     begin

     insert into UserMasters (LoginName,password,UserName) values(@LoginName,@password,@UserName)

     end

     --Now start querying create use procedure for insert data.

     exec sp_InsertUserMasters 'kavita@hotmail.com','kavita$%2015','kavita Patel'

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!