How SQL Server quickly finds all stored procedures that use a field

Source: Internet
Author: User
When a system uses a lot of tables, and there are a lot of stored procedures, when a table in the database deleted a field, then the corresponding stored procedures need to be changed, but we do not know which stored procedures used the field, then what should we do? We can find stored procedures that use the field from one previous document, but this is much more efficient and error-prone, and we can use the following method to find all stored procedures that use a field. The following function: [SQL] GO SELECT obj. Name stored procedure name, SC. The text stored procedure contents from the syscomments sc INNER JOIN sysobjects obj on SC. Id = Obj.id WHERE SC. TEXT like '% ' + ' field name ' + '% ' and TYPE = ' P ' GO

How SQL Server quickly finds all stored procedures that use a field

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.