SQL statements commonly used in project development

Source: Internet
Author: User
1. Loop example code: DECLARE @ iintDECLARE10) 10) 10001200BEGINSet110), 4) @ nameselect @ nameLocomotiveTeminalBase),) END2. SQL statement code example used in database cache dependency: -- View status) -- enable brokerALTERDATABASEsoft_Locomotiv

1. Loop example code: DECLARE @ I intDECLARE 10) 10) 10001200 BEGINSet 110), 4) @ name select @ name LocomotiveTeminalBase ),) END 2. SQL statement code example used in DATABASE cache dependency: -- View status) -- enable broker ALTER DATABASE soft_Locomotiv

1. Loop example

Loop sample code:

DECLARE @ I intDECLARE 10) 10) 10001200 BEGINSet 110), 4) @ nameselect @ nameLocomotiveTeminalBase),) END2. SQL statements used in database cache Dependencies

Sample Code:

-- View status) -- enable brokerALTER DATABASE soft_LocomotiveRM_DB SET NEW_BROKER with rollback immediatealter database soft_LocomotiveRM_DB SET ENABLE_BROKER -- add user -- create a new logon '123456' -- assign SA (System Administrator) permission: add the server role 'sysadmin' -- Grant all permissions to your database? N 'test' -- Grant the test permission -- check for errors? USE [master] goalter database into SET SINGLE_USER with rollback immediategoalter database soft_LocomotiveRM_DB SET SINGLE_USERGOALTER DATABASE into SET ENABLE_BROKERGOALTER DATABASE into SET MULTI_USERGOuse added users -- add? Add logon -- make it a legal user of the current database -- Grant all permissions to your database -- remove access to the database -- delete logon,

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.