February 28, 2013 at 9:51 am
Question: when inserting data into a table I thought it had to be INSERT INTO table VALUES ... but the question is INSERT T1 Values. I guessed Error because it wouldn't make it to the update. Please let me know if this is a valid way to write an insert statement.
Thanks.
February 28, 2013 at 9:57 am
DBA by default (2/28/2013)
Question: when inserting data into a table I thought it had to be INSERT INTO table VALUES ... but the question is INSERT T1 Values. I guessed Error because it wouldn't make it to the update. Please let me know if this is a valid way to write an insert statement.Thanks.
The INTO keyword is optional.
February 28, 2013 at 10:05 am
Thanks I guess you learn something new everyday.
February 28, 2013 at 10:54 am
Just a bit of mental gymnastics... Thanks, Gary!
February 28, 2013 at 12:27 pm
Good question.... Had to stare at it a while due to lack of sleep and too much food. Glad I figured it out and was able to asnwer it though.
February 28, 2013 at 3:21 pm
Nice Question..
Thank You.
February 28, 2013 at 3:22 pm
Thanks for the great question! 😀 I almost pulled the trigger and went 5,6,7,8 but I stopped myself before it was too late.
February 28, 2013 at 11:33 pm
That was an interesting question and thanks for your contribution. 🙂
March 1, 2013 at 9:05 am
EZ PZ
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
March 4, 2013 at 4:59 am
Easy one..
Remembering the basic methodology of Update.
I forget the exact term which prevents data getting updated recursively.
--
Dineshbabu
Desire to learn new things..
March 5, 2013 at 11:11 am
Thanks for the question.
March 7, 2013 at 3:29 am
Thank you for the quetsion easy one for me.
“When I hear somebody sigh, ‘Life is hard,’ I am always tempted to ask, ‘Compared to what?’” - Sydney Harris
March 11, 2013 at 4:16 am
Yes both will have same output . But execuation plan will differ.
March 15, 2013 at 2:24 pm
Good question, but I learned from the question a new option when doing an insert statement. Inserting multiple rows with one SQL statement.
INSERT T1
VALUES ( 1 ),
( 2 ),
( 3 ),
( 4 )
instead of
INSERT T1 VALUES (1)
INSERT T1 VALUES (2)
INSERT T1 VALUES (3)
INSERT T1 VALUES (4)
From what I have read, this is new with 2008 and the introduction of "Table Value Constructors".
http://msdn.microsoft.com/en-us/library/dd776382%28v=sql.105%29.aspx
This will save me a ton of time. I get lists of data all of the time that I have to insert into a temp table and do queries on. I will no longer have to include the "INSERT INTO..." statement for every row.
Very Nice,
Anton
April 8, 2013 at 6:37 am
Good question. +1
Viewing 15 posts - 16 through 30 (of 30 total)
You must be logged in to reply to this topic. Login to reply