Why does SQL Server 2017 asks for login for every query window - sql-server-2017

I am a new user configured on SQL Server 2017 for existing database server. Every time I try to execute in new query window, it asks my login. "Remember password" doesn't help either.
The option "Disconnect after query executes" under Tools->Options->query execution->advanced is unchecked.
This is so annoying and doesn't allow me to work in multiple query windows. Any suggestions to get around this are appreciated.

Related

Passthrough SQL Query via MS Access

Currently, I have two separate SQL Server instances that I am querying using pass-through SQL queries via a form in Microsoft Access.
The queries to SERVER1 work every time without fail. I'd say about 80% of the time the queries to SERVER2 don't work after Access has been closed and re-opened until I go in and "modify" the OBDC connection string and save the query. I have quotes around modify because if I edit one character in the string and re-add it and then save, it usually starts to work again (but not always), even though the string hasn't changed. And once it works it will continue to work until once again Access is closed.
It's usually one of three errors, here are two of them and the third error which I get less frequently is that the login is incorrect:
The OBDC connection string is as follows (for what it's worth I also tried ODBC Driver 17 for SQL Server and got the same results):
ODBC;Description=SERVER2 PASSTHROUGH;DRIVER=ODBC Driver 11 for SQL Server;SERVER=SERVER2;UID=Test;PWD=Password;DATABASE=MyDB;LANGUAGE=us_english;ApplicationIntent=READONLY;
How do I go about solving this problem? Also, I am willing to provide any clarifying information.
Thanks!
Thanks to Alex for the reply.
Alex recommended going to SQLCMD Unable to complete login process due to delay in opening server connection. I should have been more scientific but I used a shotgun approach... I set my shared memory to disabled, as well as increased the connection timeout and command timeouts.
This then produced a new error for me similar to the one here No process is on the other end of the pipe (SQL Server 2012).
As many of the comments suggested, my SQL server was set to SQL Server and Windows Authentication mode, I changed it to Windows Authentication mode, and then back to SQL Server and Windows Authentication mode, and restarted my SQL server.
And for now, my problem has not shown up through multiple MS Access restarts and a few PC restarts as well for good measure. Fingers crossed.

Query Editor cannot connect to Azure DB anymore

Before, I used the Query Editor to make some query on my Azure DB, but since some days, it's not working anymore.
Databases are on an SQL Database Server on my Azure Subscription.
To query or modify columns / tables I use Query Editor on portal.azure.com
When we open a new query editor with SSMS, it shows us: disconnect:
And after a while, it will try to connect to the database:
Sometimes, I also have the same error. The query editor has opened for a long time and didn't use it. I reconnect the database and open a new query editor, it will works ok. As you said, you've juste tryied to reproduce and now it's working. So I think the reason is the connection lost or timeout.
Hope this helps.

create table permission denied in database 'master'

I have installed the free version of sql server 2008 (sql server management studio express edition) on my PC. After installation I get the following error
create table permission denied in database 'master'
I tried reinstalling several times, but I keep getting the same error. When i checked
select user_account();
It showed that I was logged in as guest. How do I solve this? since I am not permitted to create a new login.
I've read the error can be caused by UAC (on older versions of SQL Server Express). Try right-clicking on SQL Studio and running as administrator.
If that doesn't work there's supposedly a fix here for the same issue. Probably worth a try.
Script to add the current user to the SQL Server 'sysadmin' role
You should use sp_addsrvrolemember to add your user into role 'sysadmin'. Here is link that helped me to solve this problem: http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/76fc84f9-437c-4e71-ba3d-3c9ae794a7c4/
If your table actually exists in a different database (not master), you will need to switch to that database. A GUI option to change the database reference is shown below.
I had the sam eproblem even though I was logged in as master. I was showing logged in as "guest", when I used 'select user_name();'. I used 'USE ,Database>' clause before script an dit really worked. I hope this works for some of you too.
select USER_NAME() execute this query,if you find the username as guest then just close the sql server..
2.Then go to start menu right click the sql server icon and choose the option "Run as administrator"..Now you can create the database
If you got the same error in Sql server 2008 management studio than below link will resolve this error after so much i found this and check answer by blipsalt http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/76fc84f9-437c-4e71-ba3d-3c9ae794a7c4/
I was also facing the same problem. After putting in a great effort I came across this beautiful link
http://www.metatexis.net/manual_server/errorwhenusingmssqlservernamedpipesprovidercouldnotopenaconnectiontosqlserver.htm
The problem with my Sql Server was that I could login using USER-NAME account but not USER-NAME\SQLEXPRESS account. USER-NAME server had just Guest permissions whereas USER-NAME\SQLEXPRESS has complete permissions. You can check that by executing this query.
select user_name()
I went on to check whether my service is running or not. You can do that by clicking start and typing in "services.msc". Open that and search for "SQL Server (SQLEXPRESS)". Start it if its not already started.
In my case it was disabled. I right clicked it. Went to properties and changed "Startup type" to "Automatic".
After doing all this I started Sql Server Management Studio again and connected using USER-NAME\SQLEXPRESS and it worked.
Cheers,
You probably selected master DB. Just switch to the database you want to write in. Go to the available databases on the top left corner in SSMS and choose the right database from the dropdown menu (see the image).
User is not sysadmin. Login to DB with SA credentials and go to Security->Logins and select the user and right click on properties, set as follows

LinqPad timeout connecting to remote SQL Server

I'm trying to connect my hosting providers SQL Server with LinqPad. It works fine using SSMS, but times out when trying to fetch the database list. I am successfully authenticated (via the test)... [ and if i change the credentials, it fails]...
Is there a way to extend the timeout??
Thanks - Kevin
The timeout for fetching schema information in LINQPad is 4 minutes, so something is going badly wrong if it times out! On the dialog, did you click 'Display all databases in TreeView' or did you connect to specific database?
One solution that our DBA mentioned is to set the database property "Auto Close" to false.
http://msdn.microsoft.com/en-us/library/ms188124.aspx
We did this on our development database server and it worked fine for linqpad with a few hundred databases.

Access Log in troubles

Lately there has been a problem running some of our reports in access. Last week(the beginning of the week) we tried to run a reports lets call it A and it kept giving us the log in prompt. Even when the correct user-name and password were entered the log in box would just keep reappearing until cancel was pressed.
I clicked the debug and checked the query. I then logged into the database it is pulling the data from with the same user-name and password and received no trouble. Around Wednesday A was working again, even though nothing was changed. This week A is working but another report B is doing the same thing..
Anyone have any idea what this could be? I'm thinking maybe someone else has the report open? Any help is appreciated.
EDIT: I have narrowed down the error to one linked table that is causing the login prompt. It seems it has the DSN setup but no database specified. So i just need to relink the table..Is there anyway to do this at the GUI level? Also should I leave this question up for future users or just delete it?
Was the login prompt from Access or from Windows? If from Windows, then I'd say that there was some sort of file permission or network access issue at hand. If from Access, then I would say that something in the SYSTEM.MDW that you are using is corrupt or has been reconfigured.
If the login prompt is from ODBC it probably means that the credentials that are being used to access the backend database (per your comments you mentioned it was SQL Server) are either invalid or disabled. (Or it could be as simple as the backend database is/was temporarily unavailable).
If you are using linked tables in Access to a SQL Server it means that an ODBC connection was created and you might try verifying that the ODBC connection is working ( Control Panel, Administrative Tools, Data Sources(ODBC) ). In that dialog there is a place to test the connection.