Wednesday

SQL server 2005-create indexes for temporary tables t-sql



1 SELECT
2 ad.[DealerId]
3 ,ad.[APSDealerId]
4 ,cu.CustomerID
5 ,cu.[FirstName]
6 ,cu.[LastName]
7 ,cu.[DOB]
8 ,cu.OwnerID
9 ,cu.referencefield1
10 ,cu.referencefield2
11 into #tmain
12 FROM [Customers] cu
13 INNER JOIN [AdvanceCustomer] ac ON ac.[CustomerID] = cu.[CustomerID]
14 INNER JOIN [ApsUbillDealer] ad ON ad.[DealerId] = ac.[DealerID]
15 WHERE cu.[DateCreated] > @XmlData.value('(/args/FromDate)[1]','varchar(10)')
16 AND cu.[DateCreated] < @XmlData.value('(/args/ToDate)[1]','varchar(10)')
17
18 CREATE UNIQUE CLUSTERED INDEX IX_1 on #tmain (CustomerID, OwnerID)
19 CREATE INDEX IX_2 on #temp_employee_v1 (APSDealerId)
20
21


more...

No comments:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...