If I run the following query:
if cast(GETDATE() as time) > '12:00:00'
select GETDATE() into #Test
select GETDATE()-0.5 into #Test;
I get the following error message:
Msg 2714, Level 16, State 1, Line 4
There is already an object named '#Test' in the database.
Why is this so? The two cases of the if statement is mutually exclusive, so there is no way that both will be created. Does anyone know why this statement won't run? To me this seems like a bug.
Ole Kristian Velstadbråten Bangås - Virinco
Concatenating Row Values in Transact-SQL[/url]