--makeDbTestCasesAndResults.sql use master go if exists(select * from sysdatebases where name = 'dbTestCasesAndResults') drop database dbTestCasesAndResults go if exists(select * from sysxlogins where name = 'testLogin') exec sp_droplogin 'testLogin' go create database dbTestCasesAndResults go use dbTestCasesAndResults go create table tblTestCases ( caseID char(4) primary key, input char(3) not null,-- an empID expected int not null ) go --下面插入的是用于usp_StatusCode的测试用例数据 --也可以通过BCP,DTS,或者C#程序从文本文件读入 insert into tblTestCases values('0001','e11',77) insert into tblTestCases values('0002','e22',77) ——should be 66 insert into tblTestCases values('0003','e33',99) insert into tblTestCases values('0004','e44',88) go create table tblResults ( caseID char(4) not null, result char(4) null, whenRen datetime not null ) go exec sp_addlogin 'testLogin','secret' go exec sp_grantdbaccess 'testLogin' go grant select,insert,delete on tblTestCases to testLogin go grant select,insert on tblResult to testLogin go |