Update from Sync Service

This commit is contained in:
FNS Service
2026-04-16 00:28:41 +08:00
parent a808ee7fac
commit 5006db1185
221 changed files with 4666 additions and 4145 deletions

View File

@@ -1,39 +1,55 @@
--创建临时表
create table #Man(
id int identity(1,1),
tbName nvarchar(50)
) --往临时表插入数据
insert into #Man
select name from sys.tables
where create_date\<='2018-03-10 15:36:35.687' and name not in ('DeviceNetState','EphInfo','FilterStatistic','UserInfo','AlmInfo')
--创建临时表
```sql
create table #Man(
```
id int identity(1,1),
tbName nvarchar(50)
) --往临时表插入数据
```sql
insert into #Man
select name from sys.tables
where create_date<='2018-03-10 15:36:35.687' and name not in ('DeviceNetState','EphInfo','FilterStatistic','UserInfo','AlmInfo')
```
order by create_date desc
--确认
select * from #Man
commit
rollback
begin tran
--定义循环变量
declare @i int
set @i = 1
declare @count int
--确认
```sql
select * from #Man
```
commit
rollback
begin tran
--定义循环变量
```sql
declare @i int
set @i = 1
declare @count int
select @count = count(*) from #Man
```
--print @count
declare @str nvarchar(500)
```sql
declare @str nvarchar(500)
declare @tb nvarchar(50)
while(@i \<= @count) begin
select @tb = isnull(tbName, '') from #Man where id = @i
--循环执行语句
set @str = 'drop table [' + @tb+ ']'
```
while(@i <= @count) begin
```sql
select @tb = isnull(tbName, '') from #Man where id = @i
```
--循环执行语句
```sql
set @str = 'drop table [' + @tb+ ']'
```
exec(@str)
set @str = ''
set @i = @i + 1
```sql
set @str = ''
set @i = @i + 1
```
end