Here is what you can do:
1. Make the dynamic SQL into a stored procedure
2. Use SELECT * FROM OPENQUERY(.... EXEC sproc...) in the view definition
Examples for OPENQUERY usage:
OPENQUERY is usually used for linked servers, but it can take a non-linked server as well!
Look at Example 21 on how to setup your server for OPENQUERY.
OPENQUERY changes a stored procedure into a kind of table-valued function.
Kalman Toth Database & OLAP Architect IPAD SELECT Query Video Tutorial 3.5 Hours
New Book / Kindle: Pass SQL Exam 70-461 & Job Interview: Programming SQL Server 2012
No comments:
Post a Comment