back and created my own code to do this now. The INFORMATION_SCHEMA is
pretty darn handy:
select
tab.table_catalog,
tab.table_schema,
tab.table_name,
col.column_name,
col.ordinal_position
from
INFORMATION_SCHEMA.TABLE_CONSTRAINTS tab
INNER JOIN
INFORMATION_SCHEMA.KEY_COLUMN_USAGE col
ON tab.constraint_name = col.constraint_name
where
tab.table_name = YOUR TABLE NAME' AND
constraint_type = 'PRIMARY KEY'
ORDER BY
ordinal_position
--
Marlon Moyer, Sr. Internet Developer
American Contractors Insurance Group
phone: 972.687.9445
fax: 972.687.0607
mailto:[EMAIL PROTECTED]
www.acig.com
> -----Original Message-----
> From: Thomas Chiverton [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 23, 2004 8:12 AM
> To: CF-Talk
> Subject: Re: Query to find Primary key?
>
> On Thursday 22 Apr 2004 19:41 pm, Marlon Moyer wrote:
> > SELECT case isNullable when 1 then 0 else 1 end as
required,
>
> What about non-nullable fields that aren't a PK ?
>
> --
> Tom Chiverton
> Advanced ColdFusion Programmer
>
> Tel: +44(0)1749 834997
> email: [EMAIL PROTECTED]
> BlueFinger Limited
> Underwood Business Park
> Wookey Hole Road, WELLS. BA5 1AF
> Tel: +44 (0)1749 834900
> Fax: +44 (0)1749 834901
> web: www.bluefinger.com
> Company Reg No: 4209395 Registered Office: 2 Temple Back East, Temple
> Quay, BRISTOL. BS1 6EG.
> *** This E-mail contains confidential information for the addressee
> only. If you are not the intended recipient, please notify us
> immediately. You should not use, disclose, distribute or copy this
> communication if received in error. No binding contract will result
from
> this e-mail until such time as a written document is signed on behalf
of
> the company. BlueFinger Limited cannot accept responsibility for the
> completeness or accuracy of this message as it has been transmitted
over
> public networks.***
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

