Friday, February 24, 2012

Bulk Insert

Friends,
If I need to import a text file into a pre-existing table using T-SQL, then
BULK INSERT works fine. But I cannot figure out how to import that same tex
t
file, using T-Sql in QA, if no target table currently exists. Is there a wa
y
to do this?
To clarify, I can import the same text file through DTS, even though the Sql
Server db doesn't currently contain a table to import into - I tell DTS to
import the data into Table_X, and DTS takes care of creating the necessary
table, naming column headers, and importig the data. Can I write my own
Bulk Insert statement in QA that performs the same action?
Thanks in advance for your help ...
bill morganI think you will have to create the table upfront and then use BULK INSERT
from QA.
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
"bill_morgan" <billmorgan@.discussions.microsoft.com> wrote in message
news:7292E462-D6F5-47AD-82F8-F194A6A5FB8B@.microsoft.com...
> Friends,
> If I need to import a text file into a pre-existing table using T-SQL,
> then
> BULK INSERT works fine. But I cannot figure out how to import that same
> text
> file, using T-Sql in QA, if no target table currently exists. Is there a
> way
> to do this?
> To clarify, I can import the same text file through DTS, even though the
> Sql
> Server db doesn't currently contain a table to import into - I tell DTS to
> import the data into Table_X, and DTS takes care of creating the necessary
> table, naming column headers, and importig the data. Can I write my own
> Bulk Insert statement in QA that performs the same action?
> Thanks in advance for your help ...
> bill morgan|||Thanks for your input. I think yer right. Good to get that confirmation.
"SriSamp" wrote:

> I think you will have to create the table upfront and then use BULK INSERT
> from QA.
> --
> HTH,
> SriSamp
> Email: srisamp@.gmail.com
> Blog: http://blogs.sqlxml.org/srinivassampath
> URL: http://www32.brinkster.com/srisamp
> "bill_morgan" <billmorgan@.discussions.microsoft.com> wrote in message
> news:7292E462-D6F5-47AD-82F8-F194A6A5FB8B@.microsoft.com...
>
>

No comments:

Post a Comment