如何使用ASP.NET项目部署SQL 2005 express数据库的BLANK副本?

时间:2023-01-13 13:27:06

Age old question! When you have finished developing and testing your ASP.Net web application, the database you want to deploy is now full of test information and needs to be emptied (and identity fields reseeded to 1) before you deploy.

古老的问题!完成ASP.Net Web应用程序的开发和测试后,您要部署的数据库现在已经充满了测试信息,需要在部署之前清空(身份字段重新设置为1)。

When using a server instance, this isnt difficult (create a SQL script to do the job) but when using a user instance, its seems there is no easy way around?

使用服务器实例时,这并不困难(创建一个SQL脚本来完成这项工作)但是在使用用户实例时,它似乎没有简单的方法吗?

Can anyone help with this? Thanks

有人能帮忙吗?谢谢

2 个解决方案

#1


1  

See if this could help you http://rip747.wordpress.com/2007/10/01/sql-server-2005-import-export-reset-identity-keys-no-workaround-2005-sucks-period-the-end/

看看这是否可以帮助你http://rip747.wordpress.com/2007/10/01/sql-server-2005-import-export-reset-identity-keys-no-workaround-2005-sucks-period-the-结束/

Here is another good one http://dotnetslackers.com/community/blogs/mosessaur/archive/2007/12/09/sql-server-2005-clean-your-database-records-amp-reset-identity-columns-all-in-6-lines.aspx

这是另一个好的http://dotnetslackers.com/community/blogs/mosessaur/archive/2007/12/09/sql-server-2005-clean-your-database-records-amp-reset-identity-columns-all -in -6- lines.aspx

#2


0  

You can connect SSMS to a user instance DB, it just requires a bit of voodoo to discover the DB name.

您可以将SSMS连接到用户背景数据库,它只需要一点伏都教来发现数据库名称。

As for scripting the sql, you can also use the Sql Server hosting toolkit to do this.

至于脚本sql,您也可以使用Sql Server托管工具包来执行此操作。

#1


1  

See if this could help you http://rip747.wordpress.com/2007/10/01/sql-server-2005-import-export-reset-identity-keys-no-workaround-2005-sucks-period-the-end/

看看这是否可以帮助你http://rip747.wordpress.com/2007/10/01/sql-server-2005-import-export-reset-identity-keys-no-workaround-2005-sucks-period-the-结束/

Here is another good one http://dotnetslackers.com/community/blogs/mosessaur/archive/2007/12/09/sql-server-2005-clean-your-database-records-amp-reset-identity-columns-all-in-6-lines.aspx

这是另一个好的http://dotnetslackers.com/community/blogs/mosessaur/archive/2007/12/09/sql-server-2005-clean-your-database-records-amp-reset-identity-columns-all -in -6- lines.aspx

#2


0  

You can connect SSMS to a user instance DB, it just requires a bit of voodoo to discover the DB name.

您可以将SSMS连接到用户背景数据库,它只需要一点伏都教来发现数据库名称。

As for scripting the sql, you can also use the Sql Server hosting toolkit to do this.

至于脚本sql,您也可以使用Sql Server托管工具包来执行此操作。