SQL Server Performance

XP_CMDSHell syntax question for Telnet

Discussion in 'General DBA Questions' started by jaybee, Aug 16, 2007.

  1. jaybee New Member

    Hi all,
    I've got to run a telnet command as follows,
    exec xp_cmdshell
    totelnet aukepper.dc-dublin.de 1521
    telnet aukeppfr.dc-dublin.de 1521
    I've managed to put together,
    exec xp_cmdshell 'telnet aukebper.dc-dublin.de', 1521
    But the error message says,
    Msg 50001, Level 1, State 50001
    Error executing extended stored procedure: Invalid Parameter Type

    Anyone know what I'm doing wrong? Thanks,
  2. satya Moderator

    Better to use master..xp_cmdshell
  3. jaybee New Member

    Thanks Satya. I have another CMDshell question:
    I have a backup file called trm.bak in a directory called M:REPLDATACentral, I'd like to use XP_cmdshell to move it to
    How would I construct the CMDshell command?

  4. satya Moderator

    declare @cmd varchar(255)
    select @cmd='move \ukwap091ackups$ rm.bak \newsharepath'
    exec master..xp_cmdshell @cmd
    Ensure the relevant login has privileges to access/move the file on the above shares.

Share This Page