
sql - Insert into ... values ( SELECT ... FROM ... ) - Stack Overflow
Aug 25, 2008 · 1896 I am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible for many database engines, I always seem to struggle to remember the …
SQL Server Insert Example - Stack Overflow
46 I switch between Oracle and SQL Server occasionally, and often forget how to do some of the most trivial tasks in SQL Server. I want to manually insert a row of data into a SQL Server database table …
SQL Server INSERT INTO with WHERE clause - Stack Overflow
I'm trying to insert some mock payment info into a dev database with this query: INSERT INTO Payments(Amount) VALUES(12.33) WHERE Payments.CustomerID = '145300'; How can adjust...
sql - How to insert a value that contains an apostrophe (single quote ...
Dec 16, 2009 · The apostrophe, or single quote, is a special character in SQL that specifies the beginning and end of string data. This means that to use it as part of your literal string data you need …
sql - Getting new IDs after insert - Stack Overflow
insert into sometable select somefield as someval from othertable when I've finished, I'd like to know the IDs of all the newly inserted rows. SCOPE_IDENTITY() only returns the ID last row inserted. How …
Avoid duplicates in INSERT INTO SELECT query in SQL Server
INSERT IGNORE INTO Table2(Id, Name) SELECT Id, Name FROM Table1 Does SQL Server have anything similar?
sql - INSERT vs INSERT INTO - Stack Overflow
May 27, 2017 · 5 In SQL Server 2005, you could have something in between INSERT and INTO like this: INSERT top(5) INTO tTable1 SELECT * FROM tTable2; Though it works without the INTO, I …
sql - Best way to do multi-row insert in Oracle? - Stack Overflow
INSERT INTO a_table (column_a, column_b) SELECT column_a, column_b FROM b_table; Otherwise, you can list a bunch of single row insert statements and submit several queries in bulk to save the …
Inserting multiple rows in a single SQL query? - Stack Overflow
Jan 17, 2009 · In SQL Server 2008 you can insert multiple rows using a single INSERT statement.
SQL Server - How to insert a record and make sure it is unique
Feb 22, 2012 · INSERT INTO Words (Word) SELECT @Word WHERE NOT EXISTS (SELECT WordID FROM Words WHERE Word = @Word) basically, insert a word when it doesn't exist. Bad syntax …