|
Posted by Erland Sommarskog on 10/02/54 11:56
Ted (r.ted.byers@rogers.com) writes:
> Can SQL Express be told to use a default instance? If so, how?
Yes. When you install SQL Express you get a screen where you can choose
the name of your instance and also select a default instance. If memory
serves the Express install has a "Show advanced install options" or
somesuch. You may have select that to get that screen.
You cannot change an existing named instance to a default instance. (Well,
with a lot of registry hacking etc you may get away with it, but please
don't try it home. Or at work.)
> Here is the perl code I run on my machine:
>
> my $cmdline = "sqlcmd -i temporary_load_script_file.sql -o
>...
> sqlcmd -S glaptop\instance -i temporary_load_script_file.sql -o
> load.output1.txt
>
> If we change the perl script to reflect this, it fails to run, and we
> get the same error that we get if they try to run without specifying an
> instance.
Of course it fails. \ in a double-quoted string in Perl is an escape
character, so you get glaptopsqlexpress.
Double the backslash or use single quotes to delimit the string. Even
nice is maybe to make the instance an argument:
$server = '.' unless $server;
my $cmdline = "sqlcmd -S $sserver -i temporary_load_script_file.sql -o
In this case there is you don't have to worry about the backslash.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|