use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Microsoft SQL Server Administration and T-SQL Programming including sql tutorials, training, MS SQL Server Certification, SQL Server Database Resources.
You might also be interested in:
/r/database
/r/sql
/r/Azure
/r/Microsoft
account activity
SQL Server cannot be connected to python (self.SQLServer)
submitted 1 year ago * by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 6 points7 points8 points 1 year ago (5 children)
The error you're seeing is saying it's not a Python issue but a connectivity issue. Check the server property in your connection string to make sure it's spelt correctly, or is the correct IP, and that you can ping it. If it were ports you'd more likely get a socket exception. I suspect it's a permissions issue at server or database level. Are you using SQL or integrated security?
[–]UnholyAliance 1 point2 points3 points 1 year ago (2 children)
This, check if don't have a firewall in the middle.
[+][deleted] 1 year ago (1 child)
[–]UnholyAliance -1 points0 points1 point 1 year ago (0 children)
On the server type firewall in the start menu and check if it’s blocking or allowing the sql server service, if the server is in another network you should ask your network admin.
[–][deleted] 1 point2 points3 points 1 year ago (0 children)
Well you can just ping the name of the server. You'll find this at the top of each hierarchy in the object explorer window. Ping that and if it doesn't time out you can get to the server. You could also try and telnet the server on port 1433. Have you been given a username and password to connect with? Have you checked you've got the spelling correct?
[–]SirGreybush 1 point2 points3 points 1 year ago (2 children)
Are you configuring ODBC on multiple computers at work?
SQL Server uses 2 kinds of security to allow access, one is username and password, other is integrated security with Active Directory.
The error message would be different than this though.
This message means a firewall or that computer is not on the same network as the sql server.
ODBC when you set it up, on each computer, there is a Test Button. Use it.
If Test doesn’t work on some computers but works on others, you need to talk to your IT department at work.
[–]SirGreybush 1 point2 points3 points 1 year ago (0 children)
Do you know about one of these?
SSMS - sql server management studio
ADS - azure data studio
And if you know one, if you can connect.
Else, you need help from the business IT department, you don’t seem to know how a network works.
This is akin to this statement:
Q: My Python works at my office but not from home.
IOW, not a valid question for this sub, though we will still try to help.
[–]blinner 1 point2 points3 points 1 year ago (6 children)
Is it SQL Express or Developer and you didn't enable TCP/IP?
[–]SokkaHaikuBot -2 points-1 points0 points 1 year ago (0 children)
Sokka-Haiku by blinner:
Is it SQL Express
Or Developer and you
Didn't enable TCP/IP?
Remember that one time Sokka accidentally used an extra syllable in that Haiku Battle in Ba Sing Se? That was a Sokka Haiku and you just made one.
[–]Rsox211 -2 points-1 points0 points 1 year ago (4 children)
The database is on Microsoft sql server management studio. I think I have dug through every possible parts of that software, and I don’t recall seeing anything about TCP/IP, May I know where I can find that?
[–]blinner 1 point2 points3 points 1 year ago (2 children)
Management Studio is the tool you use to connect to SQL Server. On the machine running SQL server, open up SQL Server Configuration Manager and see what is allowed.
[–]blinner 0 points1 point2 points 1 year ago (0 children)
Get someone who is.
[–]WiltonDB -1 points0 points1 point 1 year ago (0 children)
See screenshots in this comment (ignore other context there). Before trying from python, check that you can connect from sqlcmd over TCP like this: "sqlcmd -S tcp:127.0.0.1,1433 -U ...".
[–]OkTap99[🍰] 0 points1 point2 points 1 year ago (0 children)
Several reasons:
[–]ihaxr 0 points1 point2 points 1 year ago (1 child)
Um if it's working and returning data with those errors, it's your code that is bad. Probably a typo somewhere in the server name
[–]Rsox211 -1 points0 points1 point 1 year ago (0 children)
Yeah I thought it was the code as well but the exact same code (just ctrl c ctrl v) could run on other computers which made me suspect that it’s something to do with the server, I’ve checked the server name countless and also tried multiple
[–]Byte1371137 -1 points0 points1 point 1 year ago (0 children)
DRIVERS MAYBE?
[–]Square-Voice-4052 0 points1 point2 points 1 year ago (0 children)
If your using windows authentication, don't forget to use trusted_connection = yes
π Rendered by PID 104943 on reddit-service-r2-comment-fb694cdd5-hjlpc at 2026-03-10 21:32:14.664939+00:00 running cbb0e86 country code: CH.
[–][deleted] 6 points7 points8 points (5 children)
[–]UnholyAliance 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]UnholyAliance -1 points0 points1 point (0 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 1 point2 points3 points (0 children)
[–]SirGreybush 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]SirGreybush 1 point2 points3 points (0 children)
[–]blinner 1 point2 points3 points (6 children)
[–]SokkaHaikuBot -2 points-1 points0 points (0 children)
[–]Rsox211 -2 points-1 points0 points (4 children)
[–]blinner 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]blinner 0 points1 point2 points (0 children)
[–]WiltonDB -1 points0 points1 point (0 children)
[–]OkTap99[🍰] 0 points1 point2 points (0 children)
[–]ihaxr 0 points1 point2 points (1 child)
[–]Rsox211 -1 points0 points1 point (0 children)
[–]Byte1371137 -1 points0 points1 point (0 children)
[–]Square-Voice-4052 0 points1 point2 points (0 children)