Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: 451 | Views in the last 30 days: 2
 
Related Articles
FORUM

How to change the data type for the existing table

How to change the data type for the existing table

FORUM

Exists and IF Exists

Exists and IF Exists

FORUM

Collation Changes

Collation Changes

FORUM

Concatenate existing fields SQL server

concatenate existing fields SQL server

FORUM

Partition Existing Table with Data

Partition Existing Table with Data

 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones