Using Scptxfr In A SQL Job

Aug 26, 2003

I need to generate a script of my entire database, and place the resulting file on a network drive. And I need to run it as a job. I found an old post on this forum that had information on scptxfr.exe. I am a beginner, so I was glad to have found something so simple. But I have a small problem...

I created a SQL Server Agent job with a step that calls the scptxfr executable. But, the job fails because it doesn't recognize the network drive ("The system cannot find the path specified"). It works fine when I run the job and store the resulting script on my c drive. And, when I run scptxfr from the DOS prompt, it works fine when I use the network drive (using the same exact command line that I use in the sql job). It just doesn't work when I run it through a sql job. I've also tried using the full name (\servernameshare) - it didn't work.

Any ideas?

View 4 Replies


ADVERTISEMENT

Use Of Scptxfr.exe In A Stored Procedure

Jan 4, 2002

Hi All,
I need to get the database structure through a procedure.
Something like this:
CREATE procedure get_db_structure as
DECLARE
exec master..xp_cmdshell 'scptxfr.exe /S [server_name] /d [database_name] /PSA /F c:est_one_str.sql'
GO
I'm getting an error message. Something like this:
'scptxfr.exe' is not recognized as an internal or external command,
operable program or batch file.
The scptxfr is in program files/mssql/upgrade folder. I also tried with the exacpt path of the .exe file. Still I'm getting the error.

When I tried in the dos prompt (scptxfr.exe /S [server_name] /d [database_name] /PSA /F c:est_one_str.sql) the command is working fine. I think something wrong with the xp_cmdshell. I assume xp_cmdshell is mainly use to execute dos commands. Does this mean something wrong with the path? Any help is greatly appreciated.
sj

View 1 Replies View Related

SCPTXFR.EXE-- Problem With Drop Procedure

Oct 10, 2006

hi there
I am using SCPTXFR.EXE to generate script of the database(for backup),using following command.

SCPTXFR.EXE /s abc /d aaa /P abc12345 /f D:HSE0607SCHEMA.sql /q/r/T

Now the script is generating fine, but what i find that there is no statment like
"if not exists(...) "
for the Stored Procedure( i had applied the /r parameter), for the Create Tables it is there.

Why there is no statment IF NOT EXISTS(...) for Stored Procedure?
I need this Line, how can i do this??
Regards,
Thanks.
Gurpreet S. Gill

View 1 Replies View Related

Scptxfr.exe, Utility That Generate Database Structure

Jan 23, 2002

Hi All,
I am using scptxfr.exe to get the structure of a dababase. Problem is that its creating GRANT statements which I don't want. Also its selecting sysusers object. I have checked the parameters. My parameters look something like this:
dos promptmssql7upgradescptxfr.exe /S(servername) -d (databasename) /P sa /f (filename) -r

How can I run this utility without creating grant statements?
Any thoughts will help!
Thank you in advance!

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved