Program.cs line 74 as showstopper

Jan 24, 2013 at 7:21 AM

Hello,

I'm not a dba, so the following code seems unnecessary to me:

if (!arguments.IsSqlEngine && !arguments.ServerName.Contains('\\'))
{
	arguments.ServerName = ".\\" + arguments.ServerName;
}

This code breaks my usual use case: I connect to development SQL servers as or '.', and this code turns my shiny dot server name to ugly '.\.' which is obviously invalid sever name.

After commenting this code, I can finally connect to sql server using this arguments:

sqlserverdump --server-name=. dbname > file.sql

So I have a private build for now )) 

 

So is this a bug or what's the intention of doing this? Just curious ))

Coordinator
Jan 25, 2013 at 2:16 PM
Edited Jan 30, 2013 at 8:24 AM

Hi,

I guess the SQL Server you connect to is configured as a Sql Engine (responding on the official TCP port) rather than as a named instance. In that case, you need to add the --sql-engine argument to the command.

The code you have commented out is handling named instances of SQL Server; and when you're using named instances, you can't use . as the server name, you have to specify its real name. But if you're in the sql-engine case then that's nothing for you to worry about...

Tell me if that solves it.

Daniel @ helvartis

P.S. I see you're dumping the file using a redirection and that's fine as long as your database uses only english characters (ASCII). But if your database contains or could potentially contain non-english characters, you should rather use the --result-file argument as redirecting to a file (at least in the command line) uses old DOS (ASCII) encoding resulting in alteration of non-english characters.