create new demo database
CREATE DATABASE demouse demo Database
USE democreate new table
CREATE TABLE demoTest ( id INT, NAME VARCHAR(30), ADDR VARCHAR(50) )create Procedure for inserting data into demoTest Table.
CREATE PROC ins_DemoTest @id INT,@name VARCHAR(30),@addr VARCHAR(30) AS BEGIN INSERT INTO demoTest ( id, NAME, ADDR ) VALUES ( @id, @name, @addr ) ENDexecute procedure
EXEC ins_DemoTest 1,'Aditya','New Delhi' EXEC ins_DemoTest 2,'Abhishek','Lucknow' EXEC ins_DemoTest 3,'Akhilesh','Greater Noida' EXEC ins_DemoTest 4,'Abhi','Noida'select data from Table
SELECT * FROM demoTest id NAME ADDR 1 Aditya New Delhi 2 Abhishek Lucknow 3 Akhilesh Greater Noida 4 Abhi Noida
No comments:
Post a Comment