x

What is the use of #?

Just wanna know, if what is the use of # symbol beside the table name PaySlip?

 CREATE TABLE #PaySlip(
    WorkId int,
    PName nvarchar(max),
    Client nvarchar(max),
    PayPeriod nvarchar(max),
    PayDt nvarchar(max),
    Particulars varchar(max),
    RefInfo nvarchar(max),
       DAmt nvarchar(max),
    CAmt nvarchar(max),
    RunBal nvarchar(max),
    ToDeBit nvarchar(max),
    ToCredit nvarchar(max),
    ToPay nvarchar(max),
    AcctNo nvarchar(max),
    --
    Template nvarchar(max),
    Rate decimal(18,2)
    )

Thanks and regards.

more ▼

asked Jul 25, 2012 at 01:11 AM in Default

avatar image

jeff020590
1 3 3 3

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

This creates a temporary table which is locally scoped to the connection. This temporary table will be automatically dropped when the connection using it is terminated (or the table is explicitly dropped).

You can also have ## global temporary tables which are server scoped, thus accessible by any connection, and automatically dropped when there are no more connections using it.

Finally you can have @ table variables which are scoped to the query and not stored beyond that.

more ▼

answered Jul 25, 2012 at 04:41 AM

avatar image

SirSQL
4.9k 4 5

(comments are locked)
10|1200 characters needed characters left

The symbol # show the object is temporary

more ▼

answered Jul 25, 2012 at 01:31 PM

avatar image

basit 1
509 56 65 91

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x457
x43

asked: Jul 25, 2012 at 01:11 AM

Seen: 1054 times

Last Updated: Jul 25, 2012 at 01:31 PM

Copyright 2016 Redgate Software. Privacy Policy