Talk:Insert (SQL)

From Wikipedia, the free encyclopedia

This article is within the scope of WikiProject Databases.
??? This article has not yet received a rating on the assessment scale.
??? This article has not yet received an importance rating on the assessment scale.

I want to create a new table that have the same structure of an existing table. I don't want the records to be inserted in new table. I want only the structure of existing table.

SQL:2003 says: CREATE TABLE new_table_name [(column_names)] AS <subquery> WITH [NO] DATA. DB2 uses CREATE TABLE new_table_name LIKE old_table_name; both is irrelevant to the INSERT statement, however. --Stolze 10:56, 30 October 2006 (UTC)

[edit] Merge

Recommend merging UPDATE, INSERT, DELETE, MERGE and SELECT statements into DML article and redirecting these statements there. Comments? SqlPac 05:16, 17 May 2007 (UTC)

[edit] POLICY DEBATE: Use of source code and other examples in articles

Someone started a policy debate concerning the use of source code in articles, that seems to directly impact this (and possibly other Database articles). See below for details:

I have opened a debate on the use of source code and other examples in Wikipedia articles. It seems that many pieces of example source code etc. currently in Wikipedia violate Wikipedia policy, so we need to either clarify or change the situation. Depending on the result of the discussion, this may result in a number of source code examples being summarily removed from computing articles!

Please reply there, not here, if you wish to contribute.—greenrd 10:50, 18 May 2007 (UTC)

Thanks.SqlPac 15:08, 18 May 2007 (UTC)

[edit] MS SQL INSERT

The article claims you have to do something like this for "MS SQL":

INSERT INTO TableName SELECT "somthing", 23

Is MS SQL something different from T-SQL used by SQL Server 2005/2008, because I know you can do this on SQL Server 2005:

INSERT INTO TableName VALUES ('somthing', 23)