|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Today @ 5:20 AM
Points: 24,
Visits: 255
|
|
Hi,
can anyone suggest how can i script all object from a SQL server database.I have thought about SSIS packages. can anyone help me to create SSIS package to script all object within a database??
Thanks & Regards, Akshay
|
|
|
|
|
SSCoach
         
Group: General Forum Members
Last Login: 2 days ago @ 1:45 PM
Points: 15,442,
Visits: 9,572
|
|
You can right-click the database in SSMS, go to Tasks, Generate Scripts, and walk through that. Will that do what you need?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, June 05, 2013 1:01 PM
Points: 340,
Visits: 748
|
|
If you want to do automate the process of scripting all objects in a database consider SQL Server Database Publishing Wizard. You can execute this program from command line
Database Publishing wizard fails in the following scenarios
If the stored procedure is encrypted If you use "Execute As user" in stored procedures
Another way of doing it is using Red Gate Tools. You can script out objects using command line feature of SQL Compare Professional Version (not Standard). This does not give error in the above mentioned scenarios.
Reddy
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Today @ 5:20 AM
Points: 24,
Visits: 255
|
|
Hi,
No my exact requirement is that i want to automate this work.i want to take backup of all the object script on daily basis for all the producation databases on single server.
I will then keep a retention period for the same.requirement is raised to save time in retriving the script for any object.
Please suggest.
Thanks Aksh
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 2:25 AM
Points: 1,125,
Visits: 14,518
|
|
Blowing the trumpet for Powershell and SQLPSX.
You can use a scriptingoptions object to make the script output configurable.
Get-SqlDatabase -dbname test -sqlserver server | Get-SqlTable | Get-SqlScripter | Set-Content -Path C:\script.sql Get-SqlDatabase -dbname test -sqlserver server | Get-SqlStoredProcedure | Get-SqlScripter Get-SqlDatabase -dbname test -sqlserver server | Get-SqlView | Get-SqlScripter
|
|
|
|