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

sql 存储过程,报错...SQL codeSET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER proc [dbo].[Checking

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……