• thanks for reply.. it is very use full.

    I will explain you the actual problem what i m facing.

    Every monday i have to prepare the database Uptime & growth Report.

    i have written a script for getting report.

    Till now i am doing this task manually by logging into the each server & executing the script.

    Now we need to automate this task.

    I have saved the script on the desktop of my Box.

    File name is : Db_uptime.sql

    From my system i want run the below script:

    :connect server1

    :r " script file path( c:\Db_uptime.sql)"

    go

    :connect server2

    :r " script file "

    go

    .

    .

    .

    .

    .

    .

    .

    .

    :connect Server n

    :r " script file "

    By enabling SQLCMD in SSMS, i can able to run this script & i am getting the Output.

    But I want to automate the above (:connect ) script.

    The problem is how can i enable the SQLCMD at runtime??????????

    i.e,. before running the job it need to be enabled.

    I think you understand what i am saying......