← Back to Knowledge Base

KB #240029: How to specify column and table names containing embedded spaces

⏱️ 1 min read
Type: Tip
Summary:
Column and table names containing embedded spaces (blanks) must be enclosed in [brackets], not ‘quotes’, when passed as parameters to APIs.
Additional Information:
-- Correct:
set @value = fn_n_decrypt_char([home phone], 0, 0, 1)

-- Wrong: this will decrypt the literal value "home phone"
set @value = fn_n_decrypt_char('home phone', 0, 0, 1)

-- Correct:
exec sp_n_encrypt_col [student table], [home phone], 1

-- Wrong: this will generate an error
exec sp_n_encrypt_col 'student table', 'home phone', 1

Tip: It is always ok to enclose table or column names in [brackets] even if they do not contain embedded spaces:

-- Both are correct:
exec sp_n_encrypt_col students, telephone, 1
exec sp_n_encrypt_col [students], [telephone], 1

 

Was this article helpful?

Related Articles

KB #240155: Returning to a clean state

Type: Info Summary: This article provides some extra steps if there are issues with uninstall…

KB #240034: Error – Cannot resolve collation conflict for concatenation operation

Type: Fix Summary: When encrypting or decrypting a column when using a non-Western version of…

KB #240055: Could not secure this instance of SQL Server Function return code: 2

Type: Information Summary: You have received an error message “Could not secure this instance of…

Still need help?

Our support team is here to assist you.

NetLib Security
AI Assistant · Online
Hi! I'm the NetLib Security assistant. I can answer questions about our encryption solutions, HIPAA compliance, Encryptionizer, and more. How can I help you today?