- 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
------解决方案--------------------------------------------------------