Showing posts with label required. Show all posts
Showing posts with label required. Show all posts

Sunday, March 25, 2012

DTS permissions

I would like to import data from Source database into Target using DTS, what are the minimum SQL Server 2K privileges/server roles required for regular user to achieve that on both Source and Target instances? This import will replace existing objects on Target.

Thanks

As a client side tool, the minimum needed would be the same as if you were executing the SQL statements from any other tool. You'd need permissions to connect to the source, access the database, read from the table/view or execute whatever stored procedure. On the target, you'd need to be able to drop and create whatever objects are involved, insert into the table, etc.

-Sue

|||

There are also mulitple ways of doing this - if you're talking about transferring data between SQL Server databases, then Sue is correct. You can also export the data from the source server and store it as a file to be imported into the target. In that case, you have a lot of options, from file permissions to FTP security.

|||I was trying to use DTS in order to copy database objects from source to target, using drop target objects before copy option. In both databases user was db_owner however when I tried using DTS it was giving error saying that I need to have sysadmin privileges and sure enough as soon as I granted that to a user it worked. I also think that is overkill because I don't want developers working with DTS packages getting almighty privs.

Sunday, March 11, 2012

DTS package failing with Object required WScript

I have the following error when I try to execute a DTS package.
All the package is doing, is a bit of WScript to map a drive (need it for other packages), so:

[code]

Function Main()
Dim WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
WshNetwork.RemoveNetworkDrive "S:"
WshNetwork.MapNetworkDrive "S:", "\\myserver\folder1\folder2\folder3\folder4"
Main = DTSTaskExecResult_Success
End Function

[/code]

If I copy it out to a .vbs file and execute it logged in as the SQL Agent profile, it works. Execute the package under a job, or just execute it, it fails with the above error.
Any ideas?

This is a SSIS forum, not DTS! Try microsoft.public.sqlserver.dts, you're more likely to get help there.

-Jamie

|||WScript object is specific to wscript.exe host application (that runs .VBS files), it is not part of VBScript language, so you can't use it in DTS scripts.
I think just CreateObject (without "wscript.") should work as well, but I don't know VBScript. You may try VBScript or DTS newsgroups to get better answer.|||

Sussed it. If I use:

Set WshNetwork = CreateObject("WScript.Network")

It works fine