 END
 ;
 
-
+-- =============================================
+-- Author:		Iago Lorenzo Salgueiro
+-- Create date: 06/29/2012
+-- Description:	Returns 1 (as bit, means true)
+-- if that alert must be checked for
+-- that user, because the user type (IsCustomer,
+-- IsProvider) and the AlertTypeID (only
+-- providers alert, only customers, both)
+-- =============================================
 CREATE FUNCTION [dbo].[fxCheckAlertAffectsUser] (
 	@UserID int,
 	@AlertID int



ALTER TABLE dbo.CalendarReccurrence
	ADD FOREIGN KEY (EventID) 
	REFERENCES CalendarEvents (Id);

ALTER TABLE dbo.CalendarReccurrence
	ADD FOREIGN KEY (Frequency) 
	REFERENCES CalendarRecurrenceFrequencyTypes (ID);




tpur.Rating3
;

CREATE PROCEDURE [dbo].[SearchPositions]

/*
Highlight and execute the following statement to drop the procedure
before executing the create statement.

DROP PROCEDURE dbo.SearchPositions;

CREATE PROCEDURE [dbo].[SearchPositions]

*/

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
	-- Add the parameters for the stored procedure here
	@SearchTerm varchar(150),
	@SearchDistance int = 30,
	@origLat DECIMAL(12, 9) = 37.788479,
	@origLong DECIMAL(12, 9) = -122.40297199999998,
	@orig geography, 
	@LanguageID int = 1,
	@CountryID int = 1

