开发者

Database Project and SQLCMD doing a comparison

We currently have a Database Project, which we wrote a WIX Installer for to deploy it, using VSDBCMD means we are able to do a comparison against the current database, and do an update or fresh install when required.

However we have found some issues with this: 1. We need a separate Database installer that needs to be executed on the SQL server (if you want to do it from another server, we found can only be done if it is a do开发者_开发技巧main server and u use a account that has access to both systems and is a sysadmin on the sql). 2. Compact framework has to be installed for VSDBCMD to work.

We are now at a point where we would like to integrate our Database installer into our main installer, this means that most of the time we will be installing from a different system then the sql machine and would like to be able to use an SA account to install the database.

We have tried out SQLCMD, but that doesn't seem to be able to do a comparison on an already existing database.

I would like to know that if a) it is possible to use SQLCMD to do a comparison and how that would work, or b) if SQLCMD is not an option, can VSDBCMD work with an sa account, rather then a domain account?

Thanks


SQLCmd can only execute SQL commands or batches on a database server - it assumes the person writing the script knows the current state of the database and the script will be executed as if it was run in SSMS.

If you want to use the declarative development powers of Visual Studio then you need to use VSDBCMD to deploy them onto your server machine. If you use a connection string in the command line that doesn't use integrated login, you should be able to execute it from your client machine. For example:

"Data Source=$Server;User ID=$UserName;Password=$Password"

Then a SQL Server login for $UserName would suffice.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