Relationship

Discussion in 'ASP .Net' started by shapper, Apr 5, 2007.

  1. shapper

    shapper Guest

    Hello,

    I created some SQL 2005 tables using Microsoft SQL Server Management
    Studio.
    I know wanted to get the script code of those tables.
    I was able to do that by right clicking over each table.

    But how can I get the code for the relationships between the tables?

    Thanks,
    Miguel
    shapper, Apr 5, 2007
    #1
    1. Advertising

  2. If you choose CREATE to script table to a new window, it should replicate the
    T-SQL to create the relationships you have defined.
    Peter

    --
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short urls & more: http://ittyurl.net




    "shapper" wrote:

    > Hello,
    >
    > I created some SQL 2005 tables using Microsoft SQL Server Management
    > Studio.
    > I know wanted to get the script code of those tables.
    > I was able to do that by right clicking over each table.
    >
    > But how can I get the code for the relationships between the tables?
    >
    > Thanks,
    > Miguel
    >
    >
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Apr 5, 2007
    #2
    1. Advertising

  3. On Apr 5, 7:44 pm, "shapper" <> wrote:
    > Hello,
    >
    > I created some SQL 2005 tables using Microsoft SQL Server Management
    > Studio.
    > I know wanted to get the script code of those tables.
    > I was able to do that by right clicking over each table.
    >
    > But how can I get the code for the relationships between the tables?
    >
    > Thanks,
    > Miguel


    In Object Explorer right click on a table, Script Table As... point to
    Create

    It will generate the DDL script with foreign key relationships
    (dependencies to other tables on which the table depends)

    To view the dependencies of a table, right-click a table, and then
    click View Dependencies...
    Alexey Smirnov, Apr 6, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan Davenport via .NET 247

    Bind optional one-to-one relationship to textbox

    Dan Davenport via .NET 247, Aug 4, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    632
    Dan Davenport via .NET 247
    Aug 4, 2004
  2. dbuchanan

    DataGridTableStyle and relationship

    dbuchanan, Nov 29, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    581
    dbuchanan
    Nov 29, 2005
  3. Leon Shaw

    Data Relationship binding

    Leon Shaw, Jul 10, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    563
    Leon Shaw
    Jul 11, 2003
  4. Ken Cox [Microsoft MVP]

    Re: Relationship between IIS Sessions and ASP.NET Sessions?

    Ken Cox [Microsoft MVP], Aug 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    5,355
    Luther Miller
    Aug 8, 2003
  5. Frank
    Replies:
    3
    Views:
    352
Loading...

Share This Page