Tag Archives: Server

CreateSqlDBHelper – Tool to create and set up database from scripts

I’ve done it again. re-invented the wheel… uhm, no. But I did create a tool to create and set up a new sql server database from scripts that can be launched from the command line. This could be useful if you must automate the process of setting up a test database each time you need to run a new set of tests.

It works like this (coomand line options)

Usage: CreateSqlDBHelper.exe <server> <database> <data files path> <-d> <script1.sql [script2.sql …]>
Where
-d : drop database first

This allows you to specify a sql server/instance name, database name, path where the database files will be located plus any number of sql script files that needs to be run to set up a new database. Typically you’ll start by running scripts that will create tables, views, sprocs and also initial data rows etc. Optionally the tool can first ‘drop’ the existing database (but for now that requires a manual press ‘Y’ step). It makes use of the .Net 4.0 client framework plus SQL server SMO libraries – which come with SQL server…

You can find a copy of the tool here.

BizTalk and MSDTC

This is a quick post to summarize my frustrations about the process of setting up and configuring a BizTalk (2010) environment  on a multiple server environment.

If you encounter any/all of the following errors while doing the initial configuration:

  • Exception of type System.EnterpriseServices.TransactionProxyException was thrown
  • [WARN] AdminLib GetBTSMessage: hrErr=80070002; Msg=The system cannot find the file specified.;
  • [WARN] AdminLib GetBTSMessage: hrErr=c0c02560; Msg=Failed to read “KeepDbDebugKey” from the registry.

then start troubleshooting by looking at the following things:

  1. Check that MSDtc is installed, running and configured properly – especially the security settings. This apply to BOTH the SQL Server and all BizTalk servers! See the following screenshot:
    BizTalk MSDtc Security settings

    BizTalk MSDtc Security settings

    The Type of communication can be changed to Mutual or Incoming Caller but it HAS to be the same on all the machines (SQL and BizTalk servers)

  2. Check that MSDtc has been allowed access through the firewall – again on ALL machines including the SQL server!

    BizTalk/SQL MSDtc Firewall access

    BizTalk/SQL MSDtc Firewall access

  3. Check that the SQL Server Browser service is running on the SQL server machine.

I really hope that Microsoft will one day fix this issue where the Configuration Wizard does not check these things BEFORE you start trying to apply settings. It is really frustrating that you have to ‘stumble’ across this every time you set up a new environment – Yes you should check these things beforehand I know…