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.
| Author |
Topic |
|
vndnsingh2007
Starting Member
2 Posts |
Posted - 2007-06-20 : 14:34:26
|
| Hi,Is it possible to insert multiple rows in a table using one INSERT statment. If yes, how can I do that ? I tried doing this using the substitution method. Using Substitution Method - This is how,I proceeded.INSERT INTO EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)SELECT ‘&EMPN’, ‘&ENAM’, ‘&JO’, ‘&MG’, ‘&HI’, ‘&SA’, ‘&COMM’, ‘&DEPTN’ UNION ALLSELECT ‘&EMPN’, ‘&ENAM’, ‘&JO’, ‘&MG’, ‘&HI’, ‘&SA’, ‘&COMM’, ‘&DEPTN’ Let me know if this is correct.Thanks,Vandana |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-06-20 : 14:37:10
|
| Yes.It must have been faster to try for yourself?Peter LarssonHelsingborg, Sweden |
 |
|
|
mageshks
Yak Posting Veteran
59 Posts |
Posted - 2007-06-21 : 06:16:01
|
| Why dont you try While statement..Declare @i as intSet @i=0While (@i<100)begin--Insert statementset @i=@i+1end |
 |
|
|
|
|
|
|
|