Click here to Skip to main content
16,008,750 members
Home / Discussions / Database
   

Database

 
QuestionCan any one help me in writing this query? Pin
Mahesh16799-Feb-05 19:45
Mahesh16799-Feb-05 19:45 
AnswerRe: Can any one help me in writing this query? Pin
Colin Angus Mackay9-Feb-05 22:38
Colin Angus Mackay9-Feb-05 22:38 
AnswerRe: Can any one help me in writing this query? Pin
numbrel10-Feb-05 4:49
numbrel10-Feb-05 4:49 
GeneralRe: Can any one help me in writing this query? Pin
Yulianto.10-Feb-05 14:29
Yulianto.10-Feb-05 14:29 
AnswerRe: Can any one help me in writing this query? Pin
spsharma10-Feb-05 19:20
spsharma10-Feb-05 19:20 
GeneralRe: Can any one help me in writing this query? Pin
Arjan Einbu10-Feb-05 21:41
Arjan Einbu10-Feb-05 21:41 
Generalretreiving metadata information of s database Pin
padvit9-Feb-05 18:11
padvit9-Feb-05 18:11 
GeneralRe: retreiving metadata information of s database Pin
Colin Angus Mackay9-Feb-05 22:46
Colin Angus Mackay9-Feb-05 22:46 
You don't specify which database product you are using so I shall assume it is SQL Server 2000.
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE AS ccu
INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc 
	ON tc.CONSTRAINT_NAME = ccu.CONSTRAINT_NAME
WHERE CONSTRAINT_TYPE='PRIMARY KEY'
AND tc.TABLE_NAME = 'MyTable'


This assumes also that there is only one schema (dbo) or that there are no tables with the same name in different schemas.

Does this help?


Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums


GeneralRe: retreiving metadata information of s database Pin
padvit10-Feb-05 17:02
padvit10-Feb-05 17:02 
GeneralCreate table error using ADO Pin
elephantstar9-Feb-05 10:43
elephantstar9-Feb-05 10:43 
GeneralRe: Create table error using ADO Pin
elephantstar9-Feb-05 10:59
elephantstar9-Feb-05 10:59 
GeneralSingle Function Pin
Esmo20009-Feb-05 10:41
Esmo20009-Feb-05 10:41 
GeneralRe: Single Function Pin
Christian Graus9-Feb-05 10:47
protectorChristian Graus9-Feb-05 10:47 
GeneralStyle Pin
Esmo20009-Feb-05 10:19
Esmo20009-Feb-05 10:19 
GeneralRe: Style Pin
Yulianto.10-Feb-05 14:32
Yulianto.10-Feb-05 14:32 
GeneralRe: Style Pin
Arjan Einbu10-Feb-05 21:51
Arjan Einbu10-Feb-05 21:51 
GeneralDatetime Pin
Esmo20009-Feb-05 9:10
Esmo20009-Feb-05 9:10 
GeneralRe: Datetime Pin
Christian Graus9-Feb-05 10:02
protectorChristian Graus9-Feb-05 10:02 
GeneralRe: Datetime Pin
Esmo20009-Feb-05 10:13
Esmo20009-Feb-05 10:13 
GeneralRe: Datetime Pin
Christian Graus9-Feb-05 10:19
protectorChristian Graus9-Feb-05 10:19 
GeneralRe: Datetime Pin
Esmo20009-Feb-05 10:37
Esmo20009-Feb-05 10:37 
GeneralRe: Datetime Pin
Christian Graus9-Feb-05 10:45
protectorChristian Graus9-Feb-05 10:45 
GeneralResult Set Pin
Esmo20009-Feb-05 5:21
Esmo20009-Feb-05 5:21 
GeneralRe: Result Set Pin
Colin Angus Mackay9-Feb-05 6:02
Colin Angus Mackay9-Feb-05 6:02 
GeneralRe: Result Set Pin
Esmo20009-Feb-05 9:04
Esmo20009-Feb-05 9:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.