Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL Server 2008 | Remote Connection String

Posted on 2014-03-03
5
Medium Priority
?
583 Views
Last Modified: 2014-03-06
Hi experts,

I have an SQL server 2008 on a remote server that I want to connect my local ASP.NET website to.
I copied the same local database files from my local SQL server 2005 to the remote SQL server 2008 and attached them.
The remote SQL server 2008 is on windows authentication while the local is on mixed.
I have the IP, but I am getting an error using the below connection string:

<add name="SiteSqlServer" connectionString="Server=<ip address>;Database=AIIIP;Trusted_Connection=Yes;" providerName="System.Data.SqlClient" />

1.      Is there any additional thing that I missed?
2.      Is it recommended that I user windows authentication on an sql sever that is being used for a website?

Thanks,
0
Comment
Question by:feesu
  • 3
  • 2
5 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39899922
what error do you get?
you may need to specify the port.
is the windows account created in the remote sql server in the logins?
apart from that, see this article to start troubleshooting
http://www.experts-exchange.com/Database/MS-SQL-Server/A_1881-Connect-to-your-SQL-Server.html
0
 

Author Comment

by:feesu
ID: 39900040
first of all, the remote server is within our network so it's the same domain.

the error says login failed for "domain/user".

do i need to give permissions to my user on that server? but then when i migrate my local website to the actual webserver, i will need to give permission to the webserver's user on the sql server machine! is that ok from a website security perspective? what's the best practice?
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 39900072
>do i need to give permissions to my user on that server?
yes. "windows authentication" will not implicitly create logins in your sql server for "all" windows accounts. that would be not secure at all, as how should sql server know what permissions the windows account should have?

the only "secure" point about is that the password is not stored by sql server, but by the windows domain.

so, if you are in the context of a web server, unless all users are inside the domain, so that you will be able to use indeed the windows authentication even directly from the web page, you will need to created the web service's login the permissions on the sql server
0
 

Author Comment

by:feesu
ID: 39900239
you mean the web services' login will allow the sql server permission for the website whether it runs on my local PC or on another server?
0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 39900243
if both web services use the same login, yes
this is a nice article about setting up IIS and SQL Server in terms of logins/security:
http://www.codeproject.com/Articles/674930/Configuring-IIS-ASP-NET-and-SQL-Server
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

876 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