You are here: Re: STORED PROCEDURE - passing table name as a parameter « MsSQL Server « IT news, forums, messages
Re: STORED PROCEDURE - passing table name as a parameter

Posted by Steve on 10/22/90 11:33

Erland Sommarskog wrote:

> Steve Jorgensen (nospam@nospam.nospam) writes:
>> I can't tell if the OP is dealing with a fixed set of tables, or if new
>> tables are bring continuously created. If the former, then I guess the
>> view would work. If the later, then it would not.
>
> In such case, you would have to regenerate the view dynamically. Hey, in
> SQL 2005 you could set up a database trigger and change the view
> definition as soon as a table is created or dropped.
>
> Of course, it is a trade-off where you want the dynamic stuff. One
> advantage with creating the view dynamically is that this can be performed
> in an admin job. Dynamic SQL in the procedures, requires that the user who
> runs it have direct permissions to the tables.
>
The double-bad news is that table are created or dropped frequently, at
least during the initial deployment, and the database is SQL Server 2000,
always. Company standards, ya' know. Can you point me to a good tutorial or
book on creating dynamic views? That would solve another data access
problem that is looming on the horizon -- I can feel it coming. The view
could be regenerated daily during off-hours, and that would be sufficient.

BTW: I tried the suggestion from Terry Kreft and got things working.

Best regards,
Steve

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация