Update TABLE Fields with a unique GUID

Posted on 2009-12-17
Last Modified: 2012-05-08
Can someone please help me with a script, that updates a field with a unique GUID for about 400 records please.

Because of a bug with our current ERP system, I need to dump something unique into these fields as a temp fix.
Question by:chrisryhal
    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    Hello chrisryhal,

    whats the datatype of those field


    LVL 2

    Author Comment

    I already know it will accept a GUID because in my C# I'm generating one and stuffing it for NEW records, but this is just a fill in more or less.  Bluntly a pain in my butt is what it REALLY is (GRIN).

    The datatype is datatype though is varchar(50)

    LVL 75

    Accepted Solution

    update urTable
    set urColumn = newid()
    where urcolumn is null

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
    In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now