Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Testing connection to sql

Posted on 2016-09-15
7
Medium Priority
?
108 Views
Last Modified: 2016-09-16
Hi,

I like to test the connection to SQL Server. My Web Site is running under AD account Domain\userA.

my connection string is connectionString="Data Source=server\instance;Initial Catalog=Database;Integrated Security=SSPI" providerName="System.Data.SqlClient"

I am not able to log in using UserA account as interactive login is disabled.  Does anyone know any way to test. I have tired UDL file and ODBC but they are taking current credentials logged in to Server.

I couldn't find a way to test the connection using domain\usera account under web site is running.

Thanks

F.
0
Comment
Question by:toronto2456
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 40

Expert Comment

by:lcohan
ID: 41800374
Please give this a read/try: "Testing connectivity to Microsoft SQL Server without any tools installed"

http://www.diaryofaninja.com/blog/2013/11/18/testing-connectivity-to-microsoft-sql-server-without-any-tools-installed

"f you cannot connect to the server, verify the firewall settings, and then try to connect again."
0
 

Author Comment

by:toronto2456
ID: 41800415
Hi Icohan,

Thanks. I actually am using this one but my question is how to make test against AD account. If you choose windows aut , then currently log in users will be used. The only way to force is to log in as that AD account but I can't becasue it is not interactive.

my app pool in runnning under AD account and my connection to SQL is not SQL log in but windows.

So that is I am trying to find a way :)
0
 
LVL 40

Expert Comment

by:lcohan
ID: 41800439
Argh...sorry I missed that essential point - is this what you mean? Essentially  you need to "runAS" that AD User and please see details here about "How do I impersonate a specific (fixed) identity?"

https://msdn.microsoft.com/en-us/library/ff647248.aspx
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:toronto2456
ID: 41800479
No problem :)

I have tried to run ODBC and UDL using runas. But again it is taking the logged credential user. The only way I found is to run SQL Studio manegement run as. But I don't have any sql to install.

Interesting it seems so weird that There was no easy way for this , I sometimes don't understand programmers ?
0
 
LVL 40

Accepted Solution

by:
lcohan earned 2000 total points
ID: 41800500
yak...right, no easy way out but....luckily SQL 2016 finally the SSMS is independent and can be used with any prior version of sql as per http://www.jasonstrate.com/2013/05/get-just-the-tools-ssms-download/ so you could download and install only that OR...you can get one of older versions of SQL Express and instat SSMS only. After that all you need is to start it like:

runas /netonly /user:domain\username "C:\path_to\ssms.exe"

then connect to the server in cause to see if it works.
0
 

Author Comment

by:toronto2456
ID: 41801560
Thanks Icohan,

That is good advise but unfortunately there is an security measure here preventing authenticating service accounts , So I have no way to test it on my workstation,

But thanks for the information
0
 

Author Closing Comment

by:toronto2456
ID: 41801562
Good Infrormation
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question