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.
| Author |
Topic |
|
schinni
Yak Posting Veteran
66 Posts |
Posted - 2003-12-19 : 22:50:05
|
| Hello,I have a situation where i need to update the text of thesproc rather than alteringi can write a query to get the text of sproc using syscomments andsysobjects..i can use patindex...and get the text what i want to update in sprocIs this possible...at all,if so can anybody helpme Thanks.. |
|
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
Posted - 2003-12-20 : 03:18:42
|
| I dont think that's a good idea. Keep your hands off the system tables if you want to keep your job! Even if you did get the procedure text, you won't be able to update syscomments directly without running an ALTER PROC...What is it exactly that you are trying to do here? Maybe there is a better way?OwaisWe make a living out of what we get, but we make a life out of what we give. |
 |
|
|
schinni
Yak Posting Veteran
66 Posts |
Posted - 2003-12-20 : 12:52:21
|
| Yes,I know that's not a good idea i thought there is somethingother than updating syscomments table..What i am trying to do is in my stored proc is to backup the datbaseto a path like this 'C:\backupi have a path hardcoded to sent the files to that path but iwant to change only that path most easiest way whenever necessaryThanks, |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-12-20 : 17:51:26
|
| Just pass a parameter to the procedure:CREATE PROCEDURE BackupMyDB @backupfile @varchar(255) ASBACKUP DATABASE MyDB TO DISK=@backupfileYou never need to change the procedure code, just call the procedure and pass the file name:EXEC BackupMyDB 'C:\anotherpath\anotherfile.bak' |
 |
|
|
schinni
Yak Posting Veteran
66 Posts |
Posted - 2003-12-20 : 22:07:52
|
| I got an idea for that i need to know if i can disable an stepin a job.for example...Suppose i have two steps in a job is there a way i can disable or skipa step using "t-sql" whenever i need..Thanks, |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2003-12-21 : 08:53:24
|
| You could have that part of the job look up a configuration table for settings and exit if it's not needed. But you haven't given much info.Damian |
 |
|
|
|
|
|