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)

Create tables and indexes with a Store Procedure

By Dario Palladino,

I needed something to create all my database tables into another new database I've just created but I didn't wnat to do that by hand so I created this Store Procedure starting from a Jonathan AC Roberts idea that he developed on indexes. (http://www.sqlservercentral.com/Forums/Topic401784-562-2.aspx)

This script creates a store procedure that you can run every time you need to recreate your database somewhere else. 

Just create you new DB and run this SP on your Production DB. Then, run the results into the new DB where you want to replicate all the tables.

If you find error or you think it could be done better, please advice me, I'm really open mind and looking for new knowledge.

I hope you found it useful.

Total article views: 1804 | 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