Interesting | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Interesting

Guess what happens when u run this command ? CREATE TABLE T1 ( TIMESTAMP )
Creates a table called T1 with a single column called timestamp (datatype=timestamp).<br /><br />Ok, I didn’t guess[<img src=’/community/emoticons/emotion-4.gif’ alt=’:p‘ />]<br /><br /><blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by ramasubbup</i><br /><br />Guess what happens when u run this command ? <br /><br />CREATE TABLE T1 ( TIMESTAMP )<br /><br /><br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote"><br /><br />Karl Grambow<br /><br />www.sqldbcontrol.com
How will you insert records now ?
Strange [<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />]<br /><br />Madhivanan<br /><br />Failing to plan is Planning to fail
You should have other column to see the value of TimeStamp Declare @t TABLE ( TIMESTAMP ,i int)
insert into @t(i) select 1
select * from @t
Madhivanan Failing to plan is Planning to fail
Just in case… TIMESTAMP in SQL Server has nothing to do with DATEs and or TIME. SQL Server knows ROWVERSION as the synonym for TIMESTAMP. However running the above statement with ROWVERSION fails. —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt?http://www.insidesql.de/blogs
Ich unterstütze PASS Deutschland e.V. http://www.sqlpass.de)

I wonder why SQL Server allows a table having only one column which is of TimeStamp that cant be inserted explicitly Madhivanan Failing to plan is Planning to fail
Maybe because db design should be done by people who know what they are doing? There is no protection against stupidity. [<img src=’/community/emoticons/emotion-5.gif’ alt=’;)‘ />]
What about SET STUPIDITY LEVEL ? ( server-wide setting ) <img src=’/community/emoticons/emotion-5.gif’ alt=’;-)’ /><br />
I’d much rather have … SET SERENDIPITY OFF
ROTFLMAO [<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />]<br /><br />"There is no ‘patch’ for stupidity."<br /><br /><br />–<br />Frank Kalis<br />Microsoft SQL Server MVP<br /<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a><br />Heute schon gebloggt?<a target="_blank" href=http://www.insidesql.de/blogs>http://www.insidesql.de/blogs</a><br />Ich unterstütze PASS Deutschland e.V. <a target="_blank" href=http://www.sqlpass.de>http://www.sqlpass.de</a>) <br />
quote:Originally posted by Madhivanan I wonder why SQL Server allows a table having only one column which is of TimeStamp that cant be inserted explicitly Madhivanan Failing to plan is Planning to fail

Because TIMESTAMP is reserved for internal usage only, it is NOT intended to be used by users/applications et. al. That is why we have DATETIME…
]]>