--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
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
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-
>
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
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
> 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:/
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
>
>
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
> 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
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
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
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
12 matches
Mail list logo