How can we help you today? How can we help you today?

Cross database insert breaks auto-complete

insert into [AnotherDB].dbo.summarytable
select * from SaleOrder so inner join SaleOrderDetail sod on ...

at this point SQLPrompt is unable to generate suggestions for the join condition, nor is it able to generate suggestions for the select fields.


cross database selects work just fine:
select * from [AnotherDB].dbo.summarytable s inner join SaleOrder so on ...

This generates a s.SaleOrderID = so.SaleOrderID suggestion.

SQL Prompt 6.1.0.72
StormRider
0

Comments

4 comments

  • Anu D
    Thanks for your post. We have logged a support ticket for you and I will email you shortly.
    Anu D
    0
  • KevinGreiner
    I'm seeing a similar problem with a cross database SELECT. Expanding "SELECT a.*" with tab produces a list of fields that are completely unrelated to any joined tables. Expanding "SELECT *" works as expected. I did "refresh suggestion" to make sure I wasn't use a stale cache.

    Object names are modified....
    SELECT   Ref.[AP21].[AP_DRG],
            Ref.[AP21].[AP_DRG Desc],
            Ref.[AP21].AP_MSC,
            Ref.[AP21].[AP_MDC DESC],
            Ref.[AP21].ID
    FROM    B.[qCalc] a
    LEFT JOIN Dev_SafeCopy.B.[qCalc] b
        ON a.[ICODE] = b.[ICODE]
            AND a.[CPAY] = b.[CPAY]
            AND a.[MAJOR] = b.[MAJOR]
    
    KevinGreiner
    0
  • Aaron L
    Hi Kevin,
    Could you tell me if this build fixes the issue for you http://download.red-gate.com/EAP/SQLPro ... 1.0.82.exe ?

    Thanks!
    Aaron L
    0
  • KevinGreiner
    Yes, this build appears to fix the problem. Thanks so much!
    KevinGreiner
    0

Add comment

Please sign in to leave a comment.