Can I link a server that I only have read-access to? - sql

Trying to link a server that I only have read-access to and uses windows authentication to log me in. I'm trying to link it to my local database so I can combine commands in both databases because my web application executes stored procedures.
Is this possible?
https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-addlinkedserver-transact-sql?view=sql-server-2017

Yes, you can.
From your description, you want to uses windows authentication to log in the linked server.
When a linked server is created by using sp_addlinkedserver, a default self-mapping is added for all local logins. As a result, if the windows account for the local server also exist in the remote account, you can log in the linked server via the current windows account.
Besides after adding the linked server, you can also create a mapping between a login on the local instance of SQL Server and a security account on a remote server. For detailed information, please refer to the sp_addlinkedsrvlogin (Transact-SQL).

Related

how to create a linked server to a SharePoint site in SQL Server 2014

I keep reading articles online that say this is possible but nothing that says how to do it. I have an SQL Server 2014 server and I want to create a linked server to a SharePoint site. I can go to Server Objects > Linked Server > New but then I don't know what to do.
Follow the steps below:
1.Open SQL Server Management Studio, enter the name of your local SQL Server, and then select Connect.
2.Expand Server Objects, right-click Linked Servers, and then select New Linked Server. To see Server Objects, connect to a local on-premises SQL Server. Then, Server Objects should be displayed.
3.In the Linked server text box, enter the full network name of the SQL Server you want to link to.
4.Under Server type, select SQL Server.
5.In the left pane, select Security. In this step, you map the local account you created to the remote server login.
6.Select Add, and enter the following:
a.Under Local Login, select the local account you created.
b.Check Impersonate if the local login also exists on the remote server.
c.Alternatively, if the local login will be mapped to a remote SQL Server login you, enter the Remote User name and Remote Password for the remote server login.
7.In the left pane, choose Server Options. Set the RPC and RPC Out parameters to True, and then select OK.
Articles:
https://learn.microsoft.com/en-us/biztalk/core/how-to-create-a-linked-server
https://learn.microsoft.com/en-us/sql/relational-databases/linked-servers/create-linked-servers-sql-server-database-engine
If you want to access SharePoint data from other application, I suggest you use SharePoint API(CSOM(C#), REST API or web service) to achieve it.
Complete basic operations using SharePoint client library code
Complete basic operations using SharePoint REST endpoints

Bulk insert from share folder

I have share folder in server A with permissions.
and I'm trying to use bulk insert from server B.
I've also added network location to server 'B' with 'A'(trying to use the local path - but nothing).
using sql server 2008 r2
the SQL authentication is: Sql server.
In addition there is no domain controller to those servers, but obviously there are under the same network .
the error is:
Cannot bulk load because the file \\\server\folder\file could not be opened. Operating system error code 5(Access is denied.).
what can I do?
thanks
The SQL Server process identity (service account) security context is used when the BULK INSERT T-SQL statement is invoked from a SQL authenticated connection. Without a domain infrastructure, you will need to either allow Everyone access to the file and share or create a local Windows account on both servers with the same account name and password. Use that local Windows account as the SQL Server service account (specified via the SQL Server Configuration Manager).

Connecting to a SQL Server with SQL Server Managament Studio

I have looked everywhere on Stack Overflow and I have not found an answer that closely compares to my scenario, so please bear with me.
The issue is I was recently given a development server at work and I have to migrate my current project (which I have on SQL Server Management Studio running on SQL Server Express) so that it is hosted on that server. I was just given the server name and authorized access to it. So I can connect to it through Remote Desktop Connection (RDC), but I am clueless as to where to go from here.
I have tried going in through RDC and opening Management Studio from there but when plugging in my server name and using Windows Authentication it doesn't let me in. And I can't use SQL Server Authentication because I'd have to be actually in to be able to create an SQL login.
How can I connect to this server through Management Studio?
The server is in the same network? In the management studio, in server name, you can put a IP address or computer name.
Do you know if SQL is even installed on the server you are tasked to deploy to? You are able to "connect" to SQL Express locally because the instance is installed on your local machine. You will need an instance of SQL installed on the remote machine to be able to use SSMS to connect to the remote instance.
If you are attempting to connect to an already created DB that you have been using the credentials are the same, if you know the address and you have the ports opened on your computer to allow the connection. If you are going to start a new DB on the server, then you will have to connect via AD credentials IF your admin has given you the proper access. I personally suggest using AD credentials to create connections, it's just a lot more secure.
If you are trying to connect to the local db, then it should be on the drop down list on the log in screen.
You are going to have to talk with your admin who set it up if you are still having problems.
You might have to Enter your Server Details in the Hosts File on the Current Application Server
For Accessing Hosts File,
Go to Run and type drivers and Hit Enter. Go to the etc Folder and you will see hosts file in the Folder.
At the End of the File Enter the Server IP And Server Name
Save the file and try Logging into the Server Management Studio again
Hopefull, this would help

CF9 + SQL Server Express

I just created a new database in "Microsoft SQL Server Management Studio Express" and now I'm in "ColdFusion Administrator" and I'm trying to add my database as a Data Source. How do I do that? I believe the servername is .\SQLEXPRESS but I'm not sure what the default username and password are. I've tried creating a new login through Management Studio with an actual username and password, but those aren't working either. The error I'm getting is:
Connection verification failed for data source: xxx
java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
The root cause was that: java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]The requested instance is either invalid or not running.
I can see that the service is running, and I can connect to it through management studio. I've tried following a couple tutorials online, but they don't seem to be working for me. Ideas?
Server name can be any resolvable hostname or domain name, in case of having SQL Server and CF server on same box localhost should work for you.
Also make sure that user you created has access to the particular database and needed operations. Look into the database permissions for this. This check is not required when using master account (often login is sa), but this is not recommended practice because of the security reasons.
Also make sure SQL Server and Windows Authentication mode is checked. I had an issue with permissions as well when I only had Windows Authentication enabled under:
right click on server (localhost) -> security
Then restart SQL Server Services to save changes. After that I was able to connect my ColdFusion datasource to SQL Server.
For testings sake use the same credentials that you are connected with in Management Studio, likely the "sa" user and password. Once you have it working with "sa" then go back into Management Studio and create an application level user for your CF app and then update the data source to use your new user / password.

How to allow access for a sql server user?

I am a developer-having-to-play-admin and wish to connect to a remote sql server from my development machine using a sql server user ("op_web").
When I try to connect from vs2008 Server Explorer, I can connect to the server, but no databases are listed. If I connect using the server admin user, all databases are listed as expected.
The server is a relatively fresh install made by me.
I have
allowed for remote connections in sql server.
created the login op_web at server level
created a user at database level and assigned to login with same name
assigned roles to the user to allow for reading and writing - I have assigned no schemas and default schema for the user is dbo.
If I log on (locally at server) using sqlserver management studio/sqlserver authentication and the created login, I can display and alter table data as I would expect.
Remote access gives me no choice of databases.
Any pointers to what I might have missed?
You have to give your users rights on the database.