p; /// <summary>
/// 导出SCRIPT的函数
/// </summary>
/// <param name="strServerName"></param>
/// <param name="strUserName"></param>
/// <param name="strPassword"></param>
/// <param name="strDataBase"></param>
/// <param name="strFilePath"></param>
public void GenerateSqlScript(string strServerName,string strUserName,string strPassword,string strDataBase,string strOwner,string strFilePath)
{
try
{
SQLDMO.SQLServer sql = new SQLDMO.SQLServer();
SQLDMO.Database db = new SQLDMO.Database();
SQLDMO.Trigger trigger = new SQLDMO.Trigger();
//连接数据库
sql.Connect(strServerName,strUserName,strPassword);
db = (SQLDMO.Database)sql.Databases.Item(strDataBase,strOwner);
//导出自定义类型
foreach (SQLDMO.UserDefinedDatatype objGen in db.UserDefinedDatatypes)
{
objGen.Script(intOptions,strFilePath,int2Options);
}
//导出表和触发器,过滤掉系统表
foreach (SQLDMO.Table objTable in db.Tables)
{