I need a Transact-SQL script to generate the creation scripts for each object (views, tables, SP's, indexes, users) in the database. Each creation script will be saved in a .sql file. Thanks in advance.
1 Answer
Go to your Sql Server Management Studio
Right Click your Database from where you want to create the scripts and follow the path shown in the screen shot.

2 Comments
MEX-User
What I need is a script, not by clicking some options in the SQL enterprise manager
MEX-User
something like this: select all objects to iterate each one of them ( create a script to generate again the current object in the iteration list. then, save the script in a .sql file in the hard disk ) that's it, thanks in advance
Sql Server Scriptingin SSMS.