static or dinamic query?

  • Hi

    I have a database that uses and stores information related to other database.The initial database was splited and the sp in the new database used tables from the other database

    Until now I've used views that reference the initial database tables and keep the same format of the sp.But now I have to reference 2 databases and the format of the sp must change. So I think the best solution is to use static queries and use a if or a case to decide which database to reference because the sp are prety slow.The dinamic queries in which the database is send as a parameter don't seem a good solution because the sp will be slower.But with static queries the sp's will be difficult to manage. Is there a better solution?

    Thanks

  • shnex (4/6/2009)


    Hi

    I have a database that uses and stores information related to other database.

    What is the use of this database??? are you using this database to query new database? what is the relationship between this database and new database. could you please put some more information aroud you requirement.

  • So

    The initial database was prety big. It contained persons and information for this persons.

    In 2 tables we had lots of information, so these two tables and the sp that use them were stored in a new one.

    Now there is another database with persons, for wich the informations will be stored in the same new database(the one with 2 tables).And I have to modify the sp to work with data from a specific database.I added as a input parameter the name of the database.

    First, when it was only the person and the info database, I created views that referenced the tables I need about the persons.I don't think that creating another set of views will be the solution.I want to have the same sp no matter what is the database,and I think that using a parameter, as a flag, is enough, but I don't know how ti restructure the sp.To use dinamic queries or static.I don't want to use dinamic because the sp's are prety slow, and they will be slower.I hope this is more clear....:D

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

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