QUOTENAME function : QUOTENAME « String Functions « SQL Server / T-SQL Tutorial






5> USE Northwind;
6> DECLARE @db AS NVARCHAR(258);
7> SET @db = QUOTENAME(N'pubs');
8> EXEC(N'USE ' + @db + N' SELECT DB_NAME();');
9>
10> GO








12.12.QUOTENAME
12.12.1.QUOTENAME takes a character string and turns it in to a valid SQL Server identifier, which can be used as a name for a SQL
12.12.2.QUOTENAME function