views:

22

answers:

1

OK, so here's the scenario.

CruiseControl.NET (Version : 1.5.7256.1) runs a project to rebuild a database. The CruiseControl.NET windows service is running as a windows user we created for CC.NET. There are several tasks in the project but they all run fine. However, one of the tasks that runs is a console based utility I wrote in C# that generates a batch file and then runs it via an instance of the .NET Process class.

The batch file is generated properly and the process runs fine in C#. However the batch file that runs, runs the sqlcmd command line utility for SQLServer (Version 2005 SP3). sqlcmd runs as expected, but one of the options for sqlcmd never gets applied... -I (turning quoted identifiers on).

e.g.

sqlcmd -U %1 -P %2 -S %3 -d %4 -i someScript.sql -k -b -I  >> %LogFileName%

The odd thing is if I run this from a command prompt on the continuous integration server, it runs with -I being applied.

I'm very confused. I'd understand if the sqlcmd failed because the user executing the process didn't have enough privileges and I'd understand if something went wrong on the SQLServer side if the SQLServer authentication failed, but for it to work but not apply an option to sqlcmd is mystifying.

A: 

Could it be it's because -I is the last parameter? Perhaps there's a missing space there or something.. have you tried switching parameter order?

(also, why are you running a C# console app that create a batch file and the invokes it? Can't cc.net run this file itself?)

Assaf Lavie