Re: Need help with a query...

From: Prasad Koukuntla (prasad.koukuntla_at_scapromo.com)
Date: 02/13/04


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
>
>



Relevant Pages

  • Need help with a query...
    ... I have made the following query: ... from sysobjects o ... Yanick Lefebvre ... Please posts answers to the group so all can benefit ...
    (microsoft.public.sqlserver.programming)
  • select object_id(object) returns null
    ... Im having a problem with some objects in some databases returning null when I use select object_id. ... The example below shows one table from sysobjects. ... Regards ... Carlos Souza ...
    (microsoft.public.sqlserver.server)
  • Re: How to get table list from a db? Thanks!
    ... FROM sysobjects ... WHERE xtype = 'U' ... best Regards, ... Chandra ...
    (comp.databases.ms-sqlserver)
  • The size of the DB
    ... Could any one tell me in wich system table (sysobjects, ... sysnames, etc) is stored the actual size of the Data Bases ... Regards ...
    (microsoft.public.sqlserver.security)
  • Re: Get List of Table names in database
    ... FROM sysobjects t1 ... INNER JOIN sysindexes t2 ... > Best Regards ...
    (microsoft.public.sqlserver.programming)