August 24, 2004 at 12:08 pm
Can any one tell me how to export structure of views without any data.
Thanks in advance
August 24, 2004 at 12:16 pm
I usually use Query Analyzer's Object Browser, find the view (or any other object) right click on it and select one of the scripting options available there. You can also use Enterprise manager to script objects, this is easier if you have multiple objects to script. Again right click on the object and under the "All Tasks" select Generate SQL Script. A new dialog box will show up and allow you to choose which objects to script and various options.
/*****************
If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek
*****************/
August 25, 2004 at 12:49 am
August 25, 2004 at 8:10 am
SELECT distinct o.name, c.colid, c.name ColumnName, t.name, c.length
FROM sysobjects o
JOIN sysdepends d
ON depid = o.id
JOIN syscolumns c
ON o.id = c.id
JOIN systypes t
ON c.xtype = t.xtype
WHERE o.xtype = 'V'
Leah Kats
August 25, 2004 at 12:27 pm
Here's a real easy way to get schema of view resultset
select top 0 * into TempTableName from ViewName
Then just do normal scripting of object and then drop TempTableName.
-Paul
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply