SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
alter PROCEDURE [dbo].[CANCELTABLE]

AS
BEGIN
DECLARE @cul int
declare @tablename varchar(50)
declare @dropSql nvarchar(100)
select @cul=COUNT(name) from sysobjects where name like 'stt%'
while @cul>0
begin

select @tablename=tb1.name from (select top 1 name from sysobjects where name like 'stt%') as tb1
set @dropSql='drop table'+' '+@tablename;
EXECUTE sp_executesql @dropSql
select @cul=COUNT(name) from sysobjects where name like 'stt%'
end

END
GO

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-11-30
  • 2021-11-30
  • 2021-06-28
猜你喜欢
  • 2021-06-01
  • 2022-12-23
  • 2021-07-31
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案