RcBuilder@walla.com
call centre: 054-5614020

make database tables copy using fetch next

Posted by: RcBuilder  /   Category: FETCH NEXT / Master / Replication / SQL / SQL Data Types / SQL Function / Stored Procedure   /   1 Comment
01
Jul
2014

make database tables copy using fetch next declare _cursor CURSOR FOR SELECT TABLE_NAME, TABLE_SCHEMA FROM information_schema.tables OPEN _cursor declare @currTABLE nvarchar(50), @currSCHEMA nvarchar(50) FETCH NEXT FROM _cursor INTO @currTABLE, @currSCHEMA -- first row -- WHILE @@FETCH_STATUS = 0 BEGIN BEGIN TRY exec('select * into copyDB.' + @currSCHEMA + '.' + @currTABLE + ' from '+ @currTABLE) --select @currSCHEMA + '.' + @currTABLE END TRY BEGIN CATCH PRINT('ERROR :.

Read more
  • פיתוח מערכות
  • פתרונות טכנולוגים
  • קידום אתרים
  • בניית אתרים