• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

软件测试工具Robot进行数据库的并发测试

发布: 2009-12-30 12:15 | 作者: 网络转载 | 来源: 领测软件测试 | 查看: 202次 | 进入软件测试论坛讨论

领测软件测试网

软件测试工具Robot进行数据库的并发测试

第一步:创建演示程序:打开SQL SERVER查询分析器,在SQL SERVER测试数据库中执行下列脚本(脚本执行操作:创建表testtable,并插入一条记录;创建存储过程test):

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Test]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)

drop procedure [dbo].[Test]

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[testtable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

drop table [dbo].[testtable]

GO

CREATE TABLE [dbo].[testtable] (

       [testid] [int] NULL ,

       [counts] [int] NULL

) ON [PRIMARY]

GO

insert into testtable (testid,counts) values (1,0)

GO

SET QUOTED_IDENTIFIER ON

GO

SET ANSI_NULLS ON

GO

CREATE Procedure dbo.Test

as

  declare @count int

  begin tran TEST

    select @count=counts  from testtable where testid=1

    update testtable set counts=@count+1

  if (@@error >0) begin

       rollback tran TEST

  end else begin

       commit tran TEST

  end

GO

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/

21/212>