首先在所选的数据库上右键,任务,生成脚本。生成过程中,注意选择目标数据库为SQL Server2000.

     第二,这个脚本是不能在SQL2000的查询分析器中使用的,通过如下的Emeditor宏来转换吧:

function TSql2005_2000(sql)
{
	return sql.replace(/WITH\s*\(.*?\)/g,'')
		.replace(/(sys\.objects)|(sys\.views)|(sys\.indexes)/g,'sysobjects')
		.replace(/object_id/g,'id')
		.replace(/exec\s+sys\.sp_addextendedproperty.+$/gmi,function(line){
			return line.replace(/sys\.sp_addextendedproperty/g,'dbo.sp_addextendedproperty')
				//@level0type=N''SCHEMA''改成@level0type=N''user'',再把@name=,@value =,@level0type=,@level0name=,@level1type=,@level1name=全部替代为空
				.replace(/@level0type=N?'.+?'/,"@level0type=N'user'")
				.replace(/@level0type=N?'.+?'/,"@level0type=N'user'");
					
			});
}


document.selection.Text=TSql2005_2000(document.selection.Text)


相关文章:

  • 2022-01-17
  • 2021-08-20
  • 2021-09-08
  • 2021-04-01
  • 2021-04-01
  • 2021-09-11
  • 2021-07-12
猜你喜欢
  • 2021-07-29
  • 2022-01-14
  • 2021-10-31
  • 2021-11-27
  • 2021-11-30
  • 2021-07-03
  • 2022-01-12
相关资源
相似解决方案