What is '#' in Dapper examples?

dapper sql

Question

I'm learning Dapper through code.google and github. I noticed that some table names have '#' as prefix. I tried using '#', but it's not working, I got an error saying that I have error in my SQL syntax. What's the meaning of '#' in the examples?

Accepted Answer

In SQL-Server, #tablename denotes a temporary table (which can be connection-based, or local to a stored-procedure). ##tablename denotes a global temporary table. There is also @tablename which is a table-variable (or can also be a parameter, variable, or table-valued-parameter).



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why