I have a baffling problem. If I run this procedure manually (ISQL prompt) it works:
use mydb
go
sp_dropsegment "logsegment", mydb, "mydevice"
go
But if I run it from a script:
isql -Uvaris6 -Pvaris6 -Suss_starship <CleanUpSegments.sql >CleanUpSegments.out
I get this:
Msg 17520, Level 16, State 1:
Procedure 'sp_dropsegment', Line 131:
There is no such segment as '“logsegment”'.
(return status = 1)
Msg 17280, Level 16, State 1:
Procedure 'sp_extendsegment', Line 135:
No such device exists -- run sp_helpdb to list the devices for the current
database.
(return status = 1)
The DBO for mydb is varis6 and it has both SA SSO roles.
"mydb" is the default database for User "varis6"
Why is it failing inside the script? Any clues or ideas would be greatly appreciated.
Regards, Les Guyse
Varian Medical Systems