Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Jumbling up names, anyone know any tricks?!!

Author  Topic 

Tim_Field
Yak Posting Veteran

87 Posts

Posted - 2005-07-07 : 10:47:12
Hi All, I have some data which I'd like turn into something unrecognisable.... I'd ideally like to keep the same surname where there is a sims.stud_relation record.

Anyone know a quick way to do this??



-- For encrypting data.
declare @mappingstable table (old_person_id int, new_person_id int, surname varchar(200), midname varchar(200), forename varchar(200))
declare @relationstable table (student_id int, contact_id int)

insert into @relationstable
(student_id, contact_id) -- these are person_id's
select
student_id, contact_id from sims.stud_relation

insert into @mappingstable
(old_person_id, new_person_id, surname, midname, forename)
select
person_id, person_id, surname, midname, forename
from sims.sims_person

X002548
Not Just a Number

15586 Posts

Posted - 2005-07-07 : 10:55:55
quote:
Originally posted by Tim_Field

Hi All, I have some data which I'd like turn into something unrecognisable....



I betcha Jon could help....

You got some of the info we need, could you follow the link below and give us the rest of the puzzle...



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

Tim_Field
Yak Posting Veteran

87 Posts

Posted - 2005-07-07 : 11:03:56
Something like this....


CREATE TABLE sims_person
(person_id int
,surname varchar(200)
,midname varchar(200)
,forename varchar(200)
,legal_surname varchar(200)
,chosen_forename varchar(200)
,dob datetime )


-- BOTH ID's LINK INTO PERSON TABLE
CREATE TABLE stud_relation
(student_id int
, contact_id int )

Go to Top of Page

Tim_Field
Yak Posting Veteran

87 Posts

Posted - 2005-07-07 : 11:09:49
and these....


insert into sims_person
(person_id
,surname
,midname
,forename
,legal_surname
,chosen_forename
,dob )
values
( 1
,'Jones'
,'John'
,'Peter'
,'Jonesr'
,'Jon'
, '1980-01-01' )

insert into sims_person
(person_id
,surname
,midname
,forename
,legal_surname
,chosen_forename
,dob )
values
( 1
,'Jones'
,'Robert'
,'Bob'
,'Jonesr'
,'Rob'
, '1990-01-01' )

insert into stud_relation
(student_id, contact_id)
(1, 2 )
Go to Top of Page

jhermiz

3564 Posts

Posted - 2005-07-07 : 14:26:23
quote:
Originally posted by X002548

quote:
Originally posted by Tim_Field

Hi All, I have some data which I'd like turn into something unrecognisable....



I betcha Jon could help....

You got some of the info we need, could you follow the link below and give us the rest of the puzzle...



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx




I'll take that as a compliment, considering the source, do you like talking behind people's back ? You know for your age you really are childish.


Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page

Tim_Field
Yak Posting Veteran

87 Posts

Posted - 2005-07-08 : 04:37:27
Can anyone help then???
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-07-08 : 04:43:55
what do you mean by unrecognizable? like being encrypted?

create two functions, one for encrypting and the other for decrypting,
for the algorithm to be used, that depends on your needs, search the forum and internet, as far as I can remember, someone posted relevant algorithms

HTH

--------------------
keeping it simple...
Go to Top of Page

Tim_Field
Yak Posting Veteran

87 Posts

Posted - 2005-07-08 : 05:12:17
Nope.... just turning smith into djxjdj or something like that...
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-08 : 05:50:53
quote:
Originally posted by Tim_Field

and these....


insert into sims_person
(person_id
,surname
,midname
,forename
,legal_surname
,chosen_forename
,dob )
values
( 1
,'Jones'
,'John'
,'Peter'
,'Jonesr'
,'Jon'
, '1980-01-01' )

insert into sims_person
(person_id
,surname
,midname
,forename
,legal_surname
,chosen_forename
,dob )
values
( 1
,'Jones'
,'Robert'
,'Bob'
,'Jonesr'
,'Rob'
, '1990-01-01' )

insert into stud_relation
(student_id, contact_id)
(1, 2 )



What is your expected result after the insertion?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -