Options

Temporary table support in 3.6 EA

MikeyCMikeyC Posts: 249 Bronze 3
edited September 12, 2007 1:38PM in SQL Prompt Previous Versions
I'm sure I just don't know how it is supposed to work, or how to use it, but I don't see temporary table support working.

Here is an example:

SELECT DISTINCT
tdl_id,
post_date
INTO #test
FROM edic_cga_details;

SELECT * FROM #test tds;

If I put the cursor next to the * and hit TAB to expand the fields nothing happens. If I add a where clause it helps auto complete the alias (tds) but when I hit the "." it doesn't show any suggestions. (Not even a pop-up.)

Is it that 3.6 EA, just doesn't support temporary table creation with the "INTO #<table>" command?

Comments

  • Options
    Sorry, I should make it clear that this only works for CREATE TABLE not SELECT INTO. I was fairly sternly warned not to support SELECT INTO because it's "evil" due to locking issues in msdb (?)... that and the fact that we didn't have time. Apologies.
    Bart
    Bart Read
    Principal Consultant
    bartread.com Ltd
  • Options
    MikeyCMikeyC Posts: 249 Bronze 3
    Besides it causing a SP to be recompiled every time it is run, do you know why it is considered "evil"?

    Consider this a feature request to add SELECT INTO support sometime in the future. ;)
  • Options
    Bart ReadBart Read Posts: 997 Silver 1
    Well, "evil" it may be, but I've just added support for it. You should find it working as you'd like in the final 3.6 release.

    Thanks,
    Bart
    Bart Read
    Principal Consultant
    bartread.com Ltd
  • Options
    MikeyCMikeyC Posts: 249 Bronze 3
    Cool, thanks!

    And could you share what ever you have that allows you to create time? ;)

    (It must have been easier than you originally thought if it took less than a half hour to add.)
  • Options
    Bart ReadBart Read Posts: 997 Silver 1
    Well, that and it's a bit cheeky to go adding features at this stage... but all the building blocks I needed were already there, it was just a case of sticking them together properly. Our testers are going to kill me though.
    Bart Read
    Principal Consultant
    bartread.com Ltd
Sign In or Register to comment.