I want to judge whether a field is a primary key, how could I complete the following code. 
Author Message
 I want to judge whether a field is a primary key, how could I complete the following code.

I want to judge whether a field is a primary key, how could I complete the
following code.

    select syscolumns.name as 'column',
            systypes.name as 'type',
            syscolumns.length as 'length',
            syscolumns.isnullable as 'isnullable'
    from syscolumns inner join systypes
    on syscolumns.xtype = systypes.xtype
    where syscolumns.id = 1669580986
            and systypes.name <> 'sysname'
    order by syscolumns.colid



Sat, 23 Oct 2004 16:14:43 GMT  
 I want to judge whether a field is a primary key, how could I complete the following code.
Note, this is the C# newsgroup,
  you can do:  if, then, else, do, for, while, switch, case, class, struct...
but not SQL!

only use the specific:
   microsoft.public.dotnet.framework.adonet

--
  NETMaster  (Thomas Scheidegger)
  http://www.cetus-links.org/oo_csharp.html

Quote:

> I want to judge whether a field is a primary key, how could I complete the
> following code.
>     select syscolumns.name as 'column',
>             systypes.name as 'type',
>             syscolumns.length as 'length',
>             syscolumns.isnullable as 'isnullable'
>     from syscolumns inner join systypes
>     on syscolumns.xtype = systypes.xtype
>     where syscolumns.id = 1669580986
>             and systypes.name <> 'sysname'
>     order by syscolumns.colid



Sat, 23 Oct 2004 16:48:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. You have a problem with an AutoNumber,Inkrement,Primary key field

2. How to judge whether a string is a valid number

3. How to know whether i am connected

4. how to know whether i am connected

5. Can't delete rows from a table in SQL Server 2000 without a primary key

6. auto-increment the primary key with datasets

7. Primary key

8. getting primary key with ExecuteNonQuery

9. How can I get Primary Key from mdb ??

10. can't create primary key

11. Primary key, ATL

12. is it primary key or not ?

 

 
Powered by phpBB® Forum Software