dbTalk Databases Forums  

DTS Package With xp_cmdshell

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS Package With xp_cmdshell in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default DTS Package With xp_cmdshell - 07-19-2006 , 02:37 PM






All

Importing an Excel spreadsheet into a table using a DTS package that is
executed using the xp_cmdshell command.

The spreadsheet is located on a shared drive and the first row is the
column names.

The DTS package drops the existing table then re-creates it then
imports the spreadsheet.

This package runs fine if I run it from Enterprise Manager but it
leaves some columns NULL if it's run using the xp_cmdshell command in
SQL Server Agent.
EXEC master..xp_cmdshell 'dtsrun /Sservername /E /NExcelInsert'

Not sure why this is happening. It seems if the first record contains a
NULL value then the remaining rows will import with NULLs.

Thanks Mike


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.