In SQL Server, temporary tables are created using the same CREATE TABLE
syntax as regular tables. The difference is that temporary tables’ names are prefixed with either one or two number signs (#
), depending on whether it’s a local temporary table or global temporary table:
- Local temporary tables are prefixed with a single number sign (
#
) - Global temporary tables are prefixed with a double number sign (
##
)