Re: Need help with a query...
From: Prasad Koukuntla (prasad.koukuntla_at_scapromo.com)
Date: 02/13/04
- Next message: Aaron Bertrand - MVP: "Re: Time Question"
- Previous message: Aaron Bertrand - MVP: "Re: Time Question"
- In reply to: Zoury: "Need help with a query..."
- Next in thread: Zoury: "Re: Need help with a query..."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 13 Feb 2004 13:11:15 -0600
Zoury,
You need to use the INFORMATION_SCHEMA views to get such information. Look
into INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE.
You can use these views in SELECT statements to get the column names for a
constraint.
"Zoury" <yanick_lefebvre at hotmail dot com> wrote in message
news:Oe8tpFm8DHA.4044@tk2msftngp13.phx.gbl...
> Hi there!
>
> I have made the following query :
>
> select o.name
> from sysobjects o
> where o.parent_obj in (
> select o2.id
> from sysobjects o2
> where o2.name = 'Commande') and
> o.xtype = 'PK'
>
> I'd like to add the actual column name in the select list. How can I do
it?
> I not been able to find the link between this and the syscolumns table..
>
> thanks a lot!
>
> --
> Best Regards
> Yanick Lefebvre
>
> Please posts answers to the group so all can benefit
>
>
- Next message: Aaron Bertrand - MVP: "Re: Time Question"
- Previous message: Aaron Bertrand - MVP: "Re: Time Question"
- In reply to: Zoury: "Need help with a query..."
- Next in thread: Zoury: "Re: Need help with a query..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|