dynamically creating data base and tables by stored procedure?

  • hi

    i need to create database dynamically and table and procedures by passing database name pls give me ideas

    thanks

    with best reagards

    pradeep

  • .

    Igor Micev,My blog: www.igormicev.com

  • Just curious as to what the use caseeed is for this.

  • since the proc would create the same tables all the time, it seems to me a stored proc which simply restores a backup as a new database name might be easier than a boatload of dynamic SQL..

    you know, a proc in master, with EXECUTE AS, to restore a backup.

    so create the model of the database you want with all the objects and even some default data, and restore that.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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