P0037 – How To Translate Views To Tables In Old IWS Models

BIDA Forums Forums Technical Topics 2-Databases 2-SQL Server P0037 – How To Translate Views To Tables In Old IWS Models

Tagged: ,

Viewing 0 reply threads
  • Author
    Posts
    • #1097
      Peter Jones
      Keymaster

        The other day I was looking at the old IWS models and had to keep flipping from tables to views.

        So I decided to make the views into tables just to make it easier to look around.

        This is the SQL That does that.

        SELECT  'select * into ' + (substring ([tablename] , 1 , 1 ) + 
                substring ([tablename] , 3 , 99 )   + '_V') + ' from ' + [tablename] +'  ;' 
          FROM [dbo].[z01_select_columns_01]
          where [tablename] like 'AV%' 
          or [tablename] like 'DV%' 
          or [tablename] like 'FV%' 
          group by [tablename]
          order by [tablename]   
        
        • This topic was modified 1 year, 7 months ago by Peter Jones.
        • This topic was modified 1 year, 7 months ago by Peter Jones.

        Best Regards
        Peter Jones

    Viewing 0 reply threads
    • You must be logged in to reply to this topic.