摘要:
示例数据库 1 --指向当前要使用的数据库 2 use master 3 go 4 --判断当前数据库是否存在 5 if exists (select * from sysdatabases where name='StudentManager') 6 drop database StudentMa 阅读全文
摘要:
高级数据查询 示例 使用变量方式实现的查询 1 use StudentManageDB 2 go 3 declare @StuId int 4 --查询张永利学号 5 select @StuId=StudentId from Students where StudentName='张永利' 6 -- 阅读全文
摘要:
逻辑语句与子查询 变量的分类 局部变量:(仅在过程中使用) 局部变量必须以标记@作为前缀,如@age。局部变量的使用也是先声明(使用declare),再赋值。 全局变量:(任何时候均可以使用) 全局变量必须以标记@@作为前缀,如@@version。全局变量由系统定义和维护,我们只能读取,不能修改全局 阅读全文
摘要:
数据库安全 数据库安全 数据库的安全机制 《登录验证方式》有两种 SQLServer身份验证:适合于非windows平台的用户或Internet用户,需要提供帐户和密码。 Windows身份验证:适合于windows平台用户,不需要提供密码,和windows集成验证。 《登录帐户类型》有两种 SQL 阅读全文
摘要:
MS SQL基础 创建数据库 1 use master 2 go 3 --判断当前数据库是否存在 4 if exists(select * from sysdatabases where name='StudentManageDB' ) 5 drop database StudentManageDB 阅读全文