You are here: Re: User authentication « MsSQL Server « IT news, forums, messages
Re: User authentication

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация