Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

Identity Columns Expand / Collapse
Author
Message
Posted Saturday, April 26, 2008 12:08 PM
SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Friday, May 18, 2007 3:36 PM
Points: 10,039, Visits: 1
Comments posted to this topic are about the item Identity Columns
Post #491077
Posted Saturday, April 26, 2008 12:09 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 10:28 PM
Points: 35,215, Visits: 31,666
As with so many types of testing, you must also test your "made up" questions as well. This question actually has two correct answers... made up or not... ;)

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #491078
Posted Saturday, April 26, 2008 12:42 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Sunday, July 1, 2012 8:44 AM
Points: 205, Visits: 105
I kept looking for checkboxes to select both correct answers. Lucky I guessed right which one you were looking for. Although I suppose you could argue that the syntax for the other "correct answer" was a little off because you can't query "sys.columns.is_identity", you'd actually do "select * from sys.columns where is_identity=1".
Post #491080
Posted Sunday, April 27, 2008 6:36 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, September 15, 2008 12:02 PM
Points: 1,318, Visits: 57
Burned again. For the reasons already stated


Post #491118
Posted Sunday, April 27, 2008 6:41 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, July 18, 2013 8:20 AM
Points: 277, Visits: 410
Hmmm... it depends on your point of view. If you view the syntax literally, then only one answer is correct.

However, if you view the possible answers as pseudocode, then "Query sys.columns.is_identity for a value of 1" can be interpreted:

SELECT [object_id], [name] FROM sys.columns
WHERE is_identity = 1

This is also correct.

Thanks!
akv
Post #491120
Posted Sunday, April 27, 2008 10:24 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, October 21, 2008 12:40 AM
Points: 4, Visits: 11
What about using sp_columns on the table? That has a column with identity yes/no...
Post #491181
Posted Sunday, April 27, 2008 11:40 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 2, 2008 3:17 AM
Points: 6, Visits: 36
There Is no such a way when database engine is SQL server 2000.the following query returns error:
SELECT [object_id], [name] FROM sys.columns
WHERE is_identity = 1
Post #491185
Posted Monday, April 28, 2008 12:14 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Monday, September 3, 2012 11:06 AM
Points: 659, Visits: 56
I agree that there should be 2 correct answers.


Post #491198
Posted Monday, April 28, 2008 12:25 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 3:19 AM
Points: 5,371, Visits: 1,391
These types of problems should be taken care. Otherwise it becomes very confusing. In another forum we already discussed about these problems.

:)



Post #491202
Posted Monday, April 28, 2008 1:38 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, June 5, 2014 6:18 AM
Points: 1,140, Visits: 326
:) Agree with the above :) question setters please check all answers first :)
Post #491221
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse