A View by another name would smell as sweet...

  • This is one I haven't seen before.  My compadre created a view named dbo.vw_AlaskaExtract.  But if you go into the object browser and tell it to script it into a new window, here's what you get:

    if exists (select * from sysobjects where id = object_id('dbo.vw_AlaskaExtract') and sysstat & 0xf = 2)

     drop view dbo.vw_AlaskaExtract

    GO

    CREATE VIEW dbo.Alaska_Extract

    AS

    SELECT     this, that, theOtherThing FROM         dbo.CaseCounty CC INNER JOIN

                          dbo.EDDIntercepts EI ON CC.RowIdent = EI.CCLink INNER JOIN

                          dbo.FTBIntercepts FI ON CC.RowIdent = FI.CCLink INNER JOIN

                          dbo.OCSEIntercepts OI ON CC.RowIdent = OI.CCLink AND FI.ProcessYear = OI.ProcessYear INNER JOIN

                          dbo.CasePerson CP ON CC.SSN = CP.Ssn

    WHERE     foo = bar

    It shows as dbo.vw_AlaskaExtract in the object browser, but it wants to create dbo.Alaska_Extract.  Any ideas?  Thanks, Dave

    There is no "i" in team, but idiot has two.
  • I've seen it with to procedure scripts also (when scripted in EM). Happens when an object has been renamed (presumably a bug with EM's caching of object names ?)

    Manually modify the CREATE to the correct name, then re-run it in the DB you're scripting out of. Next generation of the script should be correct.

     

  • Yep, that's what we did.  Doesn't seem to be a problem when you script them with the object browser in QA, though...

    There is no "i" in team, but idiot has two.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply