all groups > sql server programming > june 2006 >
You're in the

sql server programming

group:

IDENTITY SELECT


RE: IDENTITY SELECT Greg Larsen
6/23/2006 1:25:02 PM
sql server programming:
Here is an article I wrote about this that might help:

http://www.databasejournal.com/features/mssql/article.php/2244821


[quoted text, click to view]
Re: IDENTITY SELECT Alexander Kuznetsov
6/23/2006 1:48:53 PM
if you are on SS 2005, use row_number()
Re: IDENTITY SELECT Aaron Bertrand [SQL Server MVP]
6/23/2006 4:32:41 PM
I have an article too. Not to compete with Greg, in fact I'm sure they're
similar. Just posting for completeness.
http://www.aspfaq.com/2427





[quoted text, click to view]

IDENTITY SELECT Taha
6/23/2006 10:07:04 PM
Hi All

How Can I Select From Table With IDENTITY For Row Count
The Table Has No IDENTITY Column

Select Col1,IDENTITY As Col2 From My Table

Col1 Col2
A 1
B 2
C 3
D 4
... ..

Thanks





Re: IDENTITY SELECT Taha
6/23/2006 10:31:42 PM
OK

Thank You Greg Larsen
[quoted text, click to view]

Re: IDENTITY SELECT MYBESTFUTURE FUTURE
6/23/2006 11:13:24 PM


Hi,

I have one table with IDENTITY column,

how can i get the name of that identity column using query?

is it possible, create a table with more than one identity column?

Re: IDENTITY SELECT Dan Guzman
6/24/2006 12:00:00 AM
[quoted text, click to view]

One method:

SELECT name
FROM syscolumns
WHERE
id = OBJECT_ID(N'dbo.MyTable')
AND COLUMNPROPERTY(id, name, 'IsIdentity') = 1

[quoted text, click to view]

No, but why would you need to do this?

BTW, it's probably better to start a new thread since your questions are off
topic of this one.

--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]

AddThis Social Bookmark Button