You should pass the date time to the stored procedure in ISO format YYYYMMDD HH:MM:SSSince you have pass in '2009-01-07', SQL Server treat it as ISO YYYY-MM-DD so your datetime variable is actually stored with date January 1, 2009. When you use convert(datetime, '2009-01-07', 103) you are telling converting the datetime using style 103 which is a format dd/mm/yyyy and it is converted to 1 July 2009 (Why ? i don't know. Ask Microsoft).So when you assign the datetime variable to your column, it will be January 1, 2009.To avoid confusion, pass the date in in ISO format YYYYMMDD and it will not go wrong.run this and seedeclare @var1 datetime, @var2 datetimeselect @var1 = '2009-01-07', @var2 = '2009-07-01'select @var1, style103 = convert(varchar(50), @var1, 103), style106 = convert(varchar(50), @var1, 106) union allselect @var2, style103 = convert(varchar(50), @var2, 103), style106 = convert(varchar(50), @var2, 106)
KH[spoiler]Time is always against us[/spoiler]