Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by Susantha Bathige
»
Identity Columns
17 posts, Page 1 of 2
1
2
»»
Identity Columns
Rate Topic
Display Mode
Topic Options
Author
Message
Susantha Bathige
Susantha Bathige
Posted Saturday, July 05, 2008 11:05 AM
Valued Member
Group: General Forum Members
Last Login: Wednesday, August 08, 2012 1:53 AM
Points: 52,
Visits: 255
Comments posted to this topic are about the item
Identity Columns
Susantha
Post #528874
Iggy-SQL
Iggy-SQL
Posted Sunday, July 06, 2008 5:36 PM
SSCrazy
Group: General Forum Members
Last Login: Sunday, May 19, 2013 7:02 PM
Points: 2,861,
Visits: 405
Good question, I never thought default values can be used for inserting identity value, I always thought it is meant to be for inserting default value only. I learn something new everyday here :D
Urbis
, an urban transformation company
Post #528997
Marius Els
Marius Els
Posted Monday, July 07, 2008 1:54 AM
SSC Veteran
Group: General Forum Members
Last Login: Wednesday, October 31, 2012 3:59 AM
Points: 215,
Visits: 166
Proof that you can teach an old dog some new tricks, probably depends on the willingness to learn though... thanks for the question
Post #529102
Joseph-411461
Joseph-411461
Posted Monday, July 07, 2008 6:51 AM
SSC Eights!
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 2:56 PM
Points: 956,
Visits: 131
I thought that the statement should be INSERT INTO ..., but nobody complains about the missing INTO, so I start doubting: can it work without?
Post #529230
jim.powers
jim.powers
Posted Monday, July 07, 2008 7:21 AM
Ten Centuries
Group: General Forum Members
Last Login: Monday, February 04, 2013 10:00 AM
Points: 1,329,
Visits: 803
Joseph (7/7/2008)
I thought that the statement should be INSERT INTO ..., but nobody complains about the missing INTO, so I start doubting: can it work without?
INTO is an optional keyword. I always use it for readability purposes but it does work without.
Post #529274
Marius Els
Marius Els
Posted Monday, July 07, 2008 8:00 AM
SSC Veteran
Group: General Forum Members
Last Login: Wednesday, October 31, 2012 3:59 AM
Points: 215,
Visits: 166
I can concur on the optional "into", but if memory serves me correctly, if you specify the columns to be inserted, one has to include the "into", or is it still optional even specifying columns?
Post #529324
Lynn Pettis
Lynn Pettis
Posted Monday, July 07, 2008 8:07 AM
SSC-Insane
Group: General Forum Members
Last Login: Yesterday @ 11:52 PM
Points: 21,635,
Visits: 27,495
From BOL regarding the INSERT statement:
INTO
Is an optional keyword that can be used between INSERT and the target table.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #529333
Marius Els
Marius Els
Posted Monday, July 07, 2008 8:10 AM
SSC Veteran
Group: General Forum Members
Last Login: Wednesday, October 31, 2012 3:59 AM
Points: 215,
Visits: 166
that means irrespective of anything, the "into" is optional.
Post #529337
Dariusz Czechowicz-474456
Dariusz Czechowicz-474456
Posted Monday, July 07, 2008 8:29 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 3:29 AM
Points: 124,
Visits: 80
Here is an alternative solution without 'set identity_insert' ;)
INSERT INTO TEST WITH (KEEPIDENTITY) (Col1)
SELECT IDENT_CURRENT('Test') FROM OPENROWSET(BULK N'C:\boot.ini', SINGLE_BLOB) AS a
Post #529359
Pires-502779
Pires-502779
Posted Monday, July 07, 2008 10:13 AM
SSC Journeyman
Group: General Forum Members
Last Login: Thursday, September 16, 2010 3:52 AM
Points: 78,
Visits: 55
Dariusz Czechowicz (7/7/2008)
Here is an alternative solution without 'set identity_insert' ;)
INSERT INTO TEST WITH (KEEPIDENTITY) (Col1)
SELECT IDENT_CURRENT('Test') FROM OPENROWSET(BULK N'C:\boot.ini', SINGLE_BLOB) AS a
We allways have the hard way to do something!
Post #529449
« Prev Topic
|
Next Topic »
17 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.