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 2008 Forums
 Other SQL Server 2008 Topics
 Insert

Author  Topic 

abhijaiswal.84
Starting Member

29 Posts

Posted - 2012-05-30 : 02:37:09
Hi,

Can anyone help me to findout the answer for,

How to enter 10 records in table in single statement without referring another table.

Ex : Consider a table with column salary and insert 10 different salaries in the table.

Thanks in advance.


Abhishek

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-05-30 : 16:25:00
where will you get 10 different salaries from? do you've variables to store them or they come from parameters?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2012-06-04 : 09:25:45
insert into table(sal)
values ((8724),(876287),(8876),....)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-06-04 : 10:24:48
see other uses of VALUES clause in 2008 here

http://visakhm.blogspot.com/2012/05/multifacet-values-clause.html?m=0

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2012-06-05 : 05:19:20
You may alos need to read this
http://beyondrelational.com/modules/2/blogs/70/posts/10905/interesting-enhancements-to-the-values-clause-in-sql-server-2008.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -