Saturday 15 January 2011

sql server - Database Design for Filtering Database -


I'm new to complex database design. I'm currently in a project where the user re-directs the instructions based on a combination of 18 columns. Can get.

  • ProcessCode
  • Your columns contain the following columns
  • Directors (FK of the instruction table)
  • While adding / modifying the instruction, he can choose multiple options in each, the stored procedure above the parameter will probably store the data in all the combinations, so that it can easily facilitate retrieval, because During search (retrieval) only one option was selected for each column Will go

    There may be several instructions for the same combination and the same instruction may apply to many combinations.

    I have somehow created SP for linking education but now it has been hit with modification when a new combination for my webpage SP passes, what is the best way to update the table?

    I can remove all existing rows and create new rows for new combinations, but I wanted to maintain the date created by creating the user column Also, make history of it in a separate history table. Need to keep

    Sorry for the length of the question ... and, thanks for the help.

    If you are trying to retrieve data based on a combination of parameters, then you You can set parameters to keep the default values ​​of eg.

      PROC SPProcName @FieldName INT = Create NULL  

    The second thing to see and compare the parameter values ​​is to set the WHERE section of the statement

      WHERE (or FieldName = @FieldName) or (@FieldName is a null))  

    Whether to use it for the query or not. Use the standard update query in the tables and in a similar form, but set the value in such a way as the default parameter value of zero:

      FieldName = ISNULL (@FieldName, FieldName) / Code> 

    which allows you to only update the given parameters.

    Hope is that whatever is after you, if necessary, I can give a complete example.


    No comments:

    Post a Comment