SQLDMO

  • how can I generate script for selected rows from a table using SQLDMO?

    please help.

  • Check out Data Transformation Services (DTS) in your Enterprise manager.

    This will be more simple and intuitive.

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Agree with alzdba

  • if you want to return query results, here's a vbscript sample.

     

    'strict

    option explicit

    'dims

    dim objServer, objDatabase, objQueryResults, strSQL, i

    'vars

    strSQL = "select distinct name from sysdtspackages"

    'connect to server

    set objServer = createobject("sqldmo.sqlserver")

    objserver.loginsecure = true

    objserver.connect "."

     

    'execute query

    set objQueryResults = objServer("msdb").ExecuteWithResults(strSQL)

    'display results

    for i = 1 to objQueryResults.Rows

     wscript.echo objQueryResults.GetColumnString(i,1)

    Next

    'clean up

    set objQueryResults = nothing

    objServer.Disconnect

    set objServer = nothing

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

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