I am new to SQL server (any dbms for that matter) and I need to copy a database from one sql server to another. Asside from the acual tables how can I copy the stored proceedures and everything else. (The schema?)
If you don't need the information in the tables, only the database schema, then you can right click on the database in Enterprise Manger and "Script" the database. You can choose to script the whole database, or tables, triggers, stored procedures, etc... Be sure to save your script.
Then, on the second SQL Server, just run the script in Query Analyzer and it will create an exact duplicate (schema only) of what you chose to script.
Be sure to look carefully at all of the options in the script wizard when scripting the database to make sure it keeps the primary keys, etc...
OR
If you do need the data in the database, you can create a full backup of the database and restore it on the second SQL Server. I would recommend this method, even if you don't need the data, because you know it will be an exact copy of your database.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.