This is the talk page for discussing improvements to the Insert (SQL) article. This is not a forum for general discussion of the article's subject. |
Article policies
|
Find sources: Google (books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
This article is rated C-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||
|
untitled
editDoes anybody know anything about the FIELDS keyword? This actually works in oracle: insert into mytable FIELDS (x,y,z) values(1,2,3); I've been using SQL for 20 years and have never seen it before! I would bet this keyword was used in an early version of Oracle and never taken out. It's certainly not documented nor standard.
—Preceding unsigned comment added by 216.79.87.141 (talk) 18:09, 30 September 2008 (UTC)
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 usesCREATE TABLE new_table_name LIKE old_table_name
; both is irrelevant to the INSERT statement, however. --Stolze 10:56, 30 October 2006 (UTC)
Merge
editRecommend merging UPDATE, INSERT, DELETE, MERGE and SELECT statements into DML article and redirecting these statements there. Comments? SqlPac 05:16, 17 May 2007 (UTC)
POLICY DEBATE: Use of source code and other examples in articles
editSomeone 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)
MS SQL INSERT
editThe 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)
MS SQL Multi-Insert
editOne can also do multi-inserts using a more friendly syntax
INSERT INTO phone_book VALUES ('John Doe', '555-1212'), ('Peter Doe', '555-2323');
Why is a union construction given as the MS SQL example? Xorlev (talk) 00:45, 25 February 2011 (UTC)
mysql INSERT with SET
editas far as i know there is another Syntax for INSERT in MySQL it is like
INSERT INTO table_name SET column_1=value_1, column_2=value_2[, column_n=value_n]
please correct me if i am wrong o.O