In SSMS is there a way to generate a script for table creation based on the table output by a view?
Asked
Active
Viewed 57 times
0
-
I don't really understand the question. What I made of it is that you have a view, you select some data and would like to generate create statement to create a table that could hold that data. Is that what you want to achieve? – kubal5003 Oct 14 '10 at 00:06
-
Exactly. Sorry after rereading my description it is a bit obtuse. – Matt Oct 14 '10 at 00:17
2 Answers
0
There is no simple way of doing such a thing, because selected data is not sufficient to describe the table. Eg. there might be identity column and you won't know or some column may be nullable but actual data has no nulls and so on.
This is in general a complex task that requires a dedicated program, not an ordinary database management utility.

kubal5003
- 7,186
- 8
- 52
- 90