April 10, 2011 at 10:22 pm
well
I want to script only database relations without table script except the script must have all 'drop relation' statements,then it must contain 'create relation' statements,is there any system or catalog view which I can use?
April 11, 2011 at 1:11 am
a.ghasemi (4/10/2011)
is there any system or catalog view which I can use?
Yes. It's in Books Online.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 11, 2011 at 2:54 am
what type of answer is it?
please read my question again
April 11, 2011 at 6:02 am
a.ghasemi (4/10/2011)
wellI want to script only database relations without table script except the script must have all 'drop relation' statements,then it must contain 'create relation' statements,[font="Arial Black"]is there any system or catalog view which I can use?[/font]
a.ghasemi (4/11/2011)
what type of answer is it?please read my question again
It's the one that answers your question which I've bolded in your original question. 😉
Lookup "FOREIGN KEY constraints, disabling" in Books Online. It tells you where the proper catalog view to use, etc. It should take you just a couple of minutes to work out a script on your own. I'm trying to help you help yourself. :w00t:
--Jeff Moden
Change is inevitable... Change for the better is not.
April 11, 2011 at 6:24 am
thanks for replying
but when I say that is there any system or catalog view,I mean if any type of view exists which holds complete script of the relations not only the name of the relations,for example syscomments view has a column named text which holds the actual script of stored procedures and triggers but I didn't find anything for relations.
if you mean the generate script wizard of sql server,it only produces the script of relations with create table script,but I want only all of the relations together, first drop statements of relations then create statement of relations and nothing more
April 11, 2011 at 6:31 am
Let me translate.
Jeff wants you to learn to do it yourself and he gave you the exact reference you need.
Plan B would be to use google for a fully made script. I don't have 1 I can send you.
April 11, 2011 at 6:50 am
Ok,I got this,but you can be sure that I have searched in internet and MSDN but I didn't find anything
April 11, 2011 at 6:55 am
I'm not sure what terms you might have searched for, so try a google search for
sql server script database relations
or
sql server script foreign keys
Lowell
April 11, 2011 at 6:55 am
2nd link in google.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply