Hi @David Chase ,
How did you get your procedure AFTER encryption?
Using sp_helptext or other command?
I made a test using part of DDL of [tblPatients] you provided in previous post.
CREATE TABLE [dbo].[tblPatients](
[PatientID] [int] IDENTITY(1,1) NOT NULL,
[FirstName] [nvarchar](20) ,
[MiddleName] [nvarchar](20) ,
[LastName] [nvarchar](30) ,
[DOB] [smalldatetime]
Then I create one precedure as below adding some comments,spaces and indentations:
create PROCEDURE [dbo].[kd_selPatientSearch]
@SearchText nvarchar(150),
@SearchType int = 0
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--vjhlghjwsfhddfgjh
SELECT P.FirstName,
P.LastName,
P.CaregiverLogin
--dgjfhjdfhj
FROM dbo.tblPatients AS P
---fghgkuyil
WHERE (
CASE WHEN @SearchType = 0 AND P.CaregiverLogin = @SearchText THEN 'T'
WHEN @SearchType = 1
--drtreytu
AND (P.LastName = @SearchText
OR P.FirstName = @SearchText)
THEN 'T'
ELSE 'F'
END = 'T'
)
end
Then I executed below command:
sp_helptext [kd_selPatientSearch]
The output is as below:
CREATE PROCEDURE [dbo].[kd_selPatientSearch]
@SearchText NVARCHAR (150), @SearchType INT=0
AS
BEGIN
SET NOCOUNT ON;
SELECT P.FirstName,
P.LastName,
P.CaregiverLogin
FROM dbo.tblPatients AS P
WHERE (CASE WHEN @SearchType = 0
AND P.CaregiverLogin = @SearchText THEN 'T' WHEN @SearchType = 1
AND (P.LastName = @SearchText
OR P.FirstName = @SearchText) THEN 'T' ELSE 'F' END = 'T');
END
Later I added column encryption to tblPatients table (FirstName,MiddleName and [LastName]).
Finally I ran the sp_helptext command again and found that the output is the completely same with previous one which was before encryption.
So the format of procedure could not change whether adding column encryption to a table or not in my test.
You could also try to execute the sp_helptext [kd_updtblActualFoods] before encryption and see whether format changes.
Hope this could be a little helpful to you.
Best regards
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.