Previous Topic

Next Topic

Inhoudsopgave

Book Index

QUOTED_IDENTIFIER

set quoted_identifier off;

declare @vc varchar(10) = "James Bond";

select @vc as [quoted_identifier OFF];

go

set quoted_identifier on;

declare @vc varchar(10) = "James Bond";

select @vc as [quoted_identifier ON];

go

Results in the error

Msg 207, Level 16, State 1, Line 7

Invalid column name 'James Bond'.

/* Solution */

set quoted_identifier on;

declare @vc varchar(10) = 'James Bond';

select @vc as [quoted_identifier ON, solution];

select @vc as "quoted_identifier ON";

go