The following query gives a list of users who have completed 0 modules. Code below:
SELECTpps_principals.name AS pname,
COUNT(PPS_SCOS.SCO_ID) AS coursecount
FROMPPS_PRINCIPALS
LEFT JOINPPS_TRANSCRIPTS ON PPS_TRANSCRIPTS.PRINCIPAL_ID = PPS_PRINCIPALS.PRINCIPAL_ID
AND PPS_TRANSCRIPTS.STATUS like '[PCF]'
AND PPS_TRANSCRIPTS.TICKET not like 'l-%'
AND pps_transcripts.date_created between '2006-10-01' and '2007-09-30'
LEFT JOINPPS_SCOS ON PPS_SCOS.SCO_ID = PPS_TRANSCRIPTS.SCO_ID
AND pps_scos.name like 'MT%'
WHEREpps_principals.login like '%score%'
AND dbo.PPS_PRINCIPALS.DISABLED IS NULL
GROUP BYPPS_PRINCIPALS.NAME
HAVINGCOUNT(PPS_SCOS.SCO_ID) = 0
ORDER BYpps_principals.name asc
This query works fine.
I want to be able to do another join to a table called EXT_USER_GROUPS to the query. This ties in the names to a group based on location. I have added this (see code below):
SELECTpps_principals.name AS pname, EXT_USER_GROUPS.LOGIN,, EXT_USER_GROUPS.NAME,
COUNT(PPS_SCOS.SCO_ID) AS coursecount
FROMPPS_PRINCIPALS
LEFT JOINPPS_TRANSCRIPTS ON PPS_TRANSCRIPTS.PRINCIPAL_ID = PPS_PRINCIPALS.PRINCIPAL_ID
AND PPS_TRANSCRIPTS.STATUS like '[PCF]'
AND PPS_TRANSCRIPTS.TICKET not like 'l-%'
AND pps_transcripts.date_created between '2006-10-01' and '2007-09-30'
LEFT JOINPPS_SCOS ON PPS_SCOS.SCO_ID = PPS_TRANSCRIPTS.SCO_ID
LEFT JOINEXT_USER_GROUPS ON EXT_USER_GROUPS.LOGIN = PPS_PRINCIPALS.LOGIN
AND pps_scos.name like 'MT%'
WHEREpps_principals.login like '%TEST%'
AND dbo.PPS_PRINCIPALS.DISABLED IS NULL
GROUP BYPPS_PRINCIPALS.NAME
HAVINGCOUNT(PPS_SCOS.SCO_ID) = 0
ORDER BYpps_principals.name asc
With this I get the following error:
Server: Msg 8120, Level 16, State 1, Line 1
Column 'EXT_USER_GROUPS.LOGIN' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
I'd like to join these 2 tables and be able to display in a repeater. the problem is that i keep getting some duplicates with sql statement
"SELECT DISTINCT options.orderid,options.productname,options.optionvalue,orderitems.quantity,orderitems.productcode FROM options INNER JOIN on orderitems on options.[orderid] = orderitems.[orderid] "
Select [DepartmentNumber] = '001', [UserName] = (Select [Value] From [dbo].[fn_Split]([Strings],'|') where idx = 3), [DomainName] = (Select [Value] From [dbo].[fn_Split]([Strings],'|') where idx = 4), [Events].* from [Events] join EventstoLog ON dbo.Events.EventID = dbo.EventsToLog.EventID
quote:Msg 257, Level 16, State 3, Line 3 Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query.
The Select with the Join at the bottom work great by itself. The whole script without the Join works. But add the Join to the Insert Into script and it fails.
Can someone look at this and point me in the right direction??
Also, below is most of the table strustures just in case.
USE [EventLogs] GO /****** Object: Table [dbo].[Events] Script Date: 12/01/2006 18:15:01 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Events]( [EventLog] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [RecordNumber] [int] NULL, [TimeGenerated] [datetime] NULL, [TimeWritten] [datetime] NULL, [EventID] [int] NULL, [EventType] [int] NULL, [EventTypeName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [EventCategory] [int] NULL, [EventCategoryName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [SourceName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [Strings] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [ComputerName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [SID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [Message] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [Data] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY]
GO SET ANSI_PADDING OFF
USE [EventLogs] GO /****** Object: Table [dbo].[SecurityEvents_Temp] Script Date: 12/01/2006 18:15:50 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[SecurityEvents_Temp]( [DepartmentNumber] [varchar](3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [UserName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [DomainName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [EventLog] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [RecordNumber] [int] NULL, [TimeGenerated] [datetime] NULL, [TimeWritten] [datetime] NULL, [EventID] [int] NULL, [EventType] [int] NULL, [EventTypeName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [EventCategory] [int] NULL, [EventCategoryName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [SourceName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [Strings] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [ComputerName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [SID] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [Message] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [Data] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY]
GO SET ANSI_PADDING OFF
USE [EventLogs] GO /****** Object: Table [dbo].[EventsToLog] Script Date: 12/01/2006 18:16:24 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[EventsToLog]( [EventID] [int] NULL, [EventDescription] [char](120) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY]
I am trying to do a left join from one table a to table B on a column CEO_ID which is of datatype varchar(5) in table A and of datatye nvarchar(20) in table b.The resultset gives me all the rows that are in both the tables except a few..So when I looked at the records that are missing, it is stored as 00392 in table A and 392 in table b and that is the reason it is not showing that record in the result.How can I show these records?
Query Select p.CEO_ID,p.Part_ID,ct.CEO_ID__c from Contact ct left join Main5.dbo.Part p on p.CEO_ID = Convert(varchar(5),ct.CEO_ID__c) collate database_default where ct.CEO_ID__c = 392
HelloI am seeing the following syntax error: Error on Primary Select: Line 4: Incorrect syntax near '='.When I try to join two tables see my code below:------------------------------------------------------------------------------------------------------------------------ SELECT a.ProdName as [Product Name], b.price,b.link FROMProd_CatA a LEFT JOIN (SELECT ProdName, Price, '<a href="' + url + '">' + Title + '</a>' as Link FROM ProdNames WHERE = url like 'http:%' ) b ON a.ProdName=b.ProdNameWhere a.Red = 'yes'ORDER BY a.ProdName ASC ------------------------------------------------------------------------------------------------------------------------------ I unable to find a solution. I would be grateful if somebody could please advise.ThanksLynn
I want to insert into a table the result of a select which contains a join. Is this possible in any way on mysql 3.23.58?
I tryed the following code (in both ansi 92 and non ansi 92 forms)
insert book_edition (ISBN, book_title, publisher, book_image, author_name) select i.isbn, i.imageurl, i.author, i.title, i.publisher from ImportDataUniqueISBN i left outer join book_edition b on i.isbn = b.ISBN where b.ISBN is null
I get the following error:
INSERT TABLE 'book_edition' isn't allowed in FROM table list
If executed without the join statement it works well.
Trying to run a query to get total number of direct mail campaigns by company. Would like the totals to be (1) total number of direct mail campaigns (there are 2 types) (2) total number of direct mail campaigns type direct mail (3) total number of direct mail campaigns type publication
Below is the query I put together with INNER JOIN:
SELECT Agency.PrimaryAgencyName, COUNT(Distinct Campaigns.DirectMailID) AS TotalCampaigns, COUNT(Distinct DirectMail.Type) AS TotalDirectMail
FROM Agency INNER JOIN (Clients INNER JOIN (Campaigns INNER JOIN DirectMail ON DirectMail.DirectMailID = Campaigns.DirectMailID) ON Clients.ClientID = Campaigns.CampaignID) ON Agency.AgencyID = Clients.AgencyID
GROUP BY Agency.PrimaryAgencyName, DirectMail.Month, DirectMail.Type ORDER BY Agency.PrimaryAgencyName
When I run the query, I recent the below error:
Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the nvarchar value '1683 1-15017' to data type int.
The value mentioned in the above error message is the ClientID.
Below are the tables for reference (bold for entity name and underline for PK) and datatypes
Why would this error? The join works in Query Analyzer. GridViewShowA.Visible = true;String objConnection = ConfigurationManager.ConnectionStrings["MyConnection"].ToString();String strSQL = "SELECT x.office as Office, x.email as Email, z.fname as 'First Name', z.lname as 'Last Name', ";strSQL += "z.title as Title ";strSQL += "FROM db1.dbo.tblA X ";strSQL += "JOIN db2.dbo.tblA Z ";strSQL += " ON x.email = z.email";strSQL += "WHERE x.office = '" + DropDownListoffice.SelectedValue.ToString() + "' ";strSQL += "AND z.email = x.email";SqlDataAdapter objAdapter = new SqlDataAdapter(strSQL, objConnection);DataSet dataSet = new DataSet();objAdapter.Fill(dataSet, "myData");DataTable dataTable = dataSet.Tables[0];GridViewShowA.DataSource = dataTable.DefaultView;GridViewShowA.DataBind(); error: Line 1: Incorrect syntax near 'x'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near 'x'.Source Error: Line 101: objAdapter.Fill(dataSet, "myData");
I am trying to pull in columns from multiple tables but am getting an error when I run the code:
Msg 4104, Level 16, State 1, Line 1
The multi-part identifier "a.BOC" could not be bound.
I am guessing that my syntax is completely off.
SELECT b.[PBCat] ,c.[VISN] --- I am trying to pull in the Column [VISN] from the Table [DIMSTA]. Current Status: --Failure ,a.[Station] ,a.[Facility] ,a.[CC] ,a.[Office]
I have been working on this for a little bit and have gotten to this point. Below is the query in blue, the error in red. Now, from what I gather the error is telling me I can't insert a duplicate product code into tblProduct. Isn't that what the left join is exactly not doing, as in, the left join is inserting all records from Complete_records into tblProduct where the code is null(does not exist) in tblProduct? Or, is this an issue where the identity number, productID in tblProduct, isn't starting at the next number in turn?
Thanks.
Set Identity_Insert tblProduct on DECLARE @MaxId int
SELECT @MaxID=MAX(productID) FROM tblProduct
SELECT IDENTITY(int,1,1) AS ID,Complete_products.APNum, Complete_products.Title, Complete_products.CategoryID, Complete_products.Mountable, Complete_products.price, Complete_products.Height, Complete_products.Width, Complete_products.IRank, Complete_products.frameable, Complete_products.Typ INTO #Temp FROM Complete_products LEFT OUTER JOIN tblProduct AS tblProduct_1 ON Complete_products.APNum = tblProduct_1.productCode where tblProduct_1.productCode IS NULL
INSERT INTO tblProduct (productID,productCode, productName, productNavID, CanBeMounted, productRetailPrice, productHeight, productWidth, Rank, CanBeFramed, ProductType) SELECT @MaxID + ID, APNum, Title, CategoryID, Mountable, price, Height, Width, IRank, frameable, Typ FROM #Temp
(236752 row(s) affected) Msg 2601, Level 14, State 1, Line 13 Cannot insert duplicate key row in object 'dbo.tblProduct' with unique index 'IX_tblProductt_productCode'. The statement has been terminated.
I'm writing a query where I have multiple left-outer joins but I keep getting multi-part identifier error. See the query below?
SELECT gl.seg5 Natural ,gl.seg2 Office ,gl.seg3 Dept ,gl.seg4 Team ,gl.seg6 Sub ,gl.seg7 Tkpr ,gl.seg1 Comp ,'CHK' Source
[Code] ....
Errors
Msg 4104, Level 16, State 1, Line 68 The multi-part identifier "csddt.baid" could not be bound. Msg 4104, Level 16, State 1, Line 68 The multi-part identifier "csddt.cknum" could not be bound. Msg 4104, Level 16, State 1, Line 68 The multi-part identifier "csddt.ckline" could not be bound.
I have a few tables I am trying to join to create a report. Everything was working fine until I tried to add an aggregate Sum function to a column (MaxCap) in table ctfBarn.Â
I was writing a query using both left outer join and inner join. And the query was ....
SELECT Â Â Â Â Â Â Â S.companyname AS supplier, S.country,P.productid, P.productname, P.unitprice,C.categoryname FROM Â Â Â Â Â Â Â Production.Suppliers AS S LEFT OUTER JOIN Â Â Â Â Â Â (Production.Products AS P Â Â Â Â Â Â Â Â INNER JOIN Production.Categories AS C
[code]....
However ,the result that i got was correct.But when i did the same query using the left outer join in both the cases
i.e..
SELECT Â Â Â Â Â Â Â S.companyname AS supplier, S.country,P.productid, P.productname, P.unitprice,C.categoryname FROM Â Â Â Â Â Â Â Production.Suppliers AS S LEFT OUTER JOIN (Production.Products AS P LEFT OUTER JOIN Production.Categories AS C ON C.categoryid = P.categoryid) ON S.supplierid = P.supplierid WHERE S.country = N'Japan';
The result i got was same,i.e
supplier   country   productid   productname   unitprice   categorynameSupplier QOVFD   Japan   9   Product AOZBW   97.00   Meat/PoultrySupplier QOVFD   Japan  10   Product YHXGE   31.00   SeafoodSupplier QOVFD   Japan  74   Product BKAZJ   10.00   ProduceSupplier QWUSF   Japan   13   Product POXFU   6.00   SeafoodSupplier QWUSF   Japan   14   Product PWCJB   23.25   ProduceSupplier QWUSF   Japan   15   Product KSZOI   15.50   CondimentsSupplier XYZ   Japan   NULL   NULL   NULL   NULLSupplier XYZ   Japan   NULL   NULL   NULL   NULL
and this time also i got the same result.My question is that is there any specific reason to use inner join when join the third table and not the left outer join.
OLEDB source 1 SELECT ... ,[MANUAL DCD ID] <-- this column set to sort order = 1 ... FROM [dbo].[XLSDCI] ORDER BY [MANUAL DCD ID] ASC
OLEDB source 2 SELECT ... ,[Bo Tkt Num] <-- this column set to sort order = 1 ... FROM ....[dbo].[FFFenics] ORDER BY [Bo Tkt Num] ASC
These two tasks are followed immediately by a MERGE JOIN
All columns in source1 are ticked, all column in source2 are ticked, join key is shown above. join type is left outer join (source 1 -> source 2)
result of source1 (..dcd column) ... 4-400-8000119 4-400-8000120 4-400-8000121 4-400-8000122 <--row not joining 4-400-8000123 4-400-8000124 ...
result of source2 (..tkt num column) ... 4-400-1000118 4-400-1000119 4-400-1000120 4-400-1000121 4-400-1000122 <--row not joining 4-400-1000123 4-400-1000124 4-400-1000125 ...
All other rows are joining as expected. Why is it failing for this one row?
I'm having trouble with a multi-table JOIN statement with more than one JOIN statement.
For each order, I need to return the following: CarsID, CarModelName, MakeID, OrderDate, ProductName, Total ordered the Car Category.
The carid (primary key) and carmodelname belong to the Cars table. The makeid and orderdate belong to the OrderDetails table. The productname and carcategory belong to the Product table.
The number of rows returned should be the same as the number of rows in OrderDetails.
Why would I use a left join instead of a inner join when the columns entered within the SELECT command determine what is displayed from the query results?
I have a merge join (full outer join) task in a data flow. The left input comes from a flat file source and then a script transformation which does some custom grouping. The right input comes from an oledb source. The script transformation output is asynchronous (SynchronousInputID=0). The left input has many more rows (200,000+) than the right input (2,500). I run it from VS 2005 by right-click/execute on the data flow task. The merge join remains yellow and the task never finishes. I do see a row count above the flat file destination that reaches a certain number and seems to get stuck there. When I test with a smaller file on the left it works OK. Any suggestions?
A piece of software I wrote starting timing out on a query that left outer joins a table to a view. Both the table and view have approximately the same number of rows (about 170000).
The table has 2 very similar columns, one is a varchar(1) and another is varchar(100). Neither are included in any index and beyond the size difference, the columns have the same properties. One of the employees here uses the varchar(1) column (called miscsearch) to tag large sets of rows to perform some action on. In this case, he had set 9000 rows miscsearch value to "g". The query then should join the table and view for all rows where miscsearch is set to g in the table. This query takes at least 20 minutes to run (I stopped it at this point).
If I remove the "where" clause and join all rows in the two tables, the query completes in about 20 seconds. If set the varchar(100) column (called descrip) to "g" for the same rows set via miscsearch, the query completes in about 20 seconds.
If I force the join type to a hash join, the query completes using miscsearch in about 30 seconds.
So, this works:
SELECT di.File_No, prevPlacements, balance,'NOT PLACED' as status FROM Info di LEFT OUTER HASH JOIN View_PP pp ON di.ram_file_no = pp.file_no WHERE miscsearch = 'g' ORDER BY balance DESC
and this works:
SELECT di.File_No, prevPlacements, balance,'NOT PLACED' as status FROM Info di LEFT OUTER JOIN View_PP pp ON di.ram_file_no = pp.file_no WHERE descrip = 'g' ORDER BY balance DESC
But this does't:
SELECT di.File_No, prevPlacements, balance,'NOT PLACED' as status FROM Info di LEFT OUTER JOIN View_PP pp ON di.ram_file_no = pp.file_no WHERE miscsearch = 'g' ORDER BY balance DESC
What should I be looking for here to understand why this is happening?
We are trying to migrate from sql 2005 to 2012. I am changing one of the implicit join to explicit join. As soon as I change the join, the number of rows returned are fewer than before.
INSERT #RIF_TEMP1 (rf1_row_no,rf1_rif, rf1_key_id_no, rf1_last_date, rf1_start_date) SELECT currow.rf0_row_no, currow.rf0_rif, currow.rf0_key_id_no, prevrow.rf0_start_date, currow.rf0_start_date FROM #RIF_TEMP0 currow LEFT JOIN #RIF_TEMP0 prevrow ON (currow.rf0_row_no = prevrow.rf0_row_no + 1)
[Code] ....
the count returned from both the queries is different.
I am not sure what am I doing wrong. The count of #RIF_TEMP0 is always 32, it never changes, but the variable @countTemp is different for both the queries.
Why does this right join return the same results as using a left (or even a full join)?There are 470 records in Account, and there are 1611 records in Contact. But any join returns 793 records.
select Contact.firstname, Contact.lastname, Account.[Account Name] from Contact right join Account on Contact.[Account Name] = Account.[Account Name] where Contact.[Account Name] = Account.[Account Name]
Is there a way to do a super-table join ie two table join with no matching criteria? I am pulling in a sheet from XL and joining to a table in SQLServer. The join should read something like €œfor every row in the sheet I need that row and a code from a table. 100 rows in the sheet merged with 10 codes from the table = 1000 result rows.
This is the simple sql (no join on the tables):
select 1.code, 2.rowdetail from tblcodes 1, tblelements 2
I read that merge joins work a lot faster than hash joins. How would you convert a hash join into a merge join? (Referring to output on Execution Plan diagrams.) THANKS
I get the following error when I try to create this stored proc. I think it may have something to do with the two joins.
Msg 8156, Level 16, State 1, Procedure sp_wisetopic_landing_getPaged_FeaturedAlbums, Line 16 The column 'ArtistId' was specified multiple times for 'PagedData'.
ROW_NUMBER() OVER (ORDER BY sortOrder DESC) AS RowNumber FROM wisetopic_artist_album A INNER JOIN wisetopic_artist_featuredAlbums B ON A.albumId = B.albumId INNER JOIN wisetopic_artist c ON A.artistid = c.artistid ) SELECT RowNumber, * FROM PagedData WHERE RowNumber between @FirstRow AND @LastRow ORDER BY RowNumber ASC;
There is a table called "tblvZipCodes" that contain a zipcode of all cities, area code that are located in that zip code.
The problem I have with the inner join is that there are more than 1 cities in one zipcode code. Is there a way to just return only the 1st row and not return the rest of the rows from the tblvZipCodes in the INNER JOIN query?
Thanks..
Code:
SELECT TOP 100 PERCENT dbo.tblPurchaseRaw.Year, dbo.tblPurchaseRaw.Make, dbo.tblPurchaseRaw.Model, dbo.tblPurchaseRaw.ModelType, dbo.tblPurchaseRaw.Color, dbo.tblvZipCodes.ZIPCode, dbo.tblvZipCodes.City, dbo.tblvZipCodes.County, dbo.tblvZipCodes.State, dbo.tblvZipCodes.AreaCode, dbo.tblvZipCodes.Region, dbo.tblaAccounts.Name, dbo.tblaAccounts.PhoneOne, dbo.tblaAccounts.AccountID, dbo.tblPurchaseRaw.AcceptedID, dbo.tblPurchaseRaw.Series, dbo.tblPurchaseRaw.BodyStyle, dbo.tblaAccounts.WebSite, dbo.tblaAccounts.SalesEmail, dbo.tblPurchaseRaw.EmailTo, dbo.tblPurchaseRaw.PhotoURL, dbo.tblPurchaseRaw.Mileage, dbo.tblPurchaseRaw.RawID, dbo.tblvRegions.Name AS RegionName, dbo.tblPurchaseRaw.VIN, dbo.tblPurchaseRaw.Style, dbo.tblPurchaseRaw.StockDate FROM dbo.tblPurchaseRaw INNER JOIN dbo.tblaAccounts ON dbo.tblPurchaseRaw.AccountID = dbo.tblaAccounts.AccountID INNER JOIN dbo.tblvZipCodes ON dbo.tblPurchaseRaw.ZipCode = dbo.tblvZipCodes.ZIPCode INNER JOIN dbo.tblvRegions ON dbo.tblvZipCodes.Region = dbo.tblvRegions.RegionID WHERE (CONVERT(char, dbo.tblPurchaseRaw.StockDate, 101) <> '01/01/1900') AND (dbo.tblPurchaseRaw.SoldRawID IS NULL) AND (dbo.tblPurchaseRaw.AcceptedID <> - 10) AND (dbo.tblPurchaseRaw.AcceptedID <> - 1) ORDER BY dbo.tblvZipCodes.ZIPCode
hello, i am running mysql server 5 and i have sql syntax like this: select sales.customerid as cid, name, count(saleid) from sales inner join customers on customers.customerid=sales.customerid group by sales.customerid order by sales.customerid; it works fine and speedy. but when i change inner join to right join, in order to get all customers even there is no sale, my server locks up. note: there is about 10000 customers and 15000 sales. what can be the problem? thanks,