れ MS-SQL Server襯 伎 蟲 企.
create table customer
(
hash_id int
, id varchar(20)
, pw varchar(16)
, sitecode tinyint
);
insert customer values(checksum('yasicom' + CONVERT(varchar(3), 1)), 'yasicom', '1234', 1);
insert customer values(checksum('yasicom' + CONVERT(varchar(3), 2)), 'yasicom', '1234', 2);
insert customer values(checksum('yasicom' + CONVERT(varchar(3), 3)), 'yasicom', '1234', 3);
insert customer values(checksum('yasicom' + CONVERT(varchar(3), 4)), 'yasicom', '1234', 4);
go
create proc usp_customer_select
@id varchar(20)
, @sitecode tinyint
as
select * from customer
where hash_id = checksum(@id + CONVERT(varchar(3), @sitecode));
go
exec usp_customer_select 'yasicom', 1
exec usp_customer_select 'yasicom', 2
exec usp_customer_select 'yasicom', 3
exec usp_customer_select 'yasicom', 4