Search code examples
sql-serversyntaxsymbols

What does the SQL # symbol mean and how is it used?


Can someone please explain to me what the # symbol means in MS SQL Code.

I've tried Googling it, and even searching on StackOverflow, but can't seem to find the answer.

I feel like an idiot - having one of "those" days. Please help.


Solution

  • They normally prefix temporary tables.

    From the docs....

    Prefix local temporary table names with single number sign (#table_name), and prefix global temporary table names with a double number sign (##table_name).