Home Forums SQL Server 7,2000 General The object name ... contains more than the maximum number of prefixes. The maximum is 2. RE: The object name ... contains more than the maximum number of prefixes. The maximum is 2.

  • i got this error when i tried to call a function from a linked server in my select query. here's what caused my problem:

    set @myquery =

    'select

    PurchClaims =' + @database + '.dbo.fn_PurchClaimAmount(bb.Pinvno,b.Blockno),

    from #sp_agingAgingCopy_Blocks as bb

    INNER JOIN ' + @database + '.dbo.Blocks b on bb.blockno = b.blockno

    so in other words it seems that while you can select from a linked server table, you cannot call functions from that linked server within the select.

    in this case @database was "[192.168.0.2\dev].bs_bkup_sa_global_jan"

    the alternative i had to use to still get the data was to add another column, "Purchclaims" to my #sp_agingAgingCopy_Blocks table, then i had to create a cursor or query before this select to insert those values.