Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Compare the structure of two tables.

By bdohmen,

@strUser_nm is the owner of the table.  If the modifyname table does exist, it will alter it with the same structure as the sourcename table.  If the modifyname table exists, it compares the columns and add any that are missing.  The procedure passes an output parameter.  This is used to know if we need to rebuild any view(s) that use the table.  @change = 0 means no changes to structure of modifyname table.  @change=1 means the table was either created or modified and the view(s) need to be rebuilt.  @change = 10 means the sourcename table does not exist.       

Total article views: 459 | Views in the last 30 days: 3
 
Related Articles
FORUM

How to change the data type for the existing table

How to change the data type for the existing table

BLOG

Phantom SSIS Changes

That SSIS change just won’t stick! There is a new business requirement, so now you have to change an...

FORUM

Exists and IF Exists

Exists and IF Exists

FORUM

Collation Changes

Collation Changes

BLOG

How to Test Existing T-SQL Code Before Changing the Compatibility Level

You can easily determine whether existing stored procedures, UDFs and views can work in a higher (or...

 
Contribute