Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL Server Problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-01-28 : 08:19:20
Bambang Adi writes "Dear Sir,
I have problem with my sql server. I have a query like this

SELECT A.Nota, A.Tanggal, A.Kasir, B.Nama, B.Lain2 AS Gudang, W.KodeBarang,
X.Nama AS NamaBarang, W.KodeKemasan, Y.Nama AS NamaSatuan, W.Jumlah,
W.Harga, W.Disc, (W.Jumlah * W.Harga) AS JumlahTagihan,
(W.Jumlah * W.Disc) AS Potongan,
((W.Jumlah * W.Harga) - (W.Jumlah * W.Disc)) AS Bayar,
Z.Jumlah AS SisaStok
FROM Retail AS A, Pegawai AS B, DetailRetail AS W,
Barang AS X, Satuan AS Y, StokGudang Z
WHERE B.Kode = A.Kasir AND W.Nota = A.Nota AND X.Kode = W.KodeBarang AND
Y.Kode = W.KodeKemasan AND Z.KodeBarang = W.KodeBarang AND
Z.KodeSatuan = W.KodeKemasan AND Z.KodeGudang = B.Lain2
ORDER BY A.Tanggal

I have made index for each table and it's take 18 second to select about 20,000 record. I'm using SQL Query Analyser. I made my application with VB 6.0 and crystal report as my report. My problem is 18 second it's too long for my application. Do you have solution how I can select this record more faster. In your opinion How long SQL Server take 20,000 record in 6 table, like in my query? Thank You for your time.

Best Regard,
Bambang Adi"
   

- Advertisement -