Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 query analyzer connection from laptop

Author  Topic 

CorpDirect
Yak Posting Veteran

92 Posts

Posted - 2006-01-19 : 17:33:50
Hello all,

We run SQL 2000 Standard on Win2003 Server Enterprise (a domain member). I'd like to connect using Query Analyzer from my laptop, and use my domain account to establish the connection. However, the laptop is not a member of the domain, nor is the account logged on -- so when I attempt to connect I get the following error:
quote:
Unable to connect to server SERVER\INSTANCE

Server: Msg 18452, Level 16, State 1
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

Can I create a trusted SQL Server connection for Query Analyzer to use on my laptop?

Thanks,

Daniel

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-01-19 : 18:02:30
You could try mapping a drive to the database server using your domain account. Then you'd have two sets of credentials available on your laptop. I'm just not sure if the connection would try both.

Tara Kizer
aka tduggan
Go to Top of Page

CorpDirect
Yak Posting Veteran

92 Posts

Posted - 2006-01-24 : 10:55:38
Hello Tara,

This is something I have already tried. You can map a drive with the following:

NET USE X: \\server\share /USER:DOMAIN\username

...which allows you to connect with the domain user credentials while mapping a drive (X:\). This can also be done using the GUI map drive feature in Windows.

Both of these methods (GUI or command line) allow a successful connection to resources on the domain; however, neither changes the Query Analyzer error condition.

Other suggestions?

Thanks,

Daniel
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-01-24 : 13:47:35
I suppose Terminal Services would be a completely daft suggestion??

Kristen
Go to Top of Page

izaltsman
A custom title

1139 Posts

Posted - 2006-01-24 : 17:03:20
If you have a valid domain account, I believe you should be able to do something like this from a DOS prompt:

runas /user:DOMAIN\user "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\isqlw.exe"


It will prompt you for the domain user's password, and start QA for you under those credentials.
Go to Top of Page

CorpDirect
Yak Posting Veteran

92 Posts

Posted - 2006-01-25 : 10:00:12
Kristen,

Unfortunately we do not have the resources to set up a Terminal Services box at this time (at least not for just this purpose). This is something I'd like to do in the future, but doesn't help right now.

izaltsman,

RUNAS sounds promising. I'll give it a try and post back. Thanks for the suggestion!

Regards,

Daniel
Go to Top of Page

CorpDirect
Yak Posting Veteran

92 Posts

Posted - 2006-01-25 : 17:55:57
Got it! RUNAS was key (thanks izaltsman!) to making this work.

This workaround is a bit tricky, and may not be worth doing if you can open a remote desktop or terminal services session and run Query Analyzer from a machine logged on as your domain user account. But, if you need a workaround, this method may serve you.

Here's what you need to do to make this work. Of course, adjust any paths as needed for your environment. From a command prompt, execute:

RUNAS /user:DOMAIN\username "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\isqlw.exe"

You will then see:

Enter the password for DOMAIN\username:

After entering the password, just wait for the application to start. This may take a while.

If you need to open a query saved somewhere on your network, you will want to use File | Open, then enter the UNC path to the file: type \\server\sharename\ and hit [ENTER] to browse the share. Then you can navigate through the folders you are used to seeing on the mapped drive.

If you need to do this often, you can create a shortcut on your desktop that uses the RUNAS command above. You will still be prompted for your password in a command prompt window when you run the shortcut.

Good luck, and thanks to all for the help in figuring this out!

Regards,

Daniel
Go to Top of Page

izaltsman
A custom title

1139 Posts

Posted - 2006-01-26 : 01:40:24
If Query Analyzer is taking too long to open a window, it might be having a hard time resolving the name of your server while you are sitting outside the domain. Try adding an alias for the server to the Client Network Utility on your laptop(be sure to provide the server's IP address). If that doesn't improve things, try adding both your domain controller and your SQL Server to your hosts file.
Go to Top of Page

CorpDirect
Yak Posting Veteran

92 Posts

Posted - 2006-01-26 : 17:45:43
Noticed something odd on my machine after using this workaround, and thought I would share. I found that a profile folder had been added (C:\Documents and Settings\username\) for the domain user account I used to run isqlw.exe. To confirm this, I ran it as another user account on the domain, and sure enough: a fully populated profile folder appeared!

We use roaming profiles, which can take a minute or two to log on the first time, and a few seconds each subsequent time; this seems consistent with what I experienced.

Investigating further, I looked at user profiles on the machine, and saw that the roaming profiles had indeed appeared. After deleting a profile, I used that account again with the RUNAS statement, and watched as the profile folder was created again before the app launched. The first launch (while the profile was created on the machine) took several minutes, while the next launch took about 25-30 seconds.

Very interesting!

Daniel
Go to Top of Page
   

- Advertisement -