Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Excel workbook vba - each view to sheet.

Author  Topic 

mruprai
Starting Member

12 Posts

Posted - 2014-11-20 : 06:54:59
Hi - I want to create a excel workbook with a macro. which loops though a database - gets all views(with a prefix) and prints creates a sheet for each view(with the data). anybody got any sample code to help

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-11-20 : 09:13:23
What part do you need help with? The SQL query to list the views or the VBA to build the workbook?
Go to Top of Page

mruprai
Starting Member

12 Posts

Posted - 2014-11-20 : 10:55:06
both if possible
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-11-20 : 13:34:04
For the first, use sys.views

http://msdn.microsoft.com/en-us/library/ms190334.aspx

For the second, you might want to ask in an Excel VBA forum
Go to Top of Page
   

- Advertisement -