How do I return the SQL data types from my query?

前端 未结 13 1490
耶瑟儿~
耶瑟儿~ 2021-01-29 23:58

I\'ve a SQL query that queries an enormous (as in, hundreds of views/tables with hard-to-read names like CMM-CPP-FAP-ADD) database that I don\'t need nor want to understand. Th

13条回答
  •  北荒
    北荒 (楼主)
    2021-01-30 00:23

    Can you get away with recreating the staging table from scratch every time the query is executed? If so you could use SELECT ... INTO syntax and let SQL Server worry about creating the table using the correct column types etc.

    SELECT *
    INTO your_staging_table
    FROM enormous_collection_of_views_tables_etc
    

提交回复
热议问题