Hello! I am almost done with my SSIS Package. However I am stumbling on the following:
I am important from an Excel spreadsheet time dates as nvarchar(10) (I am stuck with that datatype for now) and it is being stored in my staging table. I then must convert it to a smalldatatime datatype in a Table that the application can read using a stored Proc in an OLD DB Command Component. The following is my stored proc. Please focus on the SELECT CONVERT(SMALLDATETIME, @StatDateTaxDue) statement. This is where I am trying to convert the Stored Proc input nvarchar(10) param to a smalldatetime datatype. I have been working on this since Friday. Any ideas? Thanks!!! Mike
USE [BAPropertyTax]
GO
USE [BAPropertyTax]
GO
/****** Object: StoredProcedure [dbo].[UpdateStagingTable] Script Date: 08/17/2012 17:27:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[UpdateStagingTable]
@CASEID nvarchar(255),
@County nvarchar(255),
@Address nvarchar(255),
@City nvarchar(255),
@State nvarchar(255),
@Zip nvarchar(255),
@AcquisitionDate nvarchar(255),
@Step nvarchar(255),
@StatDateTaxDue nvarchar(255)
AS
BEGIN
SET NOCOUNT ON;
update dbo.Property
set PCounty=@County,
PAddress = @Address,
PCity = @City,
PState = @State,
PZip = @Zip,
PAcquisitionDate = @AcquisitionDate,
PCurrentStep = @Step,
PStepDate = @StatDateTaxDue
where PCaseId=@CASEID
SELECT CONVERT(SMALLDATETIME, @StatDateTaxDue)
UPDATE dbo.[LineItemInfo]
SET LIStateDate = cp.[Tax Service2]
FROM dbo.[Destination - YARDI_REPORTS$] AS cp INNER JOIN
dbo.[LineItemInfo] AS mp ON mp.LIPropCaseID = cp.[CaseID]
WHERE mp.LIPropCaseId = @CASEID
UPDATE dbo.LineItemInfo
SET LIStatus = @Step,
LIStateDate = @StatDateTaxDue
WHERE LIPropCaseId = @CASEID
END
Mike Kiser