Creating tables/sps on db creation

  • Hi

    I was asked in an interview. Suppose everytime someone creates a db on my instance, i need a particular set of tables/views /sps on it. Also these objects should contain data from a database on a different server. How to accomplish this.

    Please give me how to proceed with such a situation.

    Regards

    Deepthi

  • All new databases are created from the model database, so you would add these objects to model.

    As for the data, seems a bit of a silly question to me. If the data was static you could prepopulate the tables in the model database, if you wanted to populate the data as it was at the point in time you create the database, you would have to write your own script to be used whenever you created a database, and say use a linked server to select the data out of the other server.

    ---------------------------------------------------------------------

  • Thanks for the reply.

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

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