Loading ...
Sorry, an error occurred while loading the content.

Design a table for Lookup in sql server 2008

Expand Messages
  • sree
    Hi Team, I am facing some problems on designing the look up table. We are going to move data by using lookup table and for that I have designed few columns
    Message 1 of 4 , Jun 1, 2009
    • 0 Attachment
      Hi Team,
      I am facing some problems on designing the look up table.

      We are going to move data by using lookup table and for that I have designed few columns based on the data like this..

      ID,tablename,S_char, S_int, T_int, T_char, T_bit

      When I insert my data to corresponding fields with 4K rows, rest of the columns are having NULL values. Is there any issue with performance wise or any other…

      Instead of that can I go with 2 columns one is source and 2nd one is target value with "nvarchar" data types.

      Which approach is good and how best I can go with that. Is it required any check constraint for the 2nd approach?

      Please help me in that and one more we don't have any relationship with this table, it's an independent table.

      Thanks in advance.

      Vemuri
    • vijaya_krishna_birju
      Hi Vemuri, what is the access pattern of that table? i.e When you query this table what kind of queries you are going to use? Thanks -- Vijaya Kadiyala
      Message 2 of 4 , Jun 1, 2009
      • 0 Attachment
        Hi Vemuri,
        what is the access pattern of that table? i.e When you query this table what kind of queries you are going to use?
        Thanks -- Vijaya Kadiyala
        www.DotNetVJ.com

        --- In sqlcon@yahoogroups.com, "sree" <vemuri_sree@...> wrote:
        >
        > Hi Team,
        > I am facing some problems on designing the look up table.
        >
        > We are going to move data by using lookup table and for that I have designed few columns based on the data like this..
        >
        > ID,tablename,S_char, S_int, T_int, T_char, T_bit
        >
        > When I insert my data to corresponding fields with 4K rows, rest of the columns are having NULL values. Is there any issue with performance wise or any other…
        >
        > Instead of that can I go with 2 columns one is source and 2nd one is target value with "nvarchar" data types.
        >
        > Which approach is good and how best I can go with that. Is it required any check constraint for the 2nd approach?
        >
        > Please help me in that and one more we don't have any relationship with this table, it's an independent table.
        >
        > Thanks in advance.
        >
        > Vemuri
        >
      • sree
        Hi, Sorry for the late reply, We are using this table when we check with source data, like take status type example , source is ACTIVE and Target is AC
        Message 3 of 4 , Jun 4, 2009
        • 0 Attachment
          Hi,
          Sorry for the late reply,

          We are using this table when we check with source data, like
          take status type example , source is 'ACTIVE' and Target is 'AC'
          WHEN [STATUS] = 'ACTIVE' THEN 'AC'... (1 EXAMPLE)
          some cases
          WHEN [STATUS] = 'ACTIVE' THEN 1 ... (2 EXAMPLE)
          In that case we are going to capture these values.

          Thanks in advance

          Regards,
          Vemuri

          --- In sqlcon@yahoogroups.com, "vijaya_krishna_birju" <vijaya_krishna_birju@...> wrote:
          >
          > Hi Vemuri,
          > what is the access pattern of that table? i.e When you query this table what kind of queries you are going to use?
          > Thanks -- Vijaya Kadiyala
          > www.DotNetVJ.com
          >
          > --- In sqlcon@yahoogroups.com, "sree" <vemuri_sree@> wrote:
          > >
          > > Hi Team,
          > > I am facing some problems on designing the look up table.
          > >
          > > We are going to move data by using lookup table and for that I have designed few columns based on the data like this..
          > >
          > > ID,tablename,S_char, S_int, T_int, T_char, T_bit
          > >
          > > When I insert my data to corresponding fields with 4K rows, rest of the columns are having NULL values. Is there any issue with performance wise or any other…
          > >
          > > Instead of that can I go with 2 columns one is source and 2nd one is target value with "nvarchar" data types.
          > >
          > > Which approach is good and how best I can go with that. Is it required any check constraint for the 2nd approach?
          > >
          > > Please help me in that and one more we don't have any relationship with this table, it's an independent table.
          > >
          > > Thanks in advance.
          > >
          > > Vemuri
          > >
          >
        • vijaya_krishna_birju
          Hi Sorry was out of Internet... In your case it would make sense have as a Key value pair combination(i.e. 2 columns). You dont have to use nvarchar for this,
          Message 4 of 4 , Jun 17, 2009
          • 0 Attachment
            Hi
            Sorry was out of Internet...
            In your case it would make sense have as a Key value pair combination(i.e. 2 columns). You dont have to use nvarchar for this, you simply use Varchar columns.
            Thanks -- Vijaya Kadiyala
            www.DotNetVJ.com

            --- In sqlcon@yahoogroups.com, "sree" <vemuri_sree@...> wrote:
            >
            > Hi,
            > Sorry for the late reply,
            >
            > We are using this table when we check with source data, like
            > take status type example , source is 'ACTIVE' and Target is 'AC'
            > WHEN [STATUS] = 'ACTIVE' THEN 'AC'... (1 EXAMPLE)
            > some cases
            > WHEN [STATUS] = 'ACTIVE' THEN 1 ... (2 EXAMPLE)
            > In that case we are going to capture these values.
            >
            > Thanks in advance
            >
            > Regards,
            > Vemuri
            >
            > --- In sqlcon@yahoogroups.com, "vijaya_krishna_birju" <vijaya_krishna_birju@> wrote:
            > >
            > > Hi Vemuri,
            > > what is the access pattern of that table? i.e When you query this table what kind of queries you are going to use?
            > > Thanks -- Vijaya Kadiyala
            > > www.DotNetVJ.com
            > >
            > > --- In sqlcon@yahoogroups.com, "sree" <vemuri_sree@> wrote:
            > > >
            > > > Hi Team,
            > > > I am facing some problems on designing the look up table.
            > > >
            > > > We are going to move data by using lookup table and for that I have designed few columns based on the data like this..
            > > >
            > > > ID,tablename,S_char, S_int, T_int, T_char, T_bit
            > > >
            > > > When I insert my data to corresponding fields with 4K rows, rest of the columns are having NULL values. Is there any issue with performance wise or any other…
            > > >
            > > > Instead of that can I go with 2 columns one is source and 2nd one is target value with "nvarchar" data types.
            > > >
            > > > Which approach is good and how best I can go with that. Is it required any check constraint for the 2nd approach?
            > > >
            > > > Please help me in that and one more we don't have any relationship with this table, it's an independent table.
            > > >
            > > > Thanks in advance.
            > > >
            > > > Vemuri
            > > >
            > >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.