Hi - What is the correct syntax to bulk insert into a link table. I
want to link Person 1 to every Product, something like below.
Thanks.
INSERT INTO PersonProducts (PersonID,ProductID)
VALUES (1, Products.ProductID FROM Products)INSERT INTO PersonProducts (PersonID,ProductID)
SELECT 1, Products.ProductID FROM Products|||Thanks!|||Although INSERT...SELECT is the answer to your question, I want to make it
clear that this is not bulk insert. In SQL Server, bulk insert means using
the BULK INSERT Transact-SQL statement, BCP utility, or other APIs that
perform mass insert of external data. INSERT...SELECT is simply a multi-row
insert.
I mention this to avoid confusion since bulk insert is an entirely different
beast.
Hope this helps.
Dan Guzman
SQL Server MVP
"hals_left" <cc900630@.ntu.ac.uk> wrote in message
news:1144063552.967897.165740@.i40g2000cwc.googlegroups.com...
> Hi - What is the correct syntax to bulk insert into a link table. I
> want to link Person 1 to every Product, something like below.
> Thanks.
> INSERT INTO PersonProducts (PersonID,ProductID)
> VALUES (1, Products.ProductID FROM Products)
>|||Thanks for the claification|||Hi Dan,
I am using bulk insert to transfer hugh data from a .dbf file to my sql
server table. Can you guide me in this case what shoud I specify as
fieldterminator and rowterminator?
Thanks in advance.
Regards,
Shailesh
"Dan Guzman" wrote:
> Although INSERT...SELECT is the answer to your question, I want to make it
> clear that this is not bulk insert. In SQL Server, bulk insert means usin
g
> the BULK INSERT Transact-SQL statement, BCP utility, or other APIs that
> perform mass insert of external data. INSERT...SELECT is simply a multi-r
ow
> insert.
> I mention this to avoid confusion since bulk insert is an entirely differe
nt
> beast.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "hals_left" <cc900630@.ntu.ac.uk> wrote in message
> news:1144063552.967897.165740@.i40g2000cwc.googlegroups.com...
>
>|||The BULK INSERT Transact-SQL statement is intended to import 'flat' files.
You can use DTS for 'dbf' files.
Hope this helps.
Dan Guzman
SQL Server MVP
"Shailesh" <Shailesh@.discussions.microsoft.com> wrote in message
news:57FBA5F4-30E7-47F0-A20A-D36408464782@.microsoft.com...
> Hi Dan,
> I am using bulk insert to transfer hugh data from a .dbf file to my sql
> server table. Can you guide me in this case what shoud I specify as
> fieldterminator and rowterminator?
> Thanks in advance.
> Regards,
> Shailesh
> "Dan Guzman" wrote:
>sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment