Is it possible to script a view as a table in SQL Server?
sql-server, sql-server-2005
Solution
Not out of the box. You can do `SELECT INTO` from the View to create a new empty table then script that as a `CREATE TABLE` using the usual SSMS methods.
SELECT TOP 0 * INTO NewTable FROM YourView
This might save a bit of typing if that's the motivation for the question.
Problem
Under the "Script to" options you can choose to script as create to whatever you want. Is there any way to get a matching table structure for a view using a similar method?