I know I've done this before years ago, but I can't remember the syntax, and I can't find it anywhere due to pulling up tons of help docs and articles about "bulk imports".
(我知道我已经在几年前做过这个了,但是我不记得语法了,由于提取了大量关于“批量进口”的帮助文档和文章,我无法在任何地方找到它。)
Here's what I want to do, but the syntax is not exactly right... please, someone who has done this before, help me out :)
(这是我想要做的,但语法不完全正确...请,之前做过这个的人,帮帮我:))
INSERT INTO dbo.MyTable (ID, Name)
VALUES (123, 'Timmy'),
(124, 'Jonny'),
(125, 'Sally')
I know that this is close to the right syntax.
(我知道这接近正确的语法。)
I might need the word "BULK" in there, or something, I can't remember. (我可能在那里需要“BULK”这个词,或者其他东西,我不记得了。)
Any idea? (任何的想法?)
I need this for a SQL Server 2005 database.
(我需要这个SQL Server 2005数据库。)
I've tried this code, to no avail: (我试过这段代码,但无济于事:)
DECLARE @blah TABLE
(
ID INT NOT NULL PRIMARY KEY,
Name VARCHAR(100) NOT NULL
)
INSERT INTO @blah (ID, Name)
VALUES (123, 'Timmy')
VALUES (124, 'Jonny')
VALUES (125, 'Sally')
SELECT * FROM @blah
I'm getting Incorrect syntax near the keyword 'VALUES'.
(我Incorrect syntax near the keyword 'VALUES'.
获得了Incorrect syntax near the keyword 'VALUES'.
)
ask by Timothy Khouri translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…