patternsqlMinor
Has SELECT an INSERT clause?
Viewed 0 times
hasselectinsertclause
Problem
I know the form
statement. Bur recently I found 2 posts here and here which use it like
I find nothing in msdn, is that some new syntax or just a fault? I guess the later because
would work fine.
Select * into new_table from old_tablestatement. Bur recently I found 2 posts here and here which use it like
SELECT * FROM NhlPlayer
INSERT INTO PlayerBackupsI find nothing in msdn, is that some new syntax or just a fault? I guess the later because
INSERT INTO PlayerBackups
SELECT * FROM NhlPlayerwould work fine.
Solution
Both posts are wrong syntax.
I've -1 in the first from SO and left a comment on the second.
Create a table
Inserts to an existing table
I've -1 in the first from SO and left a comment on the second.
Create a table
SELECT * INTO PlayerBackups FROM NhlPlayerInserts to an existing table
INSERT PlayerBackups SELECT * FROM PlayerBackupsCode Snippets
SELECT * INTO PlayerBackups FROM NhlPlayerINSERT PlayerBackups SELECT * FROM PlayerBackupsContext
StackExchange Database Administrators Q#5465, answer score: 9
Revisions (0)
No revisions yet.