Showing posts with label authentication. Show all posts
Showing posts with label authentication. Show all posts

Friday, March 30, 2012

OPENQUERY and Windows Authentication

We have a SQL Server and an Oracle Instance. I have been using OPENQUERY to run queries on SQL Server to compare datasets on SQL Server with those in Oracle. Yesterday, I switched from using a SQL Server login to using Windows Authentication.
My OPENQUERY returned Msg 7399, "Access Denied". So, I added a new linked server login for my windows username:
EXEC sp_addlinkedsrvlogin
@.rmtsrvname = 'ORAINST',
@.useself = false,
@.locallogin = 'NTDOMAIN\NTGROUP',
@.rmtuser = 'ORAUSER',
@.rmtpassword = 'ORAPWD'
I continued getting the same error, after monkeying with the case of my @.loginlogin info and switching my NTUSER for NTGROUP; I finally opened up the login to all users on the server:
EXEC sp_addlinkedsrvlogin
@.rmtsrvname = 'ORAINST',
@.useself = false,
@.locallogin = NULL,
@.rmtuser = 'ORAUSER',
@.rmtpassword = 'ORAPWD'
I still get the same error. The examples in BOL suggest that setting up a linked server login for a windows user should be the same as for a SQL user. Any ideas what I should try next?You cannot create a mapping for a group...only a user.

But you seem to suggest that even that is not working.
Can you provide the complete error message. 7399 usually is followed by an error from the provider.

This might be a bit obvious but make sure the local login that is being used on the server is infact setup with the login mapping. sys.linked_logins view should give the current settings. Also make sure the oracle user name and password are correctly setup in the sytem catalogs.

Tuesday, March 20, 2012

open rowset query using windows authentication

Hi I need to do an "open rowset" query from one SQL server to another
(because I don't want to set up a linked server). I want to use windows
authentication, rather than a SQL logon. My windows account has read to
the remote server. Is this possible? If so, what is the syntax?
if I use SQLOLEDB, I cant' figure out how to say sspi or
trusted_connection = true. I can do it with a UID and PWD, but don't
want to, since I don't want to have to create the login, etc.
Anyone?Shelly,
Not sure what version you're using but check out:
OPENROWSET
http://msdn2.microsoft.com/en-us/library/ms190312(SQL.90).aspx
and
OPENDATASOURCE
http://msdn2.microsoft.com/en-us/library/ms179856(SQL.90).aspx
HTH
Jerry
<shelleybobelly@.yahoo.com> wrote in message
news:1147971881.722223.11140@.i40g2000cwc.googlegroups.com...
> Hi I need to do an "open rowset" query from one SQL server to another
> (because I don't want to set up a linked server). I want to use windows
> authentication, rather than a SQL logon. My windows account has read to
> the remote server. Is this possible? If so, what is the syntax?
> if I use SQLOLEDB, I cant' figure out how to say sspi or
> trusted_connection = true. I can do it with a UID and PWD, but don't
> want to, since I don't want to have to create the login, etc.
> Anyone?
>|||Thanks Jerry. I realized I didn't have DBPROP_AUTH_INTEGRATED set to
yes on the server I was querying, so it was blowing up. Also I
couldn't find those articles when I searched MSDN (for some reason).
Thanks again.
Shelley

open rowset query using windows authentication

Hi I need to do an "open rowset" query from one SQL server to another
(because I don't want to set up a linked server). I want to use windows
authentication, rather than a SQL logon. My windows account has read to
the remote server. Is this possible? If so, what is the syntax?
if I use SQLOLEDB, I cant' figure out how to say sspi or
trusted_connection = true. I can do it with a UID and PWD, but don't
want to, since I don't want to have to create the login, etc.
Anyone?Shelly,
Not sure what version you're using but check out:
OPENROWSET
http://msdn2.microsoft.com/en-us/library/ms190312(SQL.90).aspx
and
OPENDATASOURCE
http://msdn2.microsoft.com/en-us/library/ms179856(SQL.90).aspx
HTH
Jerry
<shelleybobelly@.yahoo.com> wrote in message
news:1147971881.722223.11140@.i40g2000cwc.googlegroups.com...
> Hi I need to do an "open rowset" query from one SQL server to another
> (because I don't want to set up a linked server). I want to use windows
> authentication, rather than a SQL logon. My windows account has read to
> the remote server. Is this possible? If so, what is the syntax?
> if I use SQLOLEDB, I cant' figure out how to say sspi or
> trusted_connection = true. I can do it with a UID and PWD, but don't
> want to, since I don't want to have to create the login, etc.
> Anyone?
>|||Thanks Jerry. I realized I didn't have DBPROP_AUTH_INTEGRATED set to
yes on the server I was querying, so it was blowing up. Also I
couldn't find those articles when I searched MSDN (for some reason).
Thanks again.
Shelley