HashBytes function

  • Has anyone used the HashBytes function of SQL Server 2005 yet.  I'm trying to use it and I'm getting

    Msg 195, Level 15, State 10, Line 3

    'HashBytes' is not a recognized function name.

    I used the code in BOL too!

    DECLARE

    @HashThis nvarchar(128);

    SELECT

    @HashThis = CONVERT(nvarchar,'dslfdkjLK85kldhnv$n000#knf');

    SELECT

    HashBytes('SHA1', @HashThis);

    Thanks in advance,

    Scott

    Senior Database Administrator

     

     

     

  • FYI - I just did a cut and paste from your post on 2 servers and both worked.

     

    MG

    "There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."
    Tony Hoare

    "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.

  • I am not 100% sure about this...however, I believe you have to have the .NET 2.0 runtime installed on the server (or your local machine is SQLServer 2005 is installed locally).

    Please let me know if this works.

    Sean.

  • Thanks,

    Actually we have multiple servers some of which have 2000 and others with 2005.  I accidently tried running this from a 2000 site while the help I was using was from 2005.  Server Management Studio doesn't hook you up to the appropriate BOL.

    My Mistake.

  • Hi

    I am a newcomer to this, and I have the same problem like Scott.

    I am running SQL 2000 and SQL 2005 locally.

    .NET 2.0 runtime is installed as well.

    Pleasec could you advise me how to config both of them to work together - of it is possible of course

     

    Thanks

     

  • super duper old thread, but I found this

    http://www.sql-server-helper.com/error-messages/msg-195.aspx

Viewing 6 posts - 1 through 5 (of 5 total)

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