SQL Server 2008 - Table and Database Designers


In this post,i am going to explain about,how to automatically generate scripts ,when a table is created/altered through Design option(New Table...) in SSMS ,

& how to automatically prevent table definition changes,if you try to alter the table through
 Design option in SSMS

In SSMS 2008,Goto   Tools -> Options...





  


















Tools -> Options -> Table and Database Designers -> Auto generate change scripts

Look at the below image,


If you check this option - "Auto generate change scripts" - and then if you try to create /alter

table through Design option(New Table...) in SSMS,it will automatically prompt for saving the table definition scripts.

























 Example:Auto generate change scripts

Under Object Explorer,expand database and then right-click Tables - > New Table...
as shown in below image.











 

















Create a new table and then try to close the designer query window ,a screen will pop-up as shown in below image.



































Tools -> Options -> Table and Database Designers -> Prevent saving changes that require table re-creation


If you check this option - "Prevent saving changes that require table re-creation" - and then if you try to alter the existing

table definition through Design option in SSMS,it will automatically prevent from altering the table definition as shown in below image.




No comments: