Home  >  Article  >  Database  >  项目开发中常用到的SQL语句

项目开发中常用到的SQL语句

WBOY
WBOYOriginal
2016-06-07 17:39:32720browse

1、循环示例 循环示例代码: DECLARE @i intDECLARE 10 ) 10 ) 10001200 BEGINSet 110 )), 4 ) @name select @name LocomotiveTeminalBase ) , ) END 2、数据库缓存依赖中用到的SQL语句 代码示例: --查看状态 ) --启用broker ALTER DATABASE soft_Locomotiv

1、循环示例

循环示例代码:

DECLARE @i int DECLARE 10) 10) 1000 1200 BEGIN Set 1 10)),4) @name select @name LocomotiveTeminalBase ) , ) END 2、数据库缓存依赖中用到的SQL语句

代码示例:

--查看状态 ) --启用broker ALTER DATABASE soft_LocomotiveRM_DB SET NEW_BROKER WITH ROLLBACK IMMEDIATE ALTER DATABASE soft_LocomotiveRM_DB SET ENABLE_BROKER --添加用户 --创建一个新的登录 '123456' --赋予新用户SA(System Administrator)权限,添加服务器角色 'sysadmin' --授予对自己数据库的所有权限? N'test' --赋予权限 test --检查错误? USE [master] GO ALTER DATABASE soft_LocomotiveRM_DB SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO ALTER DATABASE soft_LocomotiveRM_DB SET SINGLE_USER GO ALTER DATABASE soft_LocomotiveRM_DB SET ENABLE_BROKER GO ALTER DATABASE soft_LocomotiveRM_DB SET MULTI_USER GO use soft_LocomotiveRM_DB go --新增用户 --添?加登录 --使其成为当前数据库的合法用户 --授予对自己数据库的所有权限 --移除对数据库的访问权限 --删除登录
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn