September 8, 2011 at 1:15 pm
I've gotta set up a view that either drops; re-creates and inserts records into a physical or temp table. Then I need to create a second view that queries from the table created above and other joined tables.
View # 2 will be provide to a Crystal end user to connect for their own reporting.
I'm having issues trying to create view # 1 may be b/c it's trying to insert records into a table. Can this be done?
Thx,
John
September 8, 2011 at 2:07 pm
A view that modifies data?
Do you mean a script that modifies data, or do you mean a view that you can run a script against to modify data?
A view is just a stored Select statement.
If you want to update data in a table, via a view, it has to follow specific rules. These are documented here: http://msdn.microsoft.com/en-us/library/ms187956.aspx
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
September 8, 2011 at 2:27 pm
you can create an INSTEAD OF trigger on a view, and have that trigger do the DML to the desired underlying tables.
your code will then try to insert/update/delete fromt he view isntead of the real, underlying tables, is that what you wnat?
what would be differnet about the second view that makes it unique fromt eh first view? why do you think you need two seperate views?
Lowell
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply