Showing posts with label indexed. Show all posts
Showing posts with label indexed. Show all posts

Sunday, February 19, 2012

How to know a column whether indexed or not in sql2k

i'll be appreciated any help !Hi
Lookup COLUMNPROPERTY in the BOL
"joy.net" <luxingyu1@.hotmail.com> wrote in message
news:%233BF4Ff2FHA.472@.TK2MSFTNGP15.phx.gbl...
> i'll be appreciated any help !
>
>

how to know a column was indexed or not ?

hi
iam a csharp developer . the problem is i don't know how to select in
systables of sqlserverThe systable is in the master database. I hope the user you are connecting
through has permission to access the master database.
In case the user does have permission you will be able to query... find a
sample query below
select * from master.dbo.syscolumns
"joy.net" wrote:

> hi
> iam a csharp developer . the problem is i don't know how to select in
> systables of sqlserver
>
>|||sysDatabases is in Master, syscolumns, sysobjects only gives you the
tables,indexes etc that are contained in master, it does not give a 'global'
view of every table.
If you want the columns, tables, indexes for the current database you need
to use the system objects in that database.
select * from TargetDatabase..sysobjects where xtype = 'u'
"Karthik" <Karthik@.discussions.microsoft.com> wrote in message
news:F74BF6BD-22F0-41A5-97D8-35775813157E@.microsoft.com...
> The systable is in the master database. I hope the user you are connecting
> through has permission to access the master database.
> In case the user does have permission you will be able to query... find a
> sample query below
> select * from master.dbo.syscolumns
> "joy.net" wrote:
>

how to know a column was indexed or not ?

hi
iam a csharp developer . the problem is i don't know how to select in
systables of sqlserverHi Joy
Just check this query:
SELECT i.name, o.name
FROM dbo.sysindexes i
INNER JOIN dbo.sysobjects o
ON i.id = o.id
WHERE indid > 0 AND indid < 255 AND o.type = 'U'
this might help you.
Please let me know if you have any questions
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---
"joy.net" wrote:

> hi
> iam a csharp developer . the problem is i don't know how to select in
> systables of sqlserver
>
>
>