Showing posts with label write. Show all posts
Showing posts with label write. Show all posts

Sunday, March 25, 2012

ActiveX script to grab all users in Active Directory and tranfer to SQL Server.

Hello,

Does anyone has any idea, or information on how to write an ActiveX script to grab all the users from Active Directory and transfer it into a recordset, SQL server, etc..

Really need help.

Thank you very much.

I'm assuming that because this is a SSIS forum you are looking to use the SSIS ActiveX Script Task?

Don't do it. That task is only there for DTS 2000 migrated packages. Use a Script Task instead.

-Jamie|||

I am using SQL Server 2000. So, I do want to use a script task, and that's what I have (code snippet):


Dim con
Dim rs
Dim FileSystem
Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")
Set OutPutFile = FileSystem.CreateTextFile("marketing.txt", True)

set con = CreateObject("ADODB.connection")
set rs = CreateObject("ADODB.recordset")
con.Provider = "ADsDSOObject"
con.Open "Active Directory Provider"
Set rs = con.Execute("<LDAP://MyServerName/DC=MyDomain>;(objectClass=User);ADsPath;onelevel")


But when I execute I get an error message stating that table does not exist. That happens in the LDAP Provider. Any ides?

Thank you.

|||This isn't a DTS forum. Try microsoft.public.sqlserver.dts on USENET/NNTP/newsgroups/whatever they're call these days.sql

activex script programming - DTS

Hi guys,
Do you have any good documents or tutorial websites on advance DTS
programming? Especially, I want to learn to write activex script inside
DTS package.
Thanks
JayFolks at DTS newsgroup would also be able to address this request.
http://www.microsoft.com/technet/co...c.sqlserver.dts
Thanks
http://zulfiqar.typepad.com
BSEE, MCP
"Britney" wrote:

> Hi guys,
> Do you have any good documents or tutorial websites on advance DTS
> programming? Especially, I want to learn to write activex script inside
> DTS package.
>
> Thanks
> Jay
>
>

Thursday, March 22, 2012

active/active clustering

how does an active/active cluster work with sql server? What about both servers trying to write to the same database files? Each has their own locks. How does active/active work with such constraints?also can you scale out with active/active via database filegroups?|||There is no such thing as an active/active SQL Server cluster. You can install multiple instances or just a single instance in a cluster. Each instance runs on one and only one node at any given time and is inaccessible through any other node. So, it is not possible to use clustering for load balancing, scaling out, or anything other than as a hardware protection mechanism only.|||

thank you for the confirmation of trying to scale via active/active.

|||

There is some sort of "load balancing" possible. It is not real load balancing as you would like it to be, but a very usefull option in my opinion.

Install a cluster with 2 instances and mirror the database from the first instance to the second instance. (it does not have to be a cluster, but it can be usefull for up-times)

The database on the second instance can not be accessed now, but you can make a snapshot of that database and use the snapshot for querying.

The snapshot will not be available for updates, but in some cases you can use the snapshot for query users. That way you keep the query users from your live database, so performance of the live database will not be affected by them and the query users do have reasonable up to date data at their fingertips.

|||

If you were going to do that, there really wouldn't be any point in configuring clustering at all. You would simply drop in Database Mirroring with a Database Snapshot created against the mirror database. Actually gives better fault tolerance than clustering, because you have two copies of the data and it gives better availability, because mirroring reacts more quickly than clustering does. And, you wind up in exactly the same state as if you clustered with 2 instances and then built mirroring, because a cluster failover would trigger a mirror failover and your applications would still need to connect to the mirror which most likely will require manual intervention since it will be a while until all applications are using the new connection libraries with the redirect code in it.

I don't like clustering combined with Database Mirroring for one very specific reason. Every cluster failover casues a cascading failover of Database Mirroring. So, instead of having just a single failover event, you have two each time.

A scenario like this would be served much more stably by using either replication or log shipping instead of Database Mirroring, because you won't get a cascading failover in the event the primary node in the cluster fails and once the instance is brought back online, processing resumes on exactly the same instances as before.

Monday, March 19, 2012

Active directory Update

Hi!
I want to write a trigger that add a new computer account in my active directory when I do an Insert in my MSSQL table.

I know how to use SELECTstatements using LDAP but I want to do a INSERT statement. Is that even possible?
Can you write vb code directly in SP i mssql 2000?

What I think I have to do is to have a vbscript that does the adding then call the script using exetended SP cmd execute passing the name to the script.

If someone has a another solutions please let me know!

Regards..I've written simple ActiveX out-of-process OLE servers using VB. This is not hard to do. But I think you're going from the wrong direction. I'd rather add a computer account using LDAP from my VB code and then fire a stored procedure to update whatever you want to update. The other way around is possible too, but it doesn't make it easier, not does it make it right either.

Sunday, March 11, 2012

Active / Active Cluster SQL Query

