问题
I have a full MS SQL Backup file that I would like to extract the stored procedures and schema from. Is there a way to restore only the schema definitions and stored procedures without restoring the data/table rows?
回答1:
I don't think so, but you could restore it to a temporary database and then script it all from there.
回答2:
Yes its possible in SQL Server 2012. Right click your database -> tasks -> generate scritps ...
Here all options are available.
回答3:
What SQL Server version (and tools) are you using? Under SQL 2000, I remember the "Import/Export Data" wizard, that let you specify which objects you wanted to import and where. You could even perform queries to obtain a subset of data.
来源:https://stackoverflow.com/questions/427526/is-it-possible-to-restore-only-the-schema-and-stored-procedures-from-a-ms-sql-da