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 2005 Forums
 Transact-SQL (2005)
 BCP

Author  Topic 

sanjay5219
Posting Yak Master

240 Posts

Posted - 2014-12-22 : 03:49:06
Hi All,

I have a Excel File which is having three columns
Roll varchar(100)
Name varchar(100)
DOJ datetime

How can I upload this in SQL via BCP Commans

Please Suggest

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-12-22 : 05:04:25
BCP can't read excel file.

Check out this thread http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

sz1
Aged Yak Warrior

555 Posts

Posted - 2014-12-22 : 07:32:47
you can save the xlsx file as a tab-delimited text file and do

BULK INSERT TableName
FROM 'C:\SomeDirectory\my table.txt'
WITH
(
FIELDTERMINATOR = '\t',
ROWTERMINATOR = '\n'
)
GO


We are the creators of our own reality!
Go to Top of Page
   

- Advertisement -