TutorialSqlServer.Com 

Create In Sql Server

Insert In Sql Server 

 Sql Server Select Basic

 Group By In Sql Server


Where in Sql Server


Order By in Sql Server

Disclaimer 

 Author G+

 

 

 

Insert Query in Sql Server 2008

A new method introduce in sql server 2008 to insert multiple values lets use that in this tutorial to insert data.
let`s create a table first 



Create Table
DummyTable2008 ( ID Int , Name Varchar(30) , Age Tinyint )
   

  • Please Note if you don`t define columns nullable or not sql server by default take it as nullable column so above all columns are nullable.

insert multiple data into Table in 2008 Syntax :

 
Insert Into TableName values ('data1' ,'data2') , ('data2' , 'data2')  ...
  


Let`s use this syntax and insert the data in the table.

INSERT INTO DummyTable2008

VALUES (1,'Neeraj' , 26),

     (2,'Thomas',23),

  (3,'Mark',34) 




Insert multiple data in sql server 2008

If  the columns are Nullable (accepts empty values) then we can left those column empty example :

 

INSERT INTO DummyTable2008 (ID , Name)

VALUES (4,'Vicky' ),
(5,'Salim')

 


Insert multiple values in sql server 2008 with null

Now let`s view all the records

View all Insert Data from dummytable2008

DownLoad Script Used
(Right click the link and choose "Save As.." to download this file.)

 

Please Comment Below :




             Related Topics

  1. Insert Query in Sql Server

  2. Insert Query in sql server 2005

  3. Insert Query in Sql Server 2008




comments powered by Disqus