code_junkie

SQL Server 2005 error

Nov 10th, 2011
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. declare @x int
  2.  
  3. set @x = 1
  4.  
  5. if (@x = 0)
  6. begin
  7. select 1 as Value into #temptable
  8. end
  9. else
  10. begin
  11. select 2 as Value into #temptable
  12. end
  13.  
  14. select * from #temptable
  15.  
  16. drop table #temptable
  17.  
  18. SELECT field-list INTO #symbol ...
  19.  
  20. DECLARE #symbol_sessionid TABLE(field-list)
  21. INSERT INTO #symbol_sessionid SELECT field-list ...
  22.  
  23. IF OBJECT_ID('tempdb..#temptable', 'U') IS NOT NULL
  24. BEGIN
  25. DROP TABLE #temptable
  26. END
  27.  
  28. CREATE TABLE #temptable (Value INT)
  29.  
  30. declare @x int
  31.  
  32. set @x = 1
  33.  
  34. if (@x = 0)
  35. begin
  36. INSERT INTO #temptable (Value) select 1
  37. end
  38. else
  39. begin
  40. INSERT INTO #temptable (Value) select 2
  41. end
  42.  
  43. select * from #temptable
  44.  
  45. drop table #temptable
Add Comment
Please, Sign In to add comment