I have a SQL Server 2000 with SP3 in a Active / Active
Cluster. I would like to write a SQL query to receive
database table data from the other side of the Active
cluster.
Node A - Virtual Server Name: HGFOPKLD\ERT - Database
Name: NewOrleans_Sales - Table - June_2004
Node B - Virtual Server Name: JKLOPGHF\ERT - Database
Name: NewOrleans_Capital - Table - June_2004
I would like to write a query to select data from
NewOrleans_Sales..June2004 to NewOrleans_Capital..Jun2004.
Listed below is an outline of time intervals for this
failure.
Select Sold_date, Value from NewOrleans_Capital..Jun2004
FROM NewOrleans_Sales..June2004.
Please help me with this query, do I need create a linked
server between two servers?
Thanks!
Mark
You need to create a linked server to access remote data. Use either the
OpenQuery function or the four-part name convention. Accessing a clustered
instance from another clustered instance is no different than accessing any
remote SQL server from a local SQL server.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Mark" <anonymous@.discussions.microsoft.com> wrote in message
news:0c1001c48b81$98b494f0$a401280a@.phx.gbl...
> I have a SQL Server 2000 with SP3 in a Active / Active
> Cluster. I would like to write a SQL query to receive
> database table data from the other side of the Active
> cluster.
> Node A - Virtual Server Name: HGFOPKLD\ERT - Database
> Name: NewOrleans_Sales - Table - June_2004
> Node B - Virtual Server Name: JKLOPGHF\ERT - Database
> Name: NewOrleans_Capital - Table - June_2004
> I would like to write a query to select data from
> NewOrleans_Sales..June2004 to NewOrleans_Capital..Jun2004.
> Listed below is an outline of time intervals for this
> failure.
> Select Sold_date, Value from NewOrleans_Capital..Jun2004
> FROM NewOrleans_Sales..June2004.
> Please help me with this query, do I need create a linked
> server between two servers?
> Thanks!
> Mark
>
>
>

Tuesday, March 6, 2012

acess I/O File

Is it possible to access a file (for example, to write in a text file)
with transact-sql?.
I've create a stored procedure and I'd like to write in a log file
some traces depends on the result of the statements executed in this
stored procedure.
ThanksHere's one method:

ALTER PROC WriteToLog
@.Message varchar(100)
AS
DECLARE @.Command varchar(255)
BEGIN TRAN
-- ensure only one process writes to the log at a time
EXEC sp_getapplock
@.Resource = 'MyLog.txt',
@.lockmode = 'Exclusive'
SET @.Command = 'ECHO ' +
@.Message +
' >>"C:\MyLog.txt"'
EXEC master..xp_cmdshell @.Command, NO_OUTPUT
EXEC sp_releaseapplock @.Resource = 'MyLog.txt'
COMMIT
GO

EXEC WriteToLog 'Test message'

--
Hope this helps.

Dan Guzman
SQL Server MVP

--------
SQL FAQ links (courtesy Neil Pike):

http://www.ntfaq.com/Articles/Index...epartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--------

"Bego?a" <bego_colomer@.yahoo.es> wrote in message
news:c04c2a85.0311180409.4631ec98@.posting.google.c om...
> Is it possible to access a file (for example, to write in a text file)
> with transact-sql?.
> I've create a stored procedure and I'd like to write in a log file
> some traces depends on the result of the statements executed in this
> stored procedure.
> Thanks

Thursday, February 16, 2012

Accessing SQL Server with VB6

I need to write a VB app (VB6) to access and manipulate data within a MS SQL Sever 2000 database. I have experience doing this with MS Access. Is it much different/more difficult to do this with SQL Server?
ThanksNothing to it! Just change your connection string to something like...

Driver={SQL Server};Database=MyDB;UID=MyName;PWD=MyPwd;Server= MyServer

Likely won't need to change anything else.|||There are some differences in SQL format, though. The SQL delimiter for dates is the single apostrophe ('); Access uses the hash mark "#"

Also, if you've been using SQL functions within any of your queries, you may need to chenge them to T-SQL equivalents.|||True. As well, Access 97 (or rather Jet 3.5) used the asterisk (*) as its wildcard character. That changed to the percent sign (%) in Jet 4.0.|||Hey guys,

Thanks for the input. I just wanted to make sure that I wasn't signing up for anything too tricky.

Thanks for all the help|||At first it wouldn't seem that way ;)

Monday, February 13, 2012

accessing reportparameters programmaticly?

Is there a way (of course there is) to access the reportparameters for a
report?
Any samples would be appriciated. I want to write a webpage that
automatically renders all the arguments for a report..
PLS Help
Reg.
Kjell--
| From: "Kjell Brandes" <kjell@.brandes.tv>
| Subject: accessing reportparameters programmaticly'
| Date: Mon, 22 Nov 2004 15:35:52 +0100
| Lines: 12
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| Message-ID: <umU9TCK0EHA.1452@.TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: 193.15.95.2
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.reportingsvcs:35550
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| Is there a way (of course there is) to access the reportparameters for a
| report?
|
| Any samples would be appriciated. I want to write a webpage that
| automatically renders all the arguments for a report..
|
| PLS Help
|
| Reg.
| Kjell
|
|
|
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Hi Kjell,
When accessing reports using URLs, you can manage how report parameters are
handled. You need to add a string to the URL (using the
&rc:ParameterName=Parameter value format) for each parameter that you want
to change. You can find more details on msdn:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rswork/htm/
rwp_workingreports_v1_86aq.asp
Also, make sure you use SSL if the parameter values contain sensitive data.
Yasemin Gunduz
Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights.