Complex Join Replication Filtering Is Not Working In 3.5 Beta
Sep 11, 2007
Hi,
I have a complex join filtering on a replicated sql server database which was working fine in previous versions of sql compact. The query is something like the following:
SELECT <published columns> FROM <filtered table> INNER JOIN <child table> ON <child table>.ID = <filtered table>.ID and <child table>.date > getdate()-30
After I upgraded to compact databse 3.5, for some weird reason whichever tables have both these Join filter and article filter together behaving improperly. If I insert any row in any of these table, the row is replicated properly to the server, but it does not send the new row to any other users. Again this thing works fine in older version. I have switched back tyo the old version of sql ce and again it's started working.
Hi! I have table with complex index on 5 fields. One of them is string filed. I want to implement some sort of filtering, by setting SetRange() in my SQLCeCommand. But i need to fileter only by one string field and to get the values starting with the input string value. I tried to use such code: ... command.SetRange(DbRangeOptions.Prefix, new object[] {null, null, null, "Com", null}, null); resultSet = cmd.ExecuteResultSet(ResultSetOptions.Scrollable); .... But it doesn't work. As a result i've got an empty result set. Usage of simple index on one field and setting the correspondent range will solve problem, but i can't have such index due to project restrictions. Is there any way to set prefix range only by one value of complex index? If not, please, explain me how does Prefix Range works.
I have a Report where i want to show in a DataList only those values Filtered by one of the fields of my dataset. I want to show a Date value ONLY if another column value in that row in my dataset = "IN".
But nothing seems to happen here. No records are shown. It's like the condition is never true.
Steps:
1. I drag a DataList
2. I drag a DatasetField inside the DataList (automatically creates a textbox)
3. Right Click on the Datalist, Properties, then Filter Tab
can somebody explain to me why the below update fails to update one row and updates the entire table?
Code:
UPDATE addlist SET add_s = 1 WHERE EXISTS (SELECT a.add_s, a.email_address, e.public_name FROM add a, edit e WHERE a.email_address = e.email_address and a.add_email = 'mags23@rice.edu' and a.add_s = 0 and e.public_name = 'professor');
Just curious. The exec plan is the same for both qry's, and they both show the same estimated row counts @ the point of question in the exec plan. The exec times are roughly the same, any variances I'm attributing to db load from other things going on, since any benefits of one over the other are not consistent from execution to execution. So is there any benefit to filtering in the join conditions vs. the where clause? My thinking was that by filtering earlier in the qry (when joining) as opposed to "waiting" to do it in the where clause, the rest of the qry after the join would inherently be dealing w/a smaller result set for the rest of it's execution, thus improving performance. After the exec plan checking I did, I guess I was wrong. Seems that Sql Server is intelligent about such filtering when analyzing the entire qry, and building its execution accordingly. The execution plan for both qry's showed the same where clause argument for the tables being joined.
Filtering in where clause....
Code:
select... FromtProject p with (noLock) jointProjectCall pc with (noLock) on P.ID = pc.project_id jointStore S with (noLock) on pc.store_id = s.id jointZip Z with (noLock) on Z.zip5 = s.zip5 jointManager M on M.ID = case ... end leftjoin ( selectprojectCall_RecNum as RecNum, sum(answer) as HoursUsed fromtCall C whereAnswer > 0 and question_id in (1, 2) group by projectCall_Recnum ) as C on pc.recnum = c.recnum wherepc.removed = 0 andp.cancelled = 0 andp.deleted = 0 ands.closed = 0 ands.deleted = 0 andyear(getDate()) between year(P.startDate) and year(P.expDate)
Filtering in joins...
Code:
select... FromtProject p with (noLock) jointProjectCall pc with (noLock) on P.ID = pc.project_id and pc.removed = 0 and p.cancelled = 0 and p.deleted = 0 and year(getDate()) between year(P.startDate) and year(P.expDate) jointStore S with (noLock) on pc.store_id = s.id jointZip Z with (noLock) on Z.zip5 = s.zip5 and s.closed = 0 and s.deleted = 0 jointManager M on M.ID = case ... end leftjoin ( selectprojectCall_RecNum as RecNum, sum(answer) as HoursUsed fromtCall C whereAnswer > 0 and question_id in (1, 2) group by projectCall_Recnum ) as C on pc.recnum = c.recnum
I have two tables, one with data for one type of ID (call it key1) and a table where this ID (call it key2) is transformed to another. It is not one-to-one match with these types of ID and I want to check those key2 cases that have two or more key1 linked to it.
It is simple enough and for the easiest check I don't even need table1 to run it as table2 has both key1 and key2 variables.
However, not all doubles are of identical worth. Table1 (that has only key1) has a year variable. I am interested in doubles that have same year variable, ie. in table1 there are two key1 cases with the same year variable that are linked to one key2 case in table2.
So in essence in table1 I have key1, year and in table2 I have key1, key2 and I am interested in those key2-cases that have more than one key1 linked to it where years are the same.
SELECT query.key2 FROM ( SELECT DISTINCT a.key1, b.key2 FROM table1 AS a JOIN table2 AS b ON a.key1=b.key1 JOIN table1 AS c ON a.key1=c.key1 WHERE a.year=c.year) AS query GROUP BY query.key2 HAVING COUNT(*)>1
I tried it joining table1 twice and fiddling around with various JOIN and WHERE clauses (the one on show being the simplest and most naive one) but the query still returns key2-doubles whose key1 cases are linked to different years. It is simple enough if you give a distinct year value in where clause (and drop second table1 join as unnecessary) but I don't want to go through all years manually one by one. I was thinking some kind of iterative loop that changes the value of the year in where clause could do the trick (and be heavy computationally) but I don't really know how to go around doing it, haven't done any loops in SQL ever.
table_a has patient_id, tran_id and other fields a,b,c table_b has patient_id,tran_id, key_id and other fileds d,e,f table_a patien_id + tran_id is unique table_b patient_id + tran_id is not unique, could be duplicated.
I have to create a query which will retrieve fields from table a a,b,c and fields d,e from table b where table a. patient_id + tran_id = tableb.patient_id + tran_id and table_b.key_id is the min key_id for that patient_id + tran_id.
Hey all, I have 3 tables: 1 table with Module information (1 quiz-like part of an Exam), 1 table with the relationships between Modules and Exams (ratios) and 1 table with User information, that contains the Exam number, Module number, and score. I am trying to get a full list of modules' names for 1 exam, and the user's score for those modules they taken. All this would pertain to 1 single Exam. I am only getting records returned for those modules that the user has taken; I want the full list with NULL values for the scores of modules the user has not taken. Hope that made sense, here is my attempt:
Code:
SELECT ExamModules.Name, ExamUsers.Score FROM ExamToModule LEFT OUTER JOIN ExamModules ON ExamToModule.ModuleID = ExamModules.ID LEFT OUTER JOIN ExamUsers ON ExamToModule.ModuleID = ExamUsers.MID AND ExamToModule.ExamID = ExamUsers.EID WHERE (ExamToModule.ExamID = 1) AND (ExamUsers.UserName = 'dizzle')
In this case the user is Dizzle and the Exam's ID (primary key) is 1. I've changed LEFT to RIGHT and FULL, they all return the same few records. Help?
I need a little help and I hope I can write a clear description of the problem. I have to tables, customers and custrate. The customer table simply has a custid of other misc info. The custrate contains an entry for each rate for any particular customer (1 customer to many rates). However the rates are suppossed to come in pairs. For example, if a customer has a rate id of 120 then the customer should also have a corresponding custrate record with a rate_id of 200. If the customer has a rate_id of 130, then the customer should have a corresponding custrate record containing rate_id 300, and so on and so forth. How do I find the customer id with are missing the corresponding rate? Here's an example or what I'm trying to explain.customerid | name1 | fred 2 | tom3 | eric 4 | fredcustratecust_id | rate_id1 | 1201 | 2002 | 1302 | 3003 | 1204 | 130I looking for the sql statement that would return customer id of 3 and 4, since those are the only 2 records that don't have a corresponding rate. I have hunch that it requires a intra table join, but maybe i'm totally wrong. Can anyone help me please? I would greatly appreciate it!
This is a very complex query and i have tried everything with no sucess.
I'm having 3 Tables,
Orders which is having fields like CustomerID, ManufactureID, MerchID :- These all ID Fields (around 6) are foreign key of Contacts and Address Tables.
Address Table is having AddrID(Primary Key), ShortName
Contacts is having ContID (Primary Key), AddrID (Foreign Key), PersonName
I want to retreieve info in a single query which can return a single row with following columns :-
OrderNo, CustomerName, ManufactureName, MerchName etc. (all 6 columns) by joining these 3 tables
If i want to do another join with this select join query, how would I do this I tried many different way, but keep failing or not getting the right answer.
I want to Inner Join tbSucess with the query below. Means that only return the result if the history does exists in tbSucess.
And
In a seperate select query. I, I want to get only the records which are not found in tbSuccess . So how would I join those two.
Select r.History, LastName, FirstName, Convert(varchar(10), Pay, 101) as Pay, from #rpt r inner join #history h on r.History = h.History order by r.History, pay
When i tried to install the beta 3 above I encounter the following problems ;- TITLE: Microsoft SQL Server 2005 Beta 3 Setup---------------------------------------- Setup configuration check cannot be executed due to WMI configuration on the computer D:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBinnetwcls.mof. For details, see the Sqlrunxx.log file or call Microsoft Product Support. A seach in the net has the followings help link For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&ProdVer=9.00.852&EvtSrc=setup.rll&EvtID=29535&EvtType=sqlca%5Csqlmofca.cpp@Do_sqlMofcomp@Do_sqlMofcomp@x8007735f Can this version coexist with VS2005 beta 2 because before i can install visual studio 2005 beta 2 I need to uninstall the dot net framework 2.0 beta which come together with the beta 3 sql 2005 installation. Hey I link this editor, Where can I get this beautiful forum message editor ?.
Hi. I am working on a procedure which can filter data through three tables. First Table is User --------------------------- UserName UserID ---------------------------
Second Table is Customer --------------------------- UserID Cust_Site_Int_ID ---------------------------
Third Table is l Details --------------------------------------------------------------- Cust_Site_Int_ID Created_Date Status ----------------------------------------------------------------
I want to create a stored procedure which can filter through these tables. I will have four input fields in my application to accept parameters. The four parameters will be UserName, two date fields which specifies a range of dates and status. I want the filter to work like this, if only one parameter is provided it will use only that parameter if additional parameter is given it will use the AND logic.
I tried to do a Proc but it is not working any way here it is. So you will get a better idea of what I am trying to achieve.
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go
-- ============================================= ALTER PROCEDURE [dbo].[FilterServiceTickets] -- Add the parameters for the stored procedure here @userName varchar(20)= NULL, @startDate datetime =NULL , @endDate datetime = NULL, @status int = NULL AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON;
-- Insert statements for procedure here SELECT SERVICE_TICKET.SERVICE_TICKET_CODE, SERVICE_TICKET.PROBLEM_REPORTED, SERVICE_TICKET.CONTACT_NUMBER, SERVICE_TICKET.STATUS FROM aspnet_Users INNER JOIN BuildingAddress ON aspnet_Users.UserId = BuildingAddress.UserID INNER JOIN SERVICE_TICKET ON BuildingAddress.Customer_Site_Int_ID = SERVICE_TICKET.CUST_SITE_INT_ID WHERE ((aspnet_Users.UserName = @userName)OR (@userName=NULL)) AND ((SERVICE_TICKET.STATUS = @status) OR (status=NULL)) AND ((SERVICE_TICKET.CREATED_DATE >=@startDate AND SERVICE_TICKET.CREATED_DATE <=@endDate ) OR (@startDate=NULL)OR (@endDate=NULL)OR(@startDate=NULL AND @endDate=NULL)) END
Hi guys, I'm still new around here and still a noob for sql. Can you give me some example for some joins from the easy ones to the most complex and all of it kinds, I heard that there's a lot of different kind of join in sql. You can give me some link or maybe some code examples for me, I appreciate all kinds of help . Thanks for all your help. Regards.
I have a couple tables that I am exporting data from.
I have one table (call it TABLE1) that contains abbreviations instead of actual words.
For example instead of having the full word "New York City", the column would just contain "NYC".
In another table (call it TABLE2) it has all the abbreviations and the actual words.
So in TABLE2 one column name is FieldName, another Abbreviation and another is Value.
So on a web site, to display that actual name I do something like this
Code:
SELECT CityBoxlabel AS City FROM TABLE1 INNER JOIN TABLE 2 AS CityBox ON ISNULL(TABLE1.City, 'NYC') = CityBox.[Value] WHERE CityBox.FieldName = 'City'
This is working great except that some of these columns contain more than one abbreviation such as "NYC,WDC" which would stand for "New York City" and "Washington DC" The items that have more than one abbreviation are not being pulled across because my query is looking for an "NYC,WDC" in TABLE2 to INNER JOIN on but it won't be in there. But "NYC" and "WDC" by themselves are in there.
I tried messing with the INNER JOIN statement by saying something like TABLE2 AS CityBox ON ISNULL(TABLE1.City, 'NYC') IN CityBox.[Value] INNER JOIN
But it wasn't allowing that. I can write a program to do this, but I would rather keep it in T-SQL.
Hope this wasn't too confusing! Any help is greatly appreciated!!
hi thereanyone had an idea to join following 2 queries to 1????----- QUERY 1 ---------------------------------------------SELECT TMS_CaseF_2.Name AS TCDomain_0,TMS_CaseF_3.Name AS TCDomain_1,TMS.CaseF.Name AS TCFolder_2,TMS_CaseF_1.Name AS TCFolder_3,TMS.TestCase.Name AS TCName_4,TMS_TestCase_1.Name AS TCName_5,TMS.LogFolder.Name AS PlannedLogFolder_6,TMS.Log.Name AS PlannedLog_7,TMS.CaseResult.RecordedCaseName AS TCRecordedName_8,TMS.TestPlan.Name AS Plan_9FROM((((((((((TMS.Build INNER JOIN TMS.LogFolder ON TMS.Build.UID =TMS.LogFolder.Build)INNER JOIN TMS.Log ON TMS.LogFolder.UID = TMS.Log.LogFolder)INNER JOIN TMS.CaseResult ON TMS.Log.UID = TMS.CaseResult.Log)INNER JOIN TMS.TestCase ON TMS.CaseResult.TestCase =TMS.TestCase.UID)LEFT JOIN TMS.CaseF ON TMS.TestCase.Parent = TMS.CaseF.UID)LEFT JOIN TMS.TestCase AS TMS_TestCase_1 ON TMS.TestCase.Parent =TMS_TestCase_1.UID)LEFT JOIN TMS.CaseF AS TMS_CaseF_1 ON TMS_TestCase_1.Parent =TMS_CaseF_1.UID)LEFT JOIN TMS.CaseF AS TMS_CaseF_2 ON TMS_CaseF_1.Parent =TMS_CaseF_2.UID)LEFT JOIN TMS.CaseF AS TMS_CaseF_3 ON TMS.CaseF.Parent =TMS_CaseF_3.UID)INNER JOIN TMS.TestPlan ON TMS.TestCase.TestPlan = TMS.TestPlan.UID)WHERE (((TMS.LogFolder.Name) Like 'TR1%')AND ((TMS.Build.Name)='Planning_VD10A'))ORDER BY TMS.CaseF.Name,TMS_CaseF_1.Name,TMS.TestCase.Name,TMS_TestCase_1.Name;------------------------------------------------------------------ QUERY 2 ---------------------------------------------SELECT TMS.CaseResult.RecordedCaseNameFROM ((TMS.Build INNER JOIN TMS.LogFolder ON TMS.Build.UID =TMS.LogFolder.Build)INNER JOIN TMS.Log ON TMS.LogFolder.UID = TMS.Log.LogFolder)INNER JOIN TMS.CaseResult ON TMS.Log.UID = TMS.CaseResult.LogWHERE (((TMS.LogFolder.Name) Like 'VD%')AND ((TMS.Build.Name)='VD10A IT_APP'));
I am trying to join Table A to Table B using the below log . Table A should have one unique mathincg record from Table B
option 1. Using registration_key and discharge_dt , looking for exact matching date( end_dt) in table B , if there is more than one record that matches then select lowest ID
option 2.if there is no record that matches option1 then, serch for the previous record with end_dt in table A less than end_dt table B. if there is more than one record then select lowest ID
option 3. if there is no record option 2 then search the next record that matches .. discharge_dt greater than end_Dt , if there is more than one record then select lowest Id
so basically, I am looking for an exact matching date in the same registration_key .. if the exact dt doesn't exist looking for the previous record and get the most closer dt and if there is no prvious record than look for next record,.
so the output should look like
Table B Registration_key ID end_dt discharge_dt value
This is one of sql server 2005 's users. I put filter for one of my merge replicate articles .But it dosent work correctly .plaese help me to set my article correctly.
Select SEC.EntryQty from Item.StockEntryChild SEC where SEC.CEntryNo = ( select SEM.EntryNumber from item.StockEntryMaster SEM where SEC.CBranchID=SEM.BranchID and SEC.CEntryNo=SEM.EntryNumber and SEM.MasterID=1 and SEM.isStockIn=1 )
I have a very confusing/complicated query that I am trying to run and getting not the results that i want.
Essentially I have three tables (t1, t2, t3) and I want to select data from two of them, but there are conditions on the data where I need fields to match across pairs of tables. When I run my select query I am getting far too many records - it's giving me all possible combinations, instead of the proper combinations that I want.
Select t1.*, t3.field2, t3.field3 FROM, t1, t2, t3WHERE t2.field4=t3.field4 AND t1.field5=x AND t1.field6=t2.field6
I suspect there is plenty wrong with this query - where should I start correcting it?
I'm learning replication (snapshot for now) and was trying filtering & got strange results.
SQL 2K sp2
Publisher: Table1
FieldA FieldB FieldC
Subscriber: Table1
FieldA FieldB FieldC
But now, I decide after the fact to filter FieldC. The subscriber Table still has 3 fields, but the publisher data from Field 1 + 2 gets shifted across all 3 fields at the subscriber.
If I manually drop the table at the subscriber, then next time the job runs, it recreates the table with just 2 fields and looks good.
Is there some way to set replication so that it will drop & re-create the subscriber table automatically if the filter changes ? Or am I missing something else in my understanding ?
Under "Default Table Article Properties - Snapshot" the option "DROP the existing table & recreate it" is checked. When does that apply ?? Just when first set up ?
Here's what I'm trying to do (Maybe there's a better way)
I'm using Transaction Replication and a pull subscription to get all the transactions from the ORDERS table within the last year from Server_A to Server_B. I filter the rows "WHERE (ORDR_DATE > (GETDATE()) - 365)"
That works fine, BUT, the old rows in the subscriber's ORDERS table do not get deleted, so I have all the records for the last year, plus the older records that I don't want any more. Do I need another step some where that does a "Delete WHERE (ORDR_DATE < (GETDATE()) - 365)" But then I have to maintain my date logic in more than 1 place if I ever want to change it.
Any suggestions, thoughts, improvements will be appreciated .... Thanks a lot
I understand that it is possible to set filters dynamically using functions 1) SUSER_SNAME() 2) and HOST_NAME(). SUSER_SNAME() returns the login credentials used in the subscritption. HOST_NAME() returns the host machine and can be overloaded with buisiness information.
My application should work as below; 1) User enters the login credentials. 2) Some information as the User name passed to server and if the user name is valid , the rows related to this particular user get downloaded to device.
A new user is added directly in the Users table in master database.
My questions are : 1) If I have 3000 users , should I create 3000 subscriptions with 3000 HOSTName or Login credential information to differentiate btween users? 2) If yes , other than using the wizard is there any scripts available to create large number of subscription? 3) If add subscription programatically , should I re-initialise subscription for each new user which is assigned with a diferrent host name value?
The queary I need is to display the result in this form. must be like this
docIDdocName Avaragerating 1aaa3 2bbb3 3ccc0
NOTE : For getting the average I used this queary “SELECT SUM(rating) As RatingSum, COUNT(*) As RatingCount FROM tbl_Rating WHERE tbl_rating.docID = tbl_documents.docID”
I had this (what seems to be a) simple question asked today and I'm afraid I didn't like my answer. Does anyone know the proper answer to this one:
Any ideas on how I can constrain a lookup or merge join based on the dimension row's effective and expired dates so three criteria are needed as follows: 1. DataStagingSource.ModifyDate < DataWarehouseDimension.RowExpiredDate AND 2. DataStagingSource.ModifyDate >= DataWarehouseDimension.RowEffectiveDate AND 3. DataStagingSource.NaturalKey = DataWarehouseDimension.NaturalKey
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.Â
We have a table in an SQL Server 2012 database that stores tree-like structures. Simplified for the purpose of my question, it has the following format:
Id int identity, ParentId int, GroupId int
Each record of the table represents an object identified by Id. An object may or may not have a parent in the same table, such that object.ParentId = parentObject.Id. A root object has ParentId = NULL. There are multiple root objects, so the table in fact stores multiple trees. What’s important is that the tree depth is not fixed, i.e. theoretically there can be any number of ancestor generations for an object. GroupId is a property of a root object; in theory none of the children of a root object has to have GroupId <> NULL; it can be assumed that any child has the same GroupId value as its root object.
A sample table having two roots (one grandparent and one parent), one non-root parent/child and 4 child roots:
The table is not normalised, i.e. there’s no separate {root_object : group} table. However I don’t think normalising the table would solve the problem.
Now the problem. We need to set up merge replication from the table above (Master table) to the table of the same format in another DB. We need to replicate only those rows of the Master table that have a certain fixed GroupId value, e.g. 200 in the example above. If we ensure that GroupId in all descendant objects of a root object has the same value in the table as the root object itself that would be trivial. The table would look like this:
However out of performance considerations, we would like to avoid if possible filling GroupId for the descendant objects, because as it must be clear from the above, GroupId for a descendant object is quite easily deducible via a stored procedure or UDF (just need to go up the tree until ParentId = NULL). The problem is, I don’t know how to achieve this in a merge replication filter: it would only allow WHERE conditions and joins. I’ve have not had much luck with joins for merge replication in general, but here we have more complex algorithm, because the number of tree levels can be different for every object. And merge replication would not allow using UDF…
Our current application which uses SQL 2000/CE uses a single Merge publication to populate numerous "read only" tables on the mobile device, and create the schema for a "transactions" table, which will be filled by the mobile device during work, then merged at sync.
Now, the master "transactions" table at the publisher has millions of rows, and the mobile device does not need any of them... so currently we have it "filtering" by a always false clause, so that none of the data is pushed to the client.
The problem with this is that we cannot archive any of the records in the transaction table, as doing so (say, removing 200k rows) would result in the mobile devices (of which there are about 15,000 active in the field) to attempt to reconcile each of those 200k rows when it is next synced, which takes way too long.
Now, what we would like to do is upgrade to SQL 2005/CE 2005, if the new features will allow us a PULL ONLY table in some way? I cannot find how to do this via the wizard, but am sure I am missing something. At least I hope so.
All,I have a perplexing problem that I hope someone can help me with.I have the following table struct:Permission-----------------PermissionIdPermissionDescriptionUserPermission-----------------PermissionIdUserIdActiveI am attempting to retrieve all records from the permission tablewhether there is a match on UserPermission.PermissionId or not.Therefore I implemented this query, which does not produce the resultsthat I expect:SELECT p.Permission,up.ActiveFROM Permission pLEFT OUTER JOIN UserPermission upONp.[Id] = up.PermissionIdWHERE up.UserId = 3However, if I exec this query, it works as it is supposed to:SELECTp.Permission,up.ActiveFROM Permission p, UserPermission upWHEREp.[Id] *= up.PermissionId AND up.UserId = 3In the first query, only the records that match on "permissionId" arereturned, in the second all records are returned from the Left tableand those records that do not have matching columns are set to null, asit should be. My question is, what have I done wrong here?I am running MS-SQLServer 2000
I have this queryselectcreated_date,tyg_aging_due_dates.object_type,tyg_aging_due_dates.due_datefrom#tyg_aging_service_metricsright jointyg_aging_due_dateson tyg_aging_due_dates.due_date =#tyg_aging_service_metrics.due_dateand tyg_aging_due_dates.object_type =#tyg_aging_service_metrics.object_typeorder by PS, tyg_aging_due_dates.due_dateBasically the table tyg_aging_due_dates have this for dataobject_typedue_date-------------------report1/1/2005report1/1/2006report1/1/2007image2/1/2006image2/4/2006The temporary table retuns something similarcreated_dateobject_typedue_date-------------------------------6/1/2006report1/1/20056/10/2006image2/4/2006So basically I want to join the two tables and for the due date's thatare missing from my temporary table, I want to display NULL (thus theright join).So my query would returncreated_dateobject_typedue_date-------------------------------6/1/2006report1/1/2005NULLreport1/1/2006NULLreport1/1/2007NULLimage2/1/20066/10/2006image2/4/2006The date fields are of smalldatetime. Object type is a varchar(15).When I run my query though, I get only 2 rows back. No matter if Iswitch the right join to a left, full, inner, whatever. I still onlyget 2 rows back. Is this a known issue?I am running Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft CorporationStandard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)