Re: Using SQL Server Views instead of tables

  •  02-19-2008, 1:33 AM

    • mgallen is not online. Last active: 10-13-2008, 5:18 AM mgallen
    • Top 25 Contributor
    • Joined on 01-15-2008
    • Melksham, Wiltshire, United Kingdom
    • Posts 123
    • Points 391

    Re: Using SQL Server Views instead of tables

    Hi Alex,

    I've not attempted this with SQL Views, but you could try:

    SELECT * INTO YourNewTableName FROM YourExistingViewName

    as this will create a table from your view.

    If you want, you can get SQL Server Agent to run a job to recreate this table every hour or something with a TSQL statement like:

     

    use YOURDB
    truncate table YourNewTableName
    SELECT * INTO YourNewTableName FROM YourExistingViewName

     

    if your view is dynamic, replace the truncate with a drop.

    HTH

    Martin


    Martin Allen

    Visit my blog: SpittingCAML blog
View Complete Thread