ALTER PROCEDURE [dbo].[sp_deletetable]
@tablename nvarchar(100),
@condition nvarchar(500)
AS
BEGIN
DECLARE @Sql nvarchar(800)
SET @Sql='delete from '+@tablename+' '+@condition
--PRINT @Sql
EXEC(@Sql)
END
通用查询语句存储过程
ALTER PROCEDURE [dbo].[sp_getdatabyCondition]
@tablename nvarchar(50),
@conlumns nvarchar(200),
@condition nvarchar(200)
AS
BEGIN
DECLARE @sql nvarchar(1000)
SET @sql='select '+ @conlumns +' from '+@tablename+ ' ' +@condition
EXEC(@sql)
END
@tablename nvarchar(50),
@conlumns nvarchar(200),
@condition nvarchar(200)
AS
BEGIN
DECLARE @sql nvarchar(1000)
SET @sql='select '+ @conlumns +' from '+@tablename+ ' ' +@condition
EXEC(@sql)
END