The Add Outlook Appointment Stored Procedure generatrix:
(Note: The generatrix is a macro that the database creates from the
definition of the table that will delete and recreate the table when it is run
in tsql. It is stored as a text file with .sql extension in the
...\MSSQL7\Binn directory. When tsql is run from the SQL Server Manager's
Tools Menu, it will open to the Binn directory and show all the .sql files for
selection.)
SET QUOTED_IDENTIFIER ON SET ANSI_NULLS ON
GO
CREATE PROCEDURE AddOLAppntEvent
@olStarttime nvarchar(40),
@olEndTime nvarchar(40),
@olSubject nvarchar(200),
@olConversation nvarchar(200),
@olContacts nvarchar(200),
@olCategories nvarchar(200),
@olLocation nvarchar(100),
@olEventAddress nvarchar(100),
@olMessageClass nvarchar(100),
@olCreated nvarchar(60),
@olCreatedBy nvarchar(50),
@olName nvarchar(50),
@olBilling nvarchar(50),
@olMileage nvarchar(50),
@olBody nvarchar(500)
AS
Declare @oStart smalldatetime
Declare @oEnd smalldatetime
Declare @oCreated smalldatetime
Set @oStart = cast( @olStarttime as smalldatetime)
Set @oEnd = cast( @olEndTime as smalldatetime)
Set @oCreated = CAST( @olCreated as datetime)
insert OLAppointments
select @oStart, @oEnd, @olSubject, @olConversation, @olContacts, @olCategories,
@olLocation, @olEventAddress, @olMessageClass, @oCreated, @olCreatedBy, @olName,
@olBilling, @olMileage, @olBody
GO
SET QUOTED_IDENTIFIER OFF SET ANSI_NULLS ON
GO

The Get Outlook Appointments Stored Procedure generatrix:
if exists (select * from sysobjects where id = object_id(N'[dbo].[GetOutLookAppntmwnts]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[GetOutLookAppntmwnts]
GO
SET QUOTED_IDENTIFIER ON SET ANSI_NULLS ON
GO
CREATE PROCEDURE GetOutLookAppntmwnts
@nMonth tinyint,
@nYear smallint
AS
select ID, Starttime, EndTime, Subject, Conversation, Contacts, Categories, Location, MessageClass, Created, CreatedBy, Name, Billing, Mileage, Body, ItemID
from OLAppointments
where datepart(yy, StartTime) = @nYear and datepart(mm, StartTime) = @nMonth
order by datepart(dd, StartTime)
GO
SET QUOTED_IDENTIFIER OFF SET ANSI_NULLS ON
GO

The Delete Outlook appointment generatrix:
if exists (select * from sysobjects where id = object_id(N'[dbo].[DeleteEvent]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[DeleteEvent]
GO
SET QUOTED_IDENTIFIER OFF SET ANSI_NULLS ON
GO
create procedure DeleteEvent
@idSchedule smallint
as
delete Schedule where idSchedule = @idSchedule
GO
SET QUOTED_IDENTIFIER OFF SET ANSI_NULLS ON
GO