Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- declare cur_tables cursor local static for
- select * from
- openquery(MYSQL, 'show tables')
- declare @table nvarchar(max)
- open cur_tables
- fetch next from cur_tables into @table
- WHILE @@FETCH_STATUS = 0
- begin
- print 'processing ' + @table
- exec ('drop table oldchleby.dbo.[' + @table + ']')
- exec ('select * into oldchleby.dbo.[' + @table + ']' +
- ' from openquery(MYSQL,''select * from `' + @table + '`'')')
- fetch next from cur_tables into @table
- end
- close cur_tables
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement