I want to dump one SQL Server database - get all SQL code necessary to create a similar database. I have full online rights to DatabaseA
, I can feed it with SQL and get the results back in rows in a table.
I do not have the possibility to use Enterprise Manager, any applications, utilities or the like. I can only feed it with pure SQL.
What I am after is SQL code, like CREATE TABLE
and so on. So that I just can paste this into a query and voila - tables, procedures, functions are created in DatabaseB
.
I will not copy the data.
This partly does what I want, it gives me procedures and functions:
Select object_Name(object_ID),definition from sys.SQL_Modules
But not for tables.