Questions tagged [hashbytes]

A hashing function within the Microsoft Transact-SQL Database Engine.

A hashing function within the Microsoft Transact-SQL Database Engine which supports the following algorithms:

  • MD2
  • MD4
  • MD5
  • SHA
  • SHA1
  • SHA2_256
  • SHA2_512

Resources

62 questions
0
votes
0 answers

SQL Server using Hashbytes for non sensitive data

I am wondering why there would be a reason to use the hashbytes algorithm when the data below does not contain any passwords or other sensitive data like this. Is there really a need to use this if you are not dealing with passwords, credit card…
K1205
  • 85
  • 1
  • 8
0
votes
1 answer

HASHBYTES() equivalent in Progress OpenEdge 11.7

I use HASHBYTES() with SQL server 2012, is there any equivalent with OpenEdge? example of working code in SQL 2012 SELECT HASHBYTES('MD5',CONCAT(col1, col2)) AS [HashDiff] FROM MyTable example of what i want achive in progress SELECT * FROM…
Hugues Gauthier
  • 639
  • 8
  • 18
0
votes
0 answers

Best suitable hashbyte algorithm for SQL Server 2008 R2

I have source table with 399 columns in SQL Server 2008 R2. I want to add one more column with hashbyte on above table and store on the database which is SQL Server 2016 using SSIS package. PS - I can't ask source owner to upgrade his/her SQL Server…
0
votes
1 answer

SHA2_256 Hashbytes generating different value on SQL Server 2012 with different version

I am facing a weird problem, I have one source - SQL Server 2012 with version no. 10.5.1753.0 - where hashbyte SHA2_256 is generating a null value. On the other hand, I have another source - SQL Server 2012 with version no. 11.0.3000.0 - where…
RBK4YOU
  • 13
  • 4
0
votes
1 answer

Hashing a specific column using HASHBYTES (SHA1) is causing that column to have more distinct rows than the unhashed column

To put it simply i have a very large database with hundreds of thousands of entries and hundreds of different columns. Some of those columns need to be hashed in order to save space, etc.. However when i try to hash them like this: select…
0
votes
0 answers

convert SQL Hash Bytes binary value (Multiple datatype fields combination) to c# equivalent

I have formed a hash key with the help of HashBytes as below with the multiple fields combination on SQL. hashbytes('MD5', PID+PNumber+CONVERT(VARCHAR(50),cast(datestamp as binary)) +CONVERT(VARCHAR(50), TCount)+OCD+OSeqNbr+TID) AS…
Chandra Mohan
  • 729
  • 2
  • 10
  • 29
0
votes
2 answers

Is it possible to use t-SQL to store a hash using HASHBYTES for a file not in the database?

I would just like to know if it is or is not possible to use t-SQL (SQL Server 2012) to store a MD5 hash using HASHBYTES for a file not in the database? I am only trying to achieve what is stated above without using anything other then T-SQL. That…
John
  • 131
  • 1
  • 1
  • 8
0
votes
0 answers

how can i get Hashbytes for nvarchar (max)?

How to find hashbytes for nvarchar(max), if i am using normal Select hashbytes('md5','std.jobText') I am getting error: String or binary data would be truncated. Could any one suggest any solution?
Magesh K
  • 37
  • 1
  • 5
0
votes
1 answer

SQL Uniqueidentifier hashbytes does not match

I have C# application which makes connection SQL Server 2014 database. When I create Guid on C#, it writes on SQL via lower case. But when I make query on SQL, I get this value upper case. This Guid value needs to be hashed by SHA1, and as SQL…
Sertan Pekel
  • 593
  • 2
  • 5
  • 23
0
votes
1 answer

Hashbytes function output

I have a strange situation using Hashbytes function of MSSQL 2008 R2. Select password ,Hashbytes('SHA1', 'sa') returns 0x3608A6D1A05ABA23EA390E5F3B48203DBB7241F7. Later I manually update my table field to this value, but Where Password =…
J_77
  • 15
  • 5
0
votes
1 answer

Avoiding multiple rows in call to 'HashBytes' with 'FOR XML RAW'

In a generic ETL flow I'm selecting data from a source (Table, file, webservice etc.) into a datamart. I'm using the MS-SQL hashbyte-function to identify whether a row has changed. E.g. on a city-table with CountryCode, Zip and CityName with…
PCJ
  • 73
  • 9
0
votes
1 answer

different outputs using hashbytes

I have a simple table for testing HASH PASSWORDS i have 2 columns PWD & HASHED_PWD. let's say in PWD i have password '111' in HASHED_PWD I used this query to add hashed password '111': declare @hashThis nvarchar(150); select @hashThis =…
Sam
  • 406
  • 1
  • 11
  • 24
0
votes
1 answer

will Hashbytes in T-SQL always return the same result?

Will Hashbytes always return the same result for the same input I mean if I call HASHBYTES('SHA1',@value) 100 time will the result always be the same?
YAKOVM
  • 9,805
  • 31
  • 116
  • 217
-1
votes
1 answer

CONVERT(NVARCHAR(100), HASHBYTES(N'SHA1', @PasswordWithSalt ),2) equivalent in c#

I'm trying to move authentication from the stored procedure to EF. The SQL itself is returning 2 results. How should I validate them? The value is to be checked against the value stored in the table ECC2065575DCBF977CD923996C598C3DC481404E SQL…
Prateek Chauhan
  • 47
  • 1
  • 1
  • 5
-1
votes
1 answer

Generate HASHBYTES inside the JavaScript file

I have to generate a secure token.This token will be consumed by WebApi. I'm requesting that Webapi through JavaScript file. It is a SPA app. So my question is, can I generate below mentioned token without using the Sql server response ? The SQL…
Sampath
  • 63,341
  • 64
  • 307
  • 441