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)

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: 1738 | Views in the last 30 days: 8
 
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

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