-
Renaming files with TSQL
I want to be able to rename a file in a specific folder using TSQL or a stored procedure.
More generically, I want to be able to perform file operations (i.e. renaming, copying, deleting etc.) at the OS level using TSQL.
Is there a stored procedure or other command in TSQL that facilitates this?
-
Use xp_cmdshell. This allows you to run any command that you can run from a DOS command prompt.
But you need to have permission to run xp_cmdshell usually reserved for sysadmin role only.
-
Unfortunately, I will need all users to be able to run the process that will perform the file operations.
I think I can work around this though if I can figure out how to call a very simple DTS package from a stored procedure. The package had no security requirements or parameters; it simply needs to execute.
Have you any advice for calling such a DTS package from a stored proc?
-
why can't the users run the DTS package using a vbscript or DTSrun utility or from a web page?
-
Neither VB or a Web page is part of the picture. I need to learn more about the DTSRun utility.
That's where I'll look.
Thank you.
-
Though it is a security hole, you can grant execute privilege on xp_cmdshell to users.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|