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 2005 Forums
 Transact-SQL (2005)
 Select In Select

Author  Topic 

shahab_ksh
Starting Member

3 Posts

Posted - 2008-01-13 : 14:09:27
Hi

I have Table name tbl_admins with 4 filds name

fld_id is master key Int
fld_username,fld_password is Nvarchar
fld_guid is uniq GUID

I Encrypt tbl_admins with EncryptByPassPhrase That ! 'passphrase' Is fld_guid

1- I Get @str_guid with Insert blank

INSERT INTO tbl_admins (fld_username) VALUES (Null)

Declare @str_guid Nvarchar (400)
Select @str_guid=(Select fld_guid From tbl_admins Where (fld_id=(SELECT SCOPE_IDENTITY() as fld_id)))



2- I Update Information For This Coloum

Update tbl_admins Set

fld_username=EncryptByPassPhrase(@str_guid,@par_username),
fld_password=EncryptByPassPhrase(@str_guid,@par_password),

Where (fld_guid=@str_guid)




ok i have 2 QUESTION

1- How I can use DecryptByPassPhrase for Coloums

Select * From tbl_admins


2- for example i have this Select how i can use DecryptByPassPhrase

Select * From tbl_admins Where(fld_username=EncryptByPassPhrase(Convert(Nvarchar(MAX),(Select fld_guid From tbl_admins)),'user'))

but is not work




   

- Advertisement -