Technically, yes. But, why would you consider using dynamic SQL and xp_cmdshell?
BULK INSERT and BCP are functionally equivalent. BULK INSERT should not force a recompile like dynamic SQL does.
Jay
-----Original Message-----
From: Gordon Rayburn [mailto:mssqldba-ezmlmshield-x21556380.[Email address protected]
Sent: Mon 26-Feb-07 16:48
To: LazyDBA Discussion
Subject: RE: Import data from a tab delimited using SQL?
You can create an sp that constructs dynamic sql to drop to a cmdshell
and execute BCP as well. BULK_INSERT isn't your _only_ option...
-----Original Message-----
From: Jay Butler
[mailto:mssqldba-ezmlmshield-x38570241.[Email address protected]
Sent: Monday, February 26, 2007 1:26 PM
To: LazyDBA Discussion
Subject: RE: Import data from a tab delimited using SQL?
The only thing that you could possibly do from within T-SQL is use the
BULK INSERT command.
Jay
From: Sheldon Jeff
Sent: Mon 26-Feb-07 16:18
To: LazyDBA Discussion
Subject: Import data from a tab delimited using SQL?
Re-writing a journal rename/format process to get it out of Access and
into SQL.
What is the best way to take a regular.txt file and import it into a SQL
table (the mappings are identical so no CONVERT statement needed)
I want to include this action within a stored procedure and not like DTS
or SSIS. I need it as a stored procedure so I can give it to the users
via our ERP system remote stored procedure call system.
Thanks
Jeff
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
------------------------------------------------------------------------------
NOTICE OF CONFIDENTIALITY
The information contained in this communication and any accompanying document(s) is proprietary and confidential and is intended solely for the above-named individual or entity. If you are not the intended receiver, recipient or entity, you are advised that any distribution, copying, disclosure or communication of this email is strictly prohibited. If you have received this email in error, please contact me at the telephone number listed above or 858.716.1500.
==============================================================================
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
MS Sql Server LazyDBA home page