Showing posts with label everybody. Show all posts
Showing posts with label everybody. Show all posts

Monday, 19 March 2012

Connect SQL with Active Directory

Hi everybody. I have this problem: I have to access to the Active Directory of a remote server from my computer using SQL and make searches based on the LDAP of the server. Someone told me to use Add Linked Server, but I don't know how to do it with the Active Directory. Thanks for the help.

Please take a look at the link below for the solution:

http://msdn2.microsoft.com/en-US/library/ms190803.aspx

Books Online topics on linked servers are also useful to know. Note that there are however restrictions on what you can do via distributed queries. For example, some of the collection data types in the Active Directory Schema are not supported in SQL Server, number of rows that you can retrieve is restricted by default & so on.

|||

Linking SQL Server to Active Directory is tricky. and Microsoft support/help isn't very intuitive for this.
Check a few things first...
1. two single quotes not double.
2. Make connection w/out security context.


Follow this syntax:
EXEC master.dbo.sp_addlinkedserver @.server = N'ADSI',
@.srvproduct=N'Active Directory Services', @.provider=N'ADsDSOObject',
@.datasrc=N'Servername.domain.com' --AKA the full computer name of the AD server

Then execute the openquery like this:

select * from openquery
(
ADSI,'SELECT name
FROM ''LDAP://Servername.domain.com''
WHERE objectCategory = ''Person'' AND objectClass = ''user''
')

I couldn't find anything on the Internet that would help me.

Connect SQL with Active Directory

Hi everybody. I have this problem: I have to access to the Active Directory of a remote server from my computer using SQL and make searches based on the LDAP of the server. Someone told me to use Add Linked Server, but I don't know how to do it with the Active Directory. Thanks for the help.

Please take a look at the link below for the solution:

http://msdn2.microsoft.com/en-US/library/ms190803.aspx

Books Online topics on linked servers are also useful to know. Note that there are however restrictions on what you can do via distributed queries. For example, some of the collection data types in the Active Directory Schema are not supported in SQL Server, number of rows that you can retrieve is restricted by default & so on.

|||

Linking SQL Server to Active Directory is tricky. and Microsoft support/help isn't very intuitive for this.
Check a few things first...
1. two single quotes not double.
2. Make connection w/out security context.


Follow this syntax:
EXEC master.dbo.sp_addlinkedserver @.server = N'ADSI',
@.srvproduct=N'Active Directory Services', @.provider=N'ADsDSOObject',
@.datasrc=N'Servername.domain.com' --AKA the full computer name of the AD server

Then execute the openquery like this:

select * from openquery
(
ADSI,'SELECT name
FROM ''LDAP://Servername.domain.com''
WHERE objectCategory = ''Person'' AND objectClass = ''user''
')

I couldn't find anything on the Internet that would help me.

Connect same database in the CLR store procedure

Hi everybody:

I have a urgent problem, and can not google any useful answer. Please help me!

In my CLR store procedure, I have used a context connect, and I want to creat another connect to the same database. I have set the database permission to external, creat asymmetric key in my assembly, and creat login for that key. The dbo is the owner.

When I use this connect string as store procedure input, and I opened this new connect in the CLR sp, it throw an exception --"***.MDF is in used, failed to connect"!!

How can I do?

Thank you very much!

Why do you need to connect back to the same database from the CLR stored procedure?

Opening a connection back to the same database is not supported for CLR integration stored procedures. If you are trying to achieve a multiple active result set scenario on the server, your best bet is to use server side cursors. You may wish to check out the ResultSet sample which demonstrates how to use cursors from CLR integration code. This sample would normally be located at systemdrive:\Program Files\Microsoft SQL Server\90\Samples\Engine\Programmability\CLR\ResultSet\ after following the instructions for installing samples in the topic "Installing Samples" in SQL Server 2005 Books Online. For more information about this sample, see http://msdn2.microsoft.com/en-us/library/ms160831(SQL.90).aspx.

Friday, 10 February 2012

configure sql server details

Hi everybody,

I'm installing a network monitoring tool (OpManager). During
installation I reached the following step: Configure the SQL Server
details.

Host Name: ?
Port: 1433
Database Name: xxx
User Name: ?
Password: ?

I don't know which host name I need to put in and also I don't know
which user name and password is required.

Please can anyone help me with this.

Thank you!(pearl146@.hotmail.com) writes:

Quote:

Originally Posted by

I'm installing a network monitoring tool (OpManager). During
installation I reached the following step: Configure the SQL Server
details.
>
Host Name: ?
Port: 1433
Database Name: xxx
User Name: ?
Password: ?
>
I don't know which host name I need to put in and also I don't know
which user name and password is required.
>
Please can anyone help me with this.


Since all this is information that is local to your site we cannot really
help you. But we can give some hints:

The host name is usually the machine which SQL Server is running on. If
you have SQL Server on a cluster, it's likely to be the virtual cluster
name. SQL Server can be installed with named instances, in case which
the server is accessed on the form "MACHINE\INSTANCE". I have no idea
what OpManager wants in this case, but since they ask for port number,
I would guess that they stll only want the machine name, and you would
have to use a different port number.

Username and password. By default, SQL Server is installed with
Windows Authentication. This means that when you log into SQL Server,
SQL Server gets your authentication information from Windows, and you
don't supply any user name or password at all. SQL Server can also be
configured for mixed authentication, so that SQL logins are accepted
as well. SQL Logins are username/password pairs.

What username you should specify in this case, I don't know. Probably
you need to create a login and give that the permissions needed by
OpManager. But if your server is not configured for mixed authentication,
there is all reason if you want to activate to run a certain application.
I would expect the app to work with Windows Authentication as well.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx