SQLCMD

  • Hi,

    I want collect the details from the all the sql server database which is exist in the same domain and all the output needs to be stored at any one of the sql server tables.this my requirement.

    I knew that we can make output as file and we can read it from that file through sqlcmd utility. But what i want know is , Is there any way for storing the output of the sqlcmd into the database tables ?

    If no then can you suggest me any better idea for this requirement ?

    Thanks in Advance.

  • You have to use a custom query and (or) save it in a file. You may use the -I switch or -Q switch to call that query as an input to SQLCMD.

    Details of SQLCMD utility are here.

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • What details are you trying to collect exactly?

    You say that you're going to collect it on every database on the domain, if you're going to do this I would suggest creating an SSIS package to loop through all the servers, you can then set it to write the results into a database of your choosing.

    I do something similar to loop through all of my production instances to check for failed jobs, backup status's etc.

    To make sure you have the full list of every SQL Server instance on the domain I would recommend that you download the Microsoft Application planning Toolkit. I have written a blog entry about it here: http://sql.richarddouglas.co.uk/archive/2010/07/forget-satnav-use-maps.html

    Rich

    Hope this helps,
    Rich

    [p]
    [/p]

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

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