Dynamic SQL to create 300 Views from our Tables

Bobby P 231 Reputation points
2023-05-19T13:58:30.0133333+00:00

We have a requirement to create over 300 VIEWs from our Database Tables. Straight SELECT * from the Table.

I was planning on doing this using Dynamic SQL but I know I will exceed the implied space limit on the dynamically built SQL Variable.

Does anyone have a suggestion as to how to approach this?

I think I saw in my travels that using OPENQUERY may be an option. But I know I will have to create a script in our environment for SDLC purposes.

Thanks in advance for your review and am hopeful for a reply.

SQL Server | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Jingyang Li 5,896 Reputation points Volunteer Moderator
    2023-05-19T16:18:47.19+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.