|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
IDENTITY SELECTHere is an article I wrote about this that might help:
http://www.databasejournal.com/features/mssql/article.php/2244821 Show quote "Taha" wrote: > 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 > > > > > > > OK
Thank You Greg Larsen Show quote "Greg Larsen" <GregLar***@discussions.microsoft.com> wrote in message news:CE2DF0A4-859B-465F-A55F-B4630F8917A7@microsoft.com... > Here is an article I wrote about this that might help: > > http://www.databasejournal.com/features/mssql/article.php/2244821 > > > "Taha" wrote: > >> 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 >> >> >> >> >> >> >> 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 Show quote "Taha" <taha***@hotmail.com> wrote in message news:OeRTdCwlGHA.4772@TK2MSFTNGP04.phx.gbl... > 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 > > > > > > 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? *** Sent via Developersdex http://www.developersdex.com *** > how can i get the name of that identity column using query? One method:SELECT name FROM syscolumns WHERE id = OBJECT_ID(N'dbo.MyTable') AND COLUMNPROPERTY(id, name, 'IsIdentity') = 1 > is it possible, create a table with more than one identity column? 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. -- Show quoteHope this helps. Dan Guzman SQL Server MVP "MYBESTFUTURE FUTURE" <mybestfut***@rediffmail.com> wrote in message news:%237y9NV1lGHA.856@TK2MSFTNGP03.phx.gbl... > > > 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? > > *** Sent via Developersdex http://www.developersdex.com *** |
|||||||||||||||||||||||