Generating an Alter Table Statement:
- In SSMS use the object explorer to navigate to a table.
- Right click and select design.
- Make your changes.
- From the menu select Table Designer --> "Generate Change Script..."
- Copy and paste the script text or click the yes button to save it to a text file.
Adding a Foreign Key:
- In SSMS use the object explorer to navigate to a table.
- Expand the table node.
- Right click on Keys and select "New Foreign Key..." Notice this brings up the table designer if it isn't already open.
- Fill out the new FK and click Close
- You should now be in the table designer. Follow the steps from above.
No comments:
Post a Comment