SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Using Insert Bulk
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

oukuri
Starting Member

India
7 Posts

Posted - 12/18/2012 :  02:25:32  Show Profile  Reply with Quote
Hi i am trying to use 'Insert Bulk' like

Insert Bulk newpersontable select
FIRST_NM,
LST_NM,
MIDDLE_NM,
GNDR,
STU_ID,
CMP_ID,
CALNETUID,
UC_LOC,
ANID
from PERSON

But facing below error
.Net SqlClient Data Provider: Msg 4022, Level 16, State 1, Line 1
Bulk load data was expected but not sent. The batch will be terminated.

Can any one tell how to correct this

oukuri

bandi
Flowing Fount of Yak Knowledge

India
2202 Posts

Posted - 12/18/2012 :  02:29:01  Show Profile  Reply with Quote
If both table newpersontable, person tables are in same database and same instance, then
Insert INTO Bulk newpersontable
SELECT FIRST_NM, LST_NM, MIDDLE_NM, GNDR,STU_ID,CMP_ID,CALNETUID,UC_LOC, ANID
from PERSON

--
Chandu

Edited by - bandi on 12/18/2012 02:35:29
Go to Top of Page

oukuri
Starting Member

India
7 Posts

Posted - 12/18/2012 :  05:37:11  Show Profile  Reply with Quote
Incorrect syntax near the keyword 'Bulk'.

oukuri
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2202 Posts

Posted - 12/18/2012 :  05:38:28  Show Profile  Reply with Quote
quote:
Originally posted by oukuri

Incorrect syntax near the keyword 'Bulk'.
oukuri

Strike out that part, then execute...
Insert INTO newpersontable
SELECT FIRST_NM, LST_NM, MIDDLE_NM, GNDR,STU_ID,CMP_ID,CALNETUID,UC_LOC, ANID
from PERSON

If the tables are in different servers, then you have to use linked server..



--
Chandu

Edited by - bandi on 12/18/2012 05:46:46
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000