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 |
Niki
Yak Posting Veteran
51 Posts |
Posted - 2013-01-09 : 12:45:07
|
IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'TblTempCPA') DROP TABLE TblTempCPA GO CREATE TABLE TblTempCPA ( StudentNo Varchar(10) NOT NULL, StudentName Varchar(100), ExitReason Varchar(10), CompletionSts Varchar(10), CONSTRAINT pk_TblTempCPA PRIMARY KEY (StudentNo) );
GO
bcp dbo.TblTempCPA in 'C:\Current_CPA_CTE.xlsx' -T
The error I am getting is - Msg 102, Level 15, State 1, Line 4 Incorrect syntax near '.'.
My excel sheet may have duplicate Studentno though. Is that the problem or BCP syntax?
Niki |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2013-01-09 : 12:57:43
|
BCP is a command line utility. You need to run it from a command window. If you want to run it from a query window in SSMS, you should use xp_cmdshell. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|