SQL statement query stored procedures \ triggers \ constraints (website database transfer missing Review)

Source: Internet
Author: User
The data architecture is the biggest headache for website development. Local Development is easy. ProgramYou only need to package the DLL, but the database needs to be transferred to the space server. accidentally, you will forget some stored procedures, triggers, and constraints. here we will provide you with several query checks. it can quickly find out what is missing. very practical. there are good methods, please know.

This statement returns all user tables.

Select * From sysobjects where xtype = 'U' --- query all triggers

Select * From sysobjects where xtype = 'tr' --- query all triggers -- read all table names in the database
Select name from sysobjects where xtype = 'U': How can I obtain all the column names in a table. SQL statement.
Select column name = Name from syscolumns where id = object_id (n' name of the table to be queried ') query all data table information

Use Database Name DB

Select * From sysobjects each object created in the database (constraints, default values, logs, rules, stored procedures, etc.) occupies a row in the table. Each temporary object occupies one row in the table only in tempdb.

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.