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
 General SQL Server Forums
 New to SQL Server Programming
 Find Question

Author  Topic 

apantig
Posting Yak Master

104 Posts

Posted - 2005-12-08 : 21:18:57

I need to know how to FIND a stored procedure that has a command
"Delete From [Check] Where CVNumber=xxxxxxx".

How will I do this?

PS:
I dont like to generate a script for all 3083 s/p and then open it in query analyser. This will take to much time to generate and will slow down our process.

Thank you.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2005-12-08 : 21:45:44
search from syscomments.text and join with sysobjects to obtain the name
select 	o.name, c.text
from syscomments c inner join sysobjects o
on c.id = o.id
where c.text like '%Delete From [Check]%'


from

-----------------
[KH]

Guys, where are we right now ?
Go to Top of Page

apantig
Posting Yak Master

104 Posts

Posted - 2005-12-08 : 21:57:11
Wow, I never knew this command.

Thank you very much.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2005-12-08 : 22:03:16
one more note. Only works if your stored procedure is not encrypted

-----------------
[KH]

Guys, where are we right now ?
Go to Top of Page

apantig
Posting Yak Master

104 Posts

Posted - 2005-12-08 : 22:12:14
Ok, thanks for that NOTE.

Khtan, is the command you gave me also possible if I need to know what tables have triggers?
(how?)

Thanks again.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2005-12-08 : 22:37:45
this will be easier
select 	o.name, t.name
from sysobjects t inner join sysobjects o
on t.parent_obj = o.id
where t.xtype = 'TR'


-----------------
[KH]

Guys, where are we right now ?
Go to Top of Page
   

- Advertisement -