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)

Generate Create View statements for database tables.

By Wes Henriksen,

In a refactoring project, we determined we needed to put our maintenance and logging tables in a serperate database from the customer data.

I created this statement to create views pointing to the new table locations to maintain backward compatibility for existing objects.

I recommend you run this on the new database location as it will include the reference to the new database in the defintion.  Otherwise, you'll want to update the code to hardcode your new database name.

Hope this saves you some time creating views!

Total article views: 1067 | Views in the last 30 days: 2
 
Related Articles
FORUM

Create Database

Create database taking forever

FORUM

create database security

create database security

FORUM

unable to create database

CREATE DATABASE failed

FORUM

create the database

create the database

FORUM

Problems in creating database snapshots

Problems in creating database snapshots

 
Contribute