constraint confusion using enterprise manager

  • Hi,

    Bit of background first. I'm an oracle dba, who's been asked to work on a sqlserver project. Not much sqlserver experience I must admit.

    I'm using enterprise manager and the diagram tool(?)

    I have created 2 tables - Table A and Table B

    I create a primary key on Column 1 in Table A

    I drag the column over to Table B and it auto creates a foreign key (column 1).

    This is fine. It must create a foreign key constraint, but I don't know how to access the sql that it generated.

    How do I access the sql generated. In oracle enterprise manager, there is a 'show sql' button.

    Now. If I have a new column in Table B, say Column 2 and I drag that and drop it on to the primary key column in Table A, it creates a relationship line.

    What I need to know is. What relationship has it created? Is it a constraint? How do I get to the damn sql it generated!?

    Assume that all columns are number(4).

    Many thanks

  • First, which version of SQL Server are you using? Is it 2000 or 2005? The reason I ask is that you posted in the 2005 forums, but Enterprise MAnager is a 2000 tool.

    I'll move this to the 2000 forums for now.

    If you click a table, right click, then there's a TASK option and inside there is the Generate SQL option. That will give you the ability to see the SQL.

  • Hi, Horace

    I just posted a response to your other thread (about IIS/SQL Server), and mentioned a book that might be useful for you.

    Semper in excretia, sumus solum profundum variat

  • Hi,

    We're actually using SqlServer 2005 express, and SqlServer Management Studio.

    Do we get to the sql statement in the same way?

    Many thanks

  • One of the icons in Management Studio will do the scripting. Hover over them

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply