易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL存储过程测试(9)——示例程序

      此部分内容创建一个轻量级T-SQL测试套件,总共有3个脚本:
用于创建测试平台数据和待测存储过程的脚本
--======================
--makeDbTestAndResults.sql
use master
go
if exists (select * from sysdatabases where name = 'DbTestAndResults')
 drop database makeDbTestAndResults
go
if exists (select * from sysxlogins where name = 'testLogin')
 exec sp_droplogin 'testLogin'
go
create database makeDbTestAndResults
go
use makeDbTestAndResults
go
create table tb1TestCases
(
 caseID char(4) primary key,
 input datetime not null,
 expectedChecksum int not null
)
go
--下面插入的是用于usp_HiredAfter的测试数据,采用了对期望值求校验和的方法
--也可以通过BCP,BTS或者C#程序从文本文件读入这些数据
insert into tb1TestCases values('0001','10/25/2009',1042032)
insert into tb1TestCases values('0002','10/25/2009',9999999)--deliberate error
insert into tb1TestCases values('0003','10/25/2008',25527856)
insert into tb1TestCases values('0004','10/10/2006',1042032)
go
create table tb1Results
(
 caseID char(4) not null,
 result char(4) not null,
 whenRun datetime not null
)
go
exec sp_addlogin 'testLogin','secret'
go
exec sp_grantdbaccess 'testLogin'
go
grant select,insert,delete,update on tb1TestCases to testLogin
go
grant select,insert,delete,update on tb1Results to testLogin
go
--结束脚本
用于创建测试例例数据和测试结果存储的脚本
--==========================
--makeDbEmployees.sql
use master
go
if exists(select * from sysdatabases where name = 'dbEmployees')
 drop database dbEmployees
go
if exists(select * from sysxlogins where name = 'employeesLogin')
 exec sp_droplogin 'employeesLogin'
go
create database dbEmployees
go
use dbEmployees
go
create table tb1Employees
(
 empID char(3) primary key,
 empLast varchar(35) not null,
 empDOH datetime not null,
)
go
insert into tb1Employees values('e11','Adams','10/25/2009')
insert into tb1Employees


相关文档:

phpmyadmin 修改执行sql文件大小限制

phpmyadmin 修改执行sql文件大小限制
打开php.ini
post_max_size = 100M       ; 表单提交文件大小上限
memory_limit = 128M    ; 内存上限
upload_max_filesize = 100M ; 上传文件大小上限
修改以上三项,就可以解决。 但是此时PHPMYADMIN中最大限制:22,528 KB, ......

sql大全


. SQL 命令
这部分包含那些 PostgreSQL 支持的 SQL 命令的信息.这里的 "SQL" 就是该语言通常的含义; 每条命令的与标准有关的兼容性的信息可以在相关的参考页中找到.
Table of Contents
ABORT --  退出当前事务
ALTER GROUP --  向组中增加用户或从组中删除用户 
ALTER USER --  改变数据库 ......

SQL Server 几个好用的SQL语句

SQL Server 几个好用的SQL语句
1、复制表
 select * into desttable from srctable
 将 srctable 完整地复制一份到 desttable 中,当然后面也可以加上条件来限定需要复制的记录
 要求:desttable 必须为不存在的表名。
 insert into desttable(column1, column2) select columna, columnb from sr ......

sql语句

select gztzid,
       gztztt,
       gztzbt,
       gztznr,
       fslxmc,
       decode(fsfs, '0', '无需回复', '1', '需要回复') fsfs,
 &nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号