declare @test as DATETIME
set @test='21/03/2014'
print @test
select @test
set @test=21/03/2014
print @test
select @test
set @test=21-03-2014
print @test
select @test
set @test=03/21/2014
print @test
select @test
set @test=2014/21/03
print @test
select @test
set @test=2014/03/21
print @test
select @test
Run Code Online (Sandbox Code Playgroud)
这段代码提供了错误的输出,所以plz告诉我在SQLServer 2008中分配datetime变量的代码