What are the challenges you face when working across database platforms? Take the survey
Options

Temp table and DATEDIFF

KennethKenneth Posts: 5
edited November 21, 2006 9:24AM in SQL Refactor Previous Versions
This give me errors when I use qualify object names.

CREATE TABLE #tblTemp

CREATE TABLE dbo.#tblTemp

datediff(d

datediff(dd

/Kenneth

Comments

  • Options
    Hi,

    I've noted the DATEDIFF problem in our bug-tracking system: it seems that SQL Refactor is incorrectly recognising the first parameter of the DATEDIFF and DATEADD function as being columns rather than being keywords.

    For temporary tables: the current version of refactor does not look at CREATE statements for objects that might already be in the database. This is because for permanent objects it is not always clear what is the correct result when the creation statement contradicts what is already in the database or when the creation statement is part of a conditional block, so the behaviour is to only look at objects that are already in the database on the principle that it has the authorative definition.

    These problems don't really apply to local temporary tables, and it's unreasonable for the tool to expect these to be created in the database at the time of a refactoring. I'll look into making these work similarly to how table variables do now.

    Andrew.
    Andrew Hunter
    Software Developer
    Red Gate Software Ltd.
Sign In or Register to comment.