The TrackingData table is inside a database named Tracking. The stored procedure is being run inside the same database. I get data back with the query, but not with the SP.
SELECT *
FROM
dbo.TrackingData
LEFT OUTER JOIN SSMain.dbo.EmailCampaignTracking ON (dbo.TrackingData.emailCampaginTrackingID = SShMain.dbo.EmailCampaignTracking.emailCampaignTrackingID)
LEFT OUTER JOIN SSMain.dbo.EmailCampaigns ON (SSMain.dbo.EmailCampaignTracking.emailCampaignID = SSMain.dbo.EmailCampaigns.emailCampaignID)
LEFT OUTER JOIN SpinStitchMain.dbo.EmailListAddresses ON (SSMain.dbo.EmailCampaignTracking.emailAddressID = SSMain.dbo.EmailListAddresses.emailAddressID)
WHERE
dbo.TrackingData.lattitude = 33.8322 AND
dbo.TrackingData.longitude = -78.6491 and
dbo.TrackingData.projectID = 131
CREATE PROCEDURE dbo.sel_Track_HitsByLatLong(
@latitude decimal(18,15),
@longitude decimal(18,15),
@projectID int
)
AS
BEGIN
SELECT *
FROM
dbo.TrackingData
LEFT OUTER JOIN SSMain.dbo.EmailCampaignTracking ON (dbo.TrackingData.emailCampaginTrackingID = SSMain.dbo.EmailCampaignTracking.emailCampaignTrackingID)
LEFT OUTER JOIN SSMain.dbo.EmailCampaigns ON (SSMain.dbo.EmailCampaignTracking.emailCampaignID = SSMain.dbo.EmailCampaigns.emailCampaignID)
LEFT OUTER JOIN SSMain.dbo.EmailListAddresses ON (SSMain.dbo.EmailCampaignTracking.emailAddressID = SSMain.dbo.EmailListAddresses.emailAddressID)
WHERE
dbo.TrackingData.lattitude = @latitude AND
dbo.TrackingData.longitude = @longitude and
dbo.TrackingData.projectID = @projectID
END
Edit:
Turns out the numbers are getting zeros added to the end of them: 33.832200000000000
This has never happened befor an dnot sure what has changed. They get added when the prcedure is run.