Undocumented syntax?!

  • Hi all,

    out of curiosity I had look at a stored procedure named sp_addumpdevice. This procedure is suggested for defining device to make backups to. The part that is 'interesting' is the line

    EXEC %%Device().NewDevice(...)

    I haven't found any syntax description for the "%%" or for the function/object/method (???) after that.

    A little further research showed that the "%%" syntax element can be found in many procedures.

    Can someone explain it?

    Thanks!

    BEGIN TRANSACTION

    -- Make sure that a device with @logicalname doesn't already exist.

    -- Always turn on the dump status bit, ignore @skip_tape (not in use)

    EXEC %%Device().NewDevice(Name = @logicalname, PhysicalName = @physicalname,

    Type = @type_enum, Size = 0)

    if @@error <> 0 -- duplicate logical name

    begin

    ROLLBACK TRANSACTION

    raiserror(15026,-1,-1,@logicalname)

    return (1)

    end

  • I haven't seen that before and it's no used in normal querying. My guess is it's something used internally by SQL Server.

    Also, I never use dump devices. It's held over from Sybase/early SQL server.

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

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