netripper

netripper

Feb 11th, 2010
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.99 KB | None | 0 0
  1. -- Testcase to demonstrate an "Invalid bookmark." problem on SQL Compact 3.5 SP1
  2. --
  3. -- This can be solved by using nvarchar(4000) instead of ntext. However, that is not a feasible solution in my case. I'd rather not
  4. -- use BLOBs either.
  5. --
  6. DROP TABLE Foo
  7. GO
  8. DROP TABLE Bar
  9. GO
  10. CREATE TABLE Foo (
  11.       Id INT NOT NULL,
  12.       MyText ntext NULL
  13. )
  14. GO
  15. CREATE TABLE Bar (
  16.       Id INT NOT NULL,
  17.       MyText ntext NULL
  18. )
  19. GO
  20. INSERT INTO Bar VALUES (1, 'MyText')
  21. GO
  22. SELECT Dora.MyText
  23.   FROM (
  24.             SELECT Id, MyText
  25.               FROM Foo
  26.  
  27.              UNION ALL
  28.  
  29.             SELECT Id, MyText
  30.               FROM Bar
  31.          ) AS Dora
  32. GO
  33.  
  34. -- Result:
  35. -- (1 row(s) affected)
  36. -- Major Error 0x80040E0E, Minor Error 0
  37. -- > SELECT Dora.MyText
  38. --   FROM (
  39. --               SELECT Id, MyText
  40. --                 FROM Foo
  41. --
  42. --                UNION ALL
  43. --
  44. --               SELECT Id, MyText
  45. --                 FROM Bar
  46. --           ) AS Dora
  47. -- Invalid bookmark.
  48.  
  49.  
Add Comment
Please, Sign In to add comment