mpen
mpen

Reputation: 282865

How to query a table with square brackets in it?

How can I query a table literally called [tbl] with the square brackets in its name?

I'm trying

select * from [[tbl]]

But that doesn't work. Nor does

select * from [\[tbl\]]

How else would I escape the [s?

Upvotes: 2

Views: 365

Answers (1)

mpen
mpen

Reputation: 282865

Through trial and error, I discovered you have to double the number of closing ]s only. i.e.

select * from [[tbl]]]

Upvotes: 5

Related Questions