/* --1---Create table---- */
create table Sync_Table/* --2---Insert data---- */
([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]
insert into Sync_Table ([Table_Name]) values ('CMS_Member')/* --3---SP---- */
select * from Sync_Table
--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