RE: Dynamically Obtaining IDENTITY Column - Off List

2002-02-17 Thread Scott Van Vliet
--Original Message- From: Scott Van Vliet [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 17, 2002 11:26 PM To: CF-Talk Subject: RE: Dynamically Obtaining IDENTITY Column This works as well, however, using SQL functions can be faster. SELECT COL_NAME(OBJECT_ID('#tablename#'),1) As IDC

RE: Dynamically Obtaining IDENTITY Column

2002-02-17 Thread Scott Van Vliet
ED]] Sent: Sunday, February 17, 2002 7:21 PM To: CF-Talk Subject: RE: Dynamically Obtaining IDENTITY Column Ooops I meant At 10:18 PM 2/17/2002 -0500, you wrote: >Well, if you just want to know the name of the first column in your table, > >why don't you do a "select * &q

RE: Dynamically Obtaining IDENTITY Column

2002-02-17 Thread Claudia Hoag
er query, such as: > > > > > >SELECT #qry1.IDColumn# As IDColumn > >FROM #tablename# > > > > > >Thanks for all the input! If anyone knows a better way, please let me > >know! > > > > > > > >-Original Message- >

RE: Dynamically Obtaining IDENTITY Column

2002-02-17 Thread Claudia Hoag
n > > >This could be used in another query, such as: > > >SELECT #qry1.IDColumn# As IDColumn >FROM #tablename# > > >Thanks for all the input! If anyone knows a better way, please let me >know! > > > >-Original Message- >From: Jeff Beer [mail

RE: Dynamically Obtaining IDENTITY Column

2002-02-17 Thread Scott Van Vliet
mn# As IDColumn FROM #tablename# Thanks for all the input! If anyone knows a better way, please let me know! -Original Message- From: Jeff Beer [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 17, 2002 11:42 AM To: CF-Talk Subject: RE: Dynamically Obtaining IDENTITY Column Scott - do y

Re: Dynamically Obtaining IDENTITY Column

2002-02-17 Thread Paul Hastings
> Scott - do you mean the identity value of a newly inserted record, or to > select the ID value when you don't know the name of the identity column? you don't need to know the IDENTITY column to get @@IDENTITY. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http:/

RE: Dynamically Obtaining IDENTITY Column

2002-02-17 Thread Scott Van Vliet
lk Subject: Dynamically Obtaining IDENTITY Column Hey All. Does anyone out there know of a way to dynamically grab the identity column from a table in a select statement? Example: SELECT @@IDENTITY_COLUMN FROM TABLE_NAME Where "@@IDENTITY_COLUMN" would be the function to obtain the value of

Re: Dynamically Obtaining IDENTITY Column

2002-02-17 Thread Paul Hastings
> > since you have only one cfquery cftransaction's not going to be doing much in this example. > > SET NOCOUNT ON > INSERT INTO foo (name) > VALUES ('Homer Simpson') > SELECT PrimaryKey = @@IDENTITY > SET NOCOUNT OFF > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-vir

Re: Dynamically Obtaining IDENTITY Column

2002-02-17 Thread Paul Hastings
> Does anyone out there know of a way to dynamically grab the identity > column from a table in a select statement? if you mean the metadata for which column has an IDENTITY property, "no". but i suppose you could query the syscolumns' status column for IDENTITY (0x80). --- Outgoing mail is cer

RE: Dynamically Obtaining IDENTITY Column

2002-02-17 Thread Jeff Beer
cally Obtaining IDENTITY Column Hey All. Does anyone out there know of a way to dynamically grab the identity column from a table in a select statement? Example: SELECT @@IDENTITY_COLUMN FROM TABLE_NAME Where "@@IDENTITY_COLUMN" would be the function to obtain the value of the identi

RE: Dynamically Obtaining IDENTITY Column

2002-02-17 Thread Mike Townend
ynamically Obtaining IDENTITY Column Hey All. Does anyone out there know of a way to dynamically grab the identity column from a table in a select statement? Example: SELECT @@IDENTITY_COLUMN FROM TABLE_NAME Where "@@IDENTITY_COLUMN" would be the function to obtain the value of the i

Dynamically Obtaining IDENTITY Column

2002-02-17 Thread Scott Van Vliet
Hey All. Does anyone out there know of a way to dynamically grab the identity column from a table in a select statement? Example: SELECT @@IDENTITY_COLUMN FROM TABLE_NAME Where "@@IDENTITY_COLUMN" would be the function to obtain the value of the identity column. TIA. SCOTT VAN VLIET B