Click here to Skip to main content
15,899,026 members
Home / Discussions / Database
   

Database

 
GeneralRe: the opposite of 'Safe' Pin
Richard MacCutchan9-Feb-11 23:01
mveRichard MacCutchan9-Feb-11 23:01 
GeneralRe: the opposite of 'Safe' Pin
Ali Al Omairi(Abu AlHassan)11-Feb-11 13:50
professionalAli Al Omairi(Abu AlHassan)11-Feb-11 13:50 
GeneralRe: the opposite of 'Safe' Pin
thatraja10-Feb-11 14:28
professionalthatraja10-Feb-11 14:28 
GeneralRe: the opposite of 'Safe' Pin
Ali Al Omairi(Abu AlHassan)11-Feb-11 4:29
professionalAli Al Omairi(Abu AlHassan)11-Feb-11 4:29 
GeneralRe: the opposite of 'Safe' Pin
thatraja11-Feb-11 4:36
professionalthatraja11-Feb-11 4:36 
GeneralRe: the opposite of 'Safe' Pin
Ali Al Omairi(Abu AlHassan)11-Feb-11 12:57
professionalAli Al Omairi(Abu AlHassan)11-Feb-11 12:57 
QuestionGetting Constraint Names through ADO Pin
kmoorevs9-Feb-11 10:23
kmoorevs9-Feb-11 10:23 
AnswerRe: Getting Constraint Names through ADO Pin
Ali Al Omairi(Abu AlHassan)9-Feb-11 11:43
professionalAli Al Omairi(Abu AlHassan)9-Feb-11 11:43 
Sir, I don't know what do you want exactly but i think this would help.

SQL
select
  parobj.name as 'ParentTable',
  concol.name as 'ConstrantColumn',
  refobj.name as 'ReferencedTable',
  refcol.name as 'ReferencedColumn'
from sys.foreign_key_columns
inner join sys.objects as parobj
  on parobj.object_id = sys.foreign_key_columns.parent_object_id
inner join sys.columns  as concol
  on concol.column_id = sys.foreign_key_columns.constraint_column_id and
     concol.object_id = sys.foreign_key_columns.parent_object_id
inner join sys.objects as refobj
  on refobj.object_id = sys.foreign_key_columns.referenced_object_id
inner join sys.columns  as refcol
  on refcol.column_id = sys.foreign_key_columns.referenced_column_id and
     refcol.object_id = sys.foreign_key_columns.referenced_object_id


or may be this:

SQL
SELECT OBJECT_NAME(OBJECT_ID) AS 'NameofConstraint',
SCHEMA_NAME(schema_id) AS 'SchemaName',
OBJECT_NAME(parent_object_id) AS 'TableName',
type_desc AS 'ConstraintType'
FROM sys.objects
WHERE type_desc LIKE '%CONSTRAINT'


100 Rose | [Rose] Wink | ;)
Help people,so poeple can help you.

QuestionGetting a numbered list to come out of ORDER BY just right -- ANSWERED THANK YOU Pin
Brian C Hart9-Feb-11 9:16
professionalBrian C Hart9-Feb-11 9:16 
AnswerRe: Getting a numbered list to come out of ORDER BY just right Pin
David Mujica9-Feb-11 9:32
David Mujica9-Feb-11 9:32 
GeneralRe: Getting a numbered list to come out of ORDER BY just right Pin
Brian C Hart9-Feb-11 9:45
professionalBrian C Hart9-Feb-11 9:45 
AnswerRe: Getting a numbered list to come out of ORDER BY just right Pin
Chris Meech9-Feb-11 9:50
Chris Meech9-Feb-11 9:50 
GeneralRe: Getting a numbered list to come out of ORDER BY just right Pin
Brian C Hart9-Feb-11 10:00
professionalBrian C Hart9-Feb-11 10:00 
QuestionDynamic query in SQL Pin
siva4558-Feb-11 22:11
siva4558-Feb-11 22:11 
AnswerRe: Dynamic query in SQL Pin
Simon_Whale8-Feb-11 22:19
Simon_Whale8-Feb-11 22:19 
AnswerRe: Dynamic query in SQL Pin
Dalek Dave9-Feb-11 13:07
professionalDalek Dave9-Feb-11 13:07 
QuestionUnwanted recordset behaviour !!! Pin
scorp_scorp7-Feb-11 21:20
scorp_scorp7-Feb-11 21:20 
AnswerRe: Unwanted recordset behaviour !!! Pin
Mycroft Holmes7-Feb-11 22:26
professionalMycroft Holmes7-Feb-11 22:26 
GeneralRe: Unwanted recordset behaviour !!! [modified] Pin
scorp_scorp7-Feb-11 23:16
scorp_scorp7-Feb-11 23:16 
GeneralRe: Unwanted recordset behaviour !!! Pin
Mycroft Holmes8-Feb-11 2:45
professionalMycroft Holmes8-Feb-11 2:45 
QuestionRe: Unwanted recordset behaviour !!! Pin
Chris Meech8-Feb-11 2:37
Chris Meech8-Feb-11 2:37 
AnswerRe: Unwanted recordset behaviour !!! Pin
Mycroft Holmes8-Feb-11 2:44
professionalMycroft Holmes8-Feb-11 2:44 
QuestionRe: Unwanted recordset behaviour !!! Pin
Chris Meech8-Feb-11 2:40
Chris Meech8-Feb-11 2:40 
QuestionRe: Unwanted recordset behaviour !!! [modified] Pin
scorp_scorp8-Feb-11 16:26
scorp_scorp8-Feb-11 16:26 
AnswerRe: Unwanted recordset behaviour !!! Pin
Jörgen Andersson8-Feb-11 22:31
professionalJörgen Andersson8-Feb-11 22:31 

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.