Updating text valued(varchar) column with better performance

  • Yes, jerry-621596.

    It seems,I have only that option in my hand..

    And the joins I was talking which operates the DML 's to maintain subtables. I know, those very simple..But I was just above to make sure..

  • It is easier to normalize than to have to write a lot of spaghetti code.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • @ GSquared,

    Yes finally I have decided to do normalization, as we dont have any other way...

    Thank you very much to all of you for the response.

  • @Welsh Corgi,

    You are going to create a single column for User Name?

    Yes, username is single column

    How about a First Name, Last Name and a User Name?

    It (the username) should just for the identity. SO, I dont need it

    What is the definition of visitors and visitorThrough and why are they defined as varchar(6000)?

    Visitors: someone who directly visited me,

    visitorthrough : who visited me through someone else

    What about the 10 other columns related to usernames?

    one is identity and rest like levels,points earned and so on..

  • bvsc (8/9/2011)


    @Welsh Corgi,

    You are going to create a single column for User Name?

    Yes, username is single column

    How about a First Name, Last Name and a User Name?

    It (the username) should just for the identity. SO, I dont need it

    What is the definition of visitors and visitorThrough and why are they defined as varchar(6000)?

    Visitors: someone who directly visited me,

    visitorthrough : who visited me through someone else

    What about the 10 other columns related to usernames?

    one is identity and rest like levels,points earned and so on..

    No offense but I think that you should reconsider your design.

    The First Name Last Name Combination is not guranteed to be unique so you may have to include a suffix. Have you ever seen an instance of this? It is very common.

    It is not a bad idea to store the First and Last Name as well as a phone number so that you can distinguish people with the same name.

    When I asked the question about 10 other columns related to user name I was implying that your Database may not normalized. The way you described it suggested that there may be additional entities.

    visitors and visitorThrough are a sperate entities.

    I'm not sure why you need a varchar(6000)?

    Regards,

    WC

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • @WC

    I appreciate your suggetion, But I have identity column which takes care of the uniqueness for the username...

    I mean all the queries I wrote def. call the identity column.

    Ofcourse its a good idea the way you suggest.

    and why visitors(6000)?

    So that We have a record of users who entered in to his screen.. I wanted to that info. we can see forever upto specifieid range(6000)

    But, after all this.. I am sure I will use varchar(2048) instead 6000..

    'll see how it goes..

    Thanks

  • Respectfully a surrogate key does not guarantee that you will not have duplicates.

    Think about how User Names are stored in Active Directory.

    Have you ever seen a User ID with the First and Last Name concatenated with a 1 at the end? You may need a phone number, address, etc to identify the person.

    You can create an identity column but that does not prevent duplicate entries.

    Try searching Google on someone and chances are you will get more than one person with the same name.

    It appears that your visitors column does not appear to be normalized. Can you expand upon the use of that column?

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Viewing 7 posts - 16 through 21 (of 21 total)

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