Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT 1
- FROM dbo.Customers
- WHERE CustID = @CustID COLLATE SQL_Latin1_General_CP1_CS_AS
- AND CustPassword = @CustPassword COLLATE SQL_Latin1_General_CP1_CS_AS
- SELECT *
- FROM Users
- WHERE
- Username = @Username COLLATE SQL_Latin1_General_CP1_CS_AS
- AND Password = @Password COLLATE SQL_Latin1_General_CP1_CS_AS
- AND Username = @Username
- AND Password = @Password
- SELECT *
- FROM Users
- WHERE
- CAST(Username as varbinary(100)) = CAST(@Username as varbinary))
- AND CAST(Password as varbinary(100)) = CAST(@Password as varbinary(100))
- AND Username = @Username
- AND Password = @Password
- Select * from your_table where convert(varbinary, your_column) = convert(varbinary, 'aBcD')
- SELECT
- FROM Users
- WHERE
- BINARY_CHECKSUM(Username) = BINARY_CHECKSUM(@Username)
- AND BINARY_CHECKSUM(Password) = BINARY_CHECKSUM(@Password)
- declare @first_value nvarchar(1) = 'a'
- declare @second_value navarchar(1) = 'A'
- if HASHBYTES('SHA1',@first_value) = HASHBYTES('SHA1',@second_value) begin
- print 'equal'
- end else begin
- print 'not equal'
- end
- -- output:
- -- not equal
- declare @example table (ValueA nvarchar(1), ValueB nvarchar(1))
- insert into @example (ValueA, ValueB)
- values ('a', 'A'),
- ('a', 'a'),
- ('a', 'b')
- select ValueA + ' = ' + ValueB
- from @example
- where hashbytes('SHA1', ValueA) = hashbytes('SHA1', ValueB)
- -- output:
- -- a = a
- select ValueA + ' <> ' + ValueB
- from @example
- where hashbytes('SHA1', ValueA) <> hashbytes('SHA1', ValueB)
- -- output:
- -- a <> A
- -- a <> b
- declare @value_b nvarchar(1) = 'A'
- select ValueB + ' = ' + @value_b
- from @example
- where hashbytes('SHA1', ValueB) = hasbytes('SHA1', @value_b)
- -- output:
- -- A = A
- SELECT * FROM table_name WHERE binary username=@search_parameter and binary password=@search_parameter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement