bateg
asked on
How can i add linked server using Enterprise Manager ?
Hi;
I have two databases on separate servers and I need to combine the data from the two servers.
I tried adding linked server using Enterprise Manager and I chose other data source
--> Microsoft OLE DB provider for SQL server, product name --> SQL Server, data source --> the IP address of the other server (also tried the server name) , provider string -->SQLOLEDB, Catalog -->the DB I need to retrieve the data from.
In the security tap I wrote the local account and the remote account and both of them have the same credentials same user name and same password, from the connections I chose be made using this security context and I typed the SA user name and password (the SA password of database on the other server I am trying to connect).
I got an error message access is denied.
I don't know what the problem is as this is the first time for me to create linked server.
I have two databases on separate servers and I need to combine the data from the two servers.
I tried adding linked server using Enterprise Manager and I chose other data source
--> Microsoft OLE DB provider for SQL server, product name --> SQL Server, data source --> the IP address of the other server (also tried the server name) , provider string -->SQLOLEDB, Catalog -->the DB I need to retrieve the data from.
In the security tap I wrote the local account and the remote account and both of them have the same credentials same user name and same password, from the connections I chose be made using this security context and I typed the SA user name and password (the SA password of database on the other server I am trying to connect).
I got an error message access is denied.
I don't know what the problem is as this is the first time for me to create linked server.
trythis
EXEC sp_addlinkedserver 'linkedServename', N'SQL Server'
EXEC master.dbo.sp_addlinkedsrv login @rmtsrvname = N''linkedServename'', @locallogin = NULL , @useself = N'False', @rmtuser = N'" & sLinkUser & "', @rmtpassword = N'" & sLinkPWD & "'
EXEC sp_addlinkedserver 'linkedServename', N'SQL Server'
EXEC master.dbo.sp_addlinkedsrv
PriyaPadman,
If you provide T-SQL scripts, please do so completely. The above is missing (a) the declares of vars and (b) the particular values for this case, as far as known.
If you provide T-SQL scripts, please do so completely. The above is missing (a) the declares of vars and (b) the particular values for this case, as far as known.
dear qlemo: sorry 4 ma mistake
details can be seen n this link
http://msdn.microsoft.com/en-us/library/ms190479(SQL.90).aspx
details can be seen n this link
http://msdn.microsoft.com/en-us/library/ms190479(SQL.90).aspx
ASKER
The problem is that when i tried SQL server , only the master database apperead in the tables list , i need to use our database not the default one that's why i used other datasouces so i can choose the DB i want to connect to .
Below link is my tested for MySQL to SQL Migration using Linked Server, You can use it for SQL Server Linking
http://www.codeproject.com/KB/database/migrate-mysql-to-mssql.aspx
http://www.codeproject.com/KB/database/migrate-mysql-to-mssql.aspx
when you try to get data via link server.
you have to put database name also
for ex.
SELECT * FROM [ServerName].[Database].[d bo].[table name]
with SA password entering for security context.
you should able to access almost all objects via Linked Server
you have to put database name also
for ex.
SELECT * FROM [ServerName].[Database].[d
with SA password entering for security context.
you should able to access almost all objects via Linked Server
ASKER
I created the data source successfully.
but when i typed your code after changing the parameters.
EXEC master.dbo.sp_addlinkedser ver
@server = N'MYSQL', --> i typed the data source name that created
@srvproduct=N'MySQL', --> SQLServer
@provider=N'MSDASQL', -->SQLOLEDB
@provstr=N'DRIVER={SQL Server}; SERVER=the ip address of the server; _
DATABASE=Mydatabase; USER=sa; PASSWORD=Password; OPTION=3'
I got a message saying one row created successfully. Then when tried to query the results I got another message:-
<<OLE DB provider 'SQLOLEDB' returned a 'NON-CLUSTERED and NOT INTEGRATED' index 'IX_RouteMaster' with incorrect bookmark ordinal 0.
OLE DB error trace [Non-interface error: OLE/DB provider returned an invalid bookmark ordinal from the index rowset.].>>
but when i typed your code after changing the parameters.
EXEC master.dbo.sp_addlinkedser
@server = N'MYSQL', --> i typed the data source name that created
@srvproduct=N'MySQL', --> SQLServer
@provider=N'MSDASQL', -->SQLOLEDB
@provstr=N'DRIVER={SQL Server}; SERVER=the ip address of the server; _
DATABASE=Mydatabase; USER=sa; PASSWORD=Password; OPTION=3'
I got a message saying one row created successfully. Then when tried to query the results I got another message:-
<<OLE DB provider 'SQLOLEDB' returned a 'NON-CLUSTERED and NOT INTEGRATED' index 'IX_RouteMaster' with incorrect bookmark ordinal 0.
OLE DB error trace [Non-interface error: OLE/DB provider returned an invalid bookmark ordinal from the index rowset.].>>
And you are certain that the same SQL (without using the linked server) works on the remote server?
ASKER
Yes, i just tried logging in , it's working , both servers.
When i opened the linked server node i couldn't find any servers created under that list .
I really don't know what is the problem .
When i opened the linked server node i couldn't find any servers created under that list .
I really don't know what is the problem .
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I created the linked server using your modified T-SQL and it appeared under the linked server node (myDB) the tables and the views but I was not able to run the query result directly so I tried to run a simple select statement using query analyzer and I got this strange error message:-
Server: Msg 7319, Level 16, State 1, Line 1
OLE DB provider 'SQLOLEDB' returned a 'NON-CLUSTERED and NOT INTEGRATED' index 'IX_RouteMaster' with incorrect bookmark ordinal 0.
OLE DB error trace [Non-interface error: OLE/DB provider returned an invalid bookmark ordinal from the index rowset.].
Server: Msg 7319, Level 16, State 1, Line 1
OLE DB provider 'SQLOLEDB' returned a 'NON-CLUSTERED and NOT INTEGRATED' index 'IX_RouteMaster' with incorrect bookmark ordinal 0.
OLE DB error trace [Non-interface error: OLE/DB provider returned an invalid bookmark ordinal from the index rowset.].
We should check if the SqlOleDB provider options include something unwanted or conflicting.
In Enterprise Manager, start creating a new linked server, choosing the "Microsoft OLE DB Provider for SQL Server". That will enable the "Provider Options" button below the provider name. Press it, and untick anything. Close this dialog by taking the changes over. You can cancel the linked server creation - this action was taken only to be able to set the provider options.
Now try the query again with the same linked server.
In Enterprise Manager, start creating a new linked server, choosing the "Microsoft OLE DB Provider for SQL Server". That will enable the "Provider Options" button below the provider name. Press it, and untick anything. Close this dialog by taking the changes over. You can cancel the linked server creation - this action was taken only to be able to set the provider options.
Now try the query again with the same linked server.
ASKER
Apparently there is a problem with SQL OLEDB provider with the server I am trying to connect, so as soon as we fix the problem
I will try the query again with the linked server I created and I will get back to you.
I will try the query again with the linked server I created and I will get back to you.
http:#a33714218 answers the original question. There are issues outside the scope of the question which do not allow to use the database link.
Objection:
a) The original question has been answered (see http:#35176458)
b) Despite a Cleanup Volunteer's ping 6 weeks ago, the asker only returned to the question after 7 months, when he needed to post a new question. That is inproper handling of questions.
a) The original question has been answered (see http:#35176458)
b) Despite a Cleanup Volunteer's ping 6 weeks ago, the asker only returned to the question after 7 months, when he needed to post a new question. That is inproper handling of questions.
Nevertheless, what you have configured sounds correct. The remote SA account should work in "Security Context" section.