Project Description
Exports stored procedures, function, views, tables and triggers to individual files or imports same and attempts to create in designated database.



Schema are extracted to a subdirectory in a target folder. The subdirectory is named in the format yyyymmddhhmm (for example, 201701120706).

Inside that directory folders are created for functions, procedures, views and tables. A log file listing exported schema objects is also placed there.

Exported objects are named using a four digit sequence, the schema owner and name of object. For example, "0001.dbo.p_myproc.sql".

Schema files consist of CREATE statements only.



Sql Server SMO is used for export. The source code references these SMO dlls. Paths are on my PC. Your results may vary:

Microsoft.SqlServer.ConnectionInfo
C:\Program Files\Microsoft SQL Server\120\SDK\Assemblies\Microsoft.SqlServer.ConnectionInfo.dll
https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.common.serverconnection(v=sql.120).aspx

Microsoft.SqlServer.Management.Sdk.Sfc
C:\Program Files\Microsoft SQL Server\120\SDK\Assemblies\Microsoft.SqlServer.Management.Sdk.Sfc.dll
https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.sdk.sfc.aspx

Microsoft.SqlServer.Smo
C:\Program Files\Microsoft SQL Server\120\SDK\Assemblies\Microsoft.SqlServer.Smo.dll
https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.aspx

Last edited Jan 12 at 11:29 AM by jlion, version 15