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
»
SQL Server 2005
»
T-SQL (SS2K5)
»
Totally Dumb Dev Question
Totally Dumb Dev Question
Rate Topic
Display Mode
Topic Options
Author
Message
Shaun McGuile
Shaun McGuile
Posted Thursday, December 18, 2008 7:58 AM
Mr or Mrs. 500
Group: General Forum Members
Last Login: Thursday, October 04, 2012 9:20 AM
Points: 583,
Visits: 1,060
One dev just asked me
"If you have a table with an autogen id column, and a datetime column which defaults to now() (dev speak for CURRENT_TIMESTAMP :) ) can you just insert rows without adding anything else?"
Hmmm I thought sounds bizzare insert a row without adding any other data................
I don't think it would work.... how do you do the insert?
You have to add something to the row to get it to generate an instance of a row and bind it to the table. i.e. a data item into a third column.
(Time to educate with extreme predjudice) :D
--Shaun
Hiding under a desk from SSIS Implemenation Work
Post #622104
ChrisM@Work
ChrisM@Work
Posted Thursday, December 18, 2008 8:02 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 9:15 AM
Points: 5,603,
Visits: 10,959
Hi Shaun
Wasn't this a qotd earlier in the year?
INSERT INTO table Default Values
“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.”
- Gail Shaw
For fast, accurate and documented assistance in answering your questions, please read
this article
.
Understanding and using APPLY, (I)
and
(II)
Paul White
Hidden RBAR: Triangular Joins
/
The "Numbers" or "Tally" Table: What it is and how it replaces a loop
Jeff Moden
Exploring Recursive CTEs by Example
Dwain Camps
Post #622111
Shaun McGuile
Shaun McGuile
Posted Thursday, December 18, 2008 8:10 AM
Mr or Mrs. 500
Group: General Forum Members
Last Login: Thursday, October 04, 2012 9:20 AM
Points: 583,
Visits: 1,060
Can't say I saw that one Chris, but I'll go check it out cheers.
So it is possible
using
INSERT INTO
'tablename'
Default Values
Amazing :D Them devs are not so dumb afterall. :P
--Shaun
Hiding under a desk from SSIS Implemenation Work
Post #622119
« Prev Topic
|
Next Topic »
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.