declare @str_datetime varchar(50)
set @str_datetime=\'30-04-2012 19:01:45\' -- 30th April 2012
declare @dt_datetime datetime
select @dt_datetime=@str_datetime
By default, the date format for SQL server is in U.S. date format MM/DD/YY, unless a localized version of SQL Server has been installed. This setting is fine for cases when an application that requires this functionality is deployed in a manner guaranteeing that dates are used and inserted in the same format across all platforms and locations where the application is used.
However, in some cases the date must be in a DD/MM/YY format because many countries/regions use this format rather than the U.S. default of MM/DD/YY. This is especially an issue for international applications that are distributed all over the world.
Source
So you what you need to do is set date format before hand as so:
SET DATEFORMAT dmy
GO
And then your query will work.