Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 SCPTXFR.EXE-- Problem with Drop procedure

Author  Topic 

gsgill76
Posting Yak Master

137 Posts

Posted - 2006-10-10 : 07:53:58
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:\HSE0607\SCHEMA.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?
need the this, how can i do this??
Regards,
Thanks.
Gurpreet S. Gill

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-10-10 : 08:03:04
Try to add spaces between the last three options.
SCPTXFR.EXE /s abc /d aaa /P abc12345 /f D:\HSE0607\SCHEMA.sql /q /r /T


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

gsgill76
Posting Yak Master

137 Posts

Posted - 2006-10-10 : 08:12:01
Peso--
that doesnt help me
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-10-10 : 08:16:21
This article might help you
http://www.dbazine.com/sql/sql-articles/larsen4


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

gsgill76
Posting Yak Master

137 Posts

Posted - 2006-10-10 : 08:24:41
Sorry Peter Larsson
that againt dont help me, it just explain the parameters (attributes or switches)
Regards,
Thanks.
Gurpreet S. Gill
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-10-10 : 08:52:36
As far as I can read, the option /r (the options are case sensitive) creates the DROP statements too...


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

gsgill76
Posting Yak Master

137 Posts

Posted - 2006-10-10 : 12:37:15
Peter Larsson
But this option is not working for me, could do a favour,please do yourself & test.
Regards,
Thanks.
Gurpreet S. Gill
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-10-10 : 22:24:33
quote:
Originally posted by gsgill76

Peter Larsson
But this option is not working for me, could do a favour,please do yourself & test.
Regards,
Thanks.
Gurpreet S. Gill



I don't understand why its not working for you...I tried it and working fine. Have you tried adding spaces between the options as Peter suggested?

I tried following command:

scptxfr /s server /d pubs /I /f c:\xxx\abc.sql /q /r /T


NOTE: DROP PROCEDURE statements are generated at the top of the script, not before each procedure !!

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

gsgill76
Posting Yak Master

137 Posts

Posted - 2006-10-11 : 01:33:52
Hi
finally i am able to solve my problem, but i still dont how & why. What i did i just give more than one space between each switch as

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

it worked
And when i try with one space as

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

it again worked
I dont know why it was not working first time for me.
ok, what so ever the way is, i am able to solve the problem,
Regards to all who help me
Thanks.
Gurpreet S. Gill

Go to Top of Page
   

- Advertisement -