Auto generate script-file.

  • Hi

    I am in a situation where I need to create new tables and Views based on existing objects. This is possible from Management Studio when I choose, Right-Click, Tasks, Generate Scripts…. From here I can generate a script (file) which will create the needed tables and views.

    However I need this process to happen automatically (scheduled). It’s not all objects that I need to be in script but only those that start with dbo.<MyName>…

    Any suggestions how to accomplish this?

    /René

  • In a past, I used to achieve it using SQL DMO (Distributed Management Objects). However, with addition of PowerShell support in SQL Server 2008, you better use SQL Server Management Objects (SMO) to do it.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Thanks a lot we will try to go this way.

    /René

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply