T-SQL - Sync Table

xiaoxiao2022-11-22  45

/* --1---Create table---- */ create table Sync_Table ([id] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL, [Table_Name] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL, CONSTRAINT [PK_Sync_Table] PRIMARY KEY CLUSTERED ( [id] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] /* --2---Insert data---- */ insert into Sync_Table ([Table_Name]) values ('CMS_Member') select * from Sync_Table /* --3---SP---- */ --exec sp_Sync_Table create proc sp_Sync_Table as begin declare @number_of_table int select @number_of_table = count(*) from Sync_Table print @number_of_table declare @table_name [varchar](100) declare @sql nvarchar (max) declare @n int set @n = 1 while @n
转载请注明原文地址: https://www.6miu.com/read-4979050.html

最新回复(0)