当前位置: 代码迷 >> ASP.NET >> sql 存储过程,报错.解决办法
  详细解决方案

sql 存储过程,报错.解决办法

热度:9938   发布时间:2013-02-25 00:00:00.0
sql 存储过程,报错...
SQL code
SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER proc [dbo].[Checking](@tableName varchar(50),--表名@SelName varchar(50)--条件)asbegindeclare @sql varchar(50)set @sql='select count(*) from '+@tableName+' where username='''+@SelName+''''             print @sqlexec @sqlendGOSET ANSI_NULLS OFFGOSET QUOTED_IDENTIFIER OFFGO

SQL code
SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER proc [dbo].[Checking](@tableName varchar(50),--表名@SelName varchar(50)--条件)asbegindeclare @sql varchar(50)set @sql='select count(*) from '+@tableName+' where username='''+@SelName+''''             print @sqlexec @sqlendGOSET ANSI_NULLS OFFGOSET QUOTED_IDENTIFIER OFFGO


------解决方案--------------------------------------------------------
探讨

这是表
SQL code

USE [CA]
GO
/****** 对象: Table [dbo].[AccountInfo] 脚本日期: 03/07/2012 15:12:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Acc……
  相关解决方案