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 2008 Forums
 Transact-SQL (2008)
 Need help troubleshooting sproc

Author  Topic 

RandyHJ
Starting Member

5 Posts

Posted - 2012-01-21 : 23:48:46
I'm troubleshooting a stored procedure that uses a SELECT DISTINCT statement and includes data from three tables that are left joined. The WHERE clause looks for a record based on an ID number that is not a primary key or foreign key and a date range.

My problem is that when I use one particular ID number I get duplicate rows that only differ in one column. Every other ID number brings back only one row of data. I'm racking my brain on this one. Anyone have any ideas?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-01-22 : 04:44:55
Show us some sample data, please.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -