Friday, March 23, 2012

PRIMARY key?

Hi, how to list the table's PRIMARY key info?Select Constraint_name,Constraint_type,Table_Na
me
from Information_schema.Table_constraints
WHere Constraint_Type = 'PRIMARY KEY'
AND Table_Name = 'Orders'
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"js" <js@.someone@.hotmail.com> schrieb im Newsbeitrag
news:Otfg71mVFHA.2420@.TK2MSFTNGP12.phx.gbl...
> Hi, how to list the table's PRIMARY key info?
>|||sp_primarykeys
Returns the primary key columns, one row per key column, for the specified
remote table.
"js" <js@.someone@.hotmail.com> wrote in message
news:Otfg71mVFHA.2420@.TK2MSFTNGP12.phx.gbl...
> Hi, how to list the table's PRIMARY key info?
>|||Thanks Jens...
"Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote in
message news:Omd806mVFHA.3316@.TK2MSFTNGP14.phx.gbl...
> Select Constraint_name,Constraint_type,Table_Na
me
> from Information_schema.Table_constraints
> WHere Constraint_Type = 'PRIMARY KEY'
> AND Table_Name = 'Orders'
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "js" <js@.someone@.hotmail.com> schrieb im Newsbeitrag
> news:Otfg71mVFHA.2420@.TK2MSFTNGP12.phx.gbl...
>|||also want to know what fields are component of the key, how to know?
"Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote in
message news:Omd806mVFHA.3316@.TK2MSFTNGP14.phx.gbl...
> Select Constraint_name,Constraint_type,Table_Na
me
> from Information_schema.Table_constraints
> WHere Constraint_Type = 'PRIMARY KEY'
> AND Table_Name = 'Orders'
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "js" <js@.someone@.hotmail.com> schrieb im Newsbeitrag
> news:Otfg71mVFHA.2420@.TK2MSFTNGP12.phx.gbl...
>|||Perhaps you should consider the Information Views on your own to see what
you can do with that:
http://www.insidesql.de/index.php?o...tart=0&limit=50
Regards, Jens.
"js" <js@.someone@.hotmail.com> schrieb im Newsbeitrag
news:uLJCI9mVFHA.3424@.TK2MSFTNGP09.phx.gbl...
> also want to know what fields are component of the key, how to know?
> "Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> wrote
> in message news:Omd806mVFHA.3316@.TK2MSFTNGP14.phx.gbl...
>

No comments:

Post a Comment