Connect to SQL Server with Management Studio using Windows Authentication - sql-server

I am working with Management studio and I want to log in to databases located on another server in another domain. The only login I have for such is with Windows credentials.
I want to be able to log in via Management Studio on my local PC. I have found the only way to do so is using a command similar to:
runas /netonly /user:domain\username "C:\Progr...\IDE\Ssms.exe"
While this works, it isn't the easiest or nicest way. Is there a better way? Any way I can do it within Management Studio?

The only elegant ways to connect to a SQL Server in another domain but still use Windows Authentication are:
What you're already doing: runas /netonly
Connecting via remote desktop and opening SSMS locally on the remote server

In addition to the other answers you've received, you can also shift-right click on an executable or a shortcut to one and in the resulting context menu, there should be an option to run as a different user. I tried this on my Win 7 machine. I seem to recall that in XP, I had to install ShellRunAs for these options to show up.

You can get a graphical password prompt by downloading ShellRunAs or better yet, the entire Sysinternals Suite.
Store the executable(s) for ShellRunAs or the Sysinternals Suite in a location of your choice. I recommend:
C:\Program Files\Sysinternals
You can then enable a "Run as different user..." context menu option for all applications/shortcuts by running
shellrunas /reg
If you want to only enable this for SQL Server Management Studio, you can create a shortcut to it and pass the path the management studio like so:
"C:\Program Files\Sysinternals\ShellRunas.exe" "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"
If you download the entire Sysinternal Suite, I would recommend you add the directory to your PATH environment variable.
Please note that you will need to adjust the paths above based on your SQL Server Management Studio version and whether you're running 64 bit or 32 bit Windows.

Related

Running ms sql local db express

I installed Microsoft SQL Server Express localDB. Now I want to run it, and according to this tutorial:
https://www.mssqltips.com/sqlservertip/2694/getting-started-with-sql-server-2012-express-localdb/
I run (in cmd line):
SqlLocalDb info
then I get in cmd line: SqlLocalDb is not recognized as an internal or external command
How to fix it? Probbaly I have to add somethink to PATH variable?
It's strange that the installer didn't add it to your PATH already, but ignoring that - can you go to your C:\Program Files (might be in the x86 folder as well), find where the program was installed, and look for "SqlLocalDb.exe"? This is what would be executed when you run SqlLocalDb from the command line.
If you find it, open the command line at that location and try to run that command. (Tip: You can hold Shift and right click in the empty space in that window, and the right-click menu will contain "Open command window here".)
If that works, you can add that location to your PATH so that you don't have to be in that folder or specify the location.
I had the same problem, and the reason was I had SQL Server Management Studio, but I didn´t have installed the SQL Server.
I downloaded it from the Microsoft website and worked just fine. This is the Spanish version: https://www.microsoft.com/es-mx/sql-server/sql-server-downloads
restart your computer, it worked like that for me.
I had this issue and installing Microsoft SQL Server Express Localdb seemed to have fixed it.
Tutorial here: https://www.mssqltips.com/sqlservertip/5612/getting-started-with-sql-server-2017-express-localdb/

I'm not able to open Configuration Manager for SQL Server 2008 R2 on windows 10 64- bit

There is no Configuration Manager in my apps in the start menu. I've installed SQL Server 2008 R2 on windows 10 64bit but unfortunately i'm not able to find the Configuration Manager App. I need it to use to change the server name of my SQL Server which was localhost before.enter image description here
C:\Windows\system32\SQLServerManager10.msc
By using this link still it is showing the app but it's not opening
By using this SQLSERVERMANAGER10.msc on run command window. The following picture elaboratesenter image description here the issue
Have you checked that the server is effectively running? The is the most common cause.
Launch Administrative Tools\Services and look for SQLSERVER
Also make sure the SQLSERVER Browser process is also running to enable connection discovery by client applications.

How to find running/stop service in my SQL Server Configuration?

I have installed SQL Server 2012 on my system. But when I tried to access SQL Server Configuration, I couldn't see SQL Service running on my system. How do I ensure it's running?
I will bet you installed the SQL Tools, but not the Engine itself. Search for file "sqlservr.exe" on your local machine. A standard/default installation will put it somewhere in the %ProgramFiles% folder (ie c:\program files\microsoft sql server\mssql.1....). IF the file does not exist on your local machine, then the Engine feature was not checked/included, or the install itself failed, at which you should look at the setup log files.
Go to Windows Services by
1) Go to start > Run and type services.msc
or by using the Windows Start-->Programs-->Administrative Tools-->Services menu.
Then, double-click (or right click) the MSSQLServer service, and right-click the required action.

Confused about the currently installed version of SQL Server

Someone has installed sql server on my machine, however i'm not sure what is the version currently installed. I tried running : Sql server installation center --> Installed Sql server features discovery report and the result was as follows:
I tried looking in the "Programs and features" section and I found this:
I also tried opening Sql server Services but its empty. Here's a screenshot:
The currently running the services are :
Currently I'm not sure what version is installed, I tried connecting to "." on Sql Management Studio but i got connection error and no instance was found.
Since you can't connect, probably the best thing to do is hunt it down on your file system. Go to your installation, it's probably located somewhere like this:
C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQSERVER\MSSQL\Binn
and find the sqlserver.exe file. Right-click and select Properties on the file. The Details tab of the properties window will show a product version. The product version isn't going to be a name you're super familiar with, but you can look up on the web what version numbers correspond to what product names. Here's one place that has a nice chart. SqlServerBuilds at Blogspot
If you do get management studio to connect, you can get the version quite quickly, either from the connection properties in the Object Explorer, or with the ad hoc query
Select # #Version
I uninstalled 2008 and 2014 version and now the discovery report shows Sql Server 2012 installation correctly
The existing answer is OK, but here is a simpler tip:
Search the entire drive C: for sqlservr.exe. Use the properties dialog in Explorer to determine the file version and Google it.
You can find out what's running with Process Explorer. It can show you the path and version.

Connect to SQL Server with Management Studio using a Windows Credential while not on the domain

I have a client that has a SQL Server 2008 installation. They have given me a windows domain username/password on their domain, however, my workstation is not on their domain. I'm trying to connect with Management Studio on Vista Professional.
I've tried using the "network accounts" under "user accounts", and this works for other resources (such as exchange, TFS, and file servers) but I have had no luck with this approach for SQL Server.
Also, I'm unsure if this is a concern but this is a dev instance on their database server. So the connection string is "Computer_Name\Instance".
A further question: how could I get Integrated Security for asp.net through cassini/Visual Studio 2008.
So far my only solution is to cave and use a SQL Server Login. I'd like to know if I have any other options.
The answer to this is here. Very useful in the situation you mention.
Basically, you need to use the /netonly /user:domain\username switches when opening management studio, like this:
runas /netonly /user:domain\username “C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe”
Hope that helps.
The detail is a bit unclear, but if your workstation is not on their domain then are you entering the username as 'domainname\username' ?

Resources