How to access SMO in sql server 2000

  • Hi all,

    I added the SMO reference in .net 2.0 in one machine in which sql server 2005 is installed. I used the SMO object to create dynamic db. When i run the in the machines which having sql server 2005 it works well. But if that same code is executed in other machines which having sql server 2000 it won't work. So, I copied the SMO dll for sql server 2005 to the machine in which sql server 2000 is installed. But still, it generates the following error :

    [font="Arial Black"]Could not load the object Microsoft.SQL-Server.BatchParser[/font]

    I don't know how to access the SMO in sql server 2000. Please help me to rectify this problem. Thanks.

  • Hello,

    Have you installed the Smo dll on the machines where you are developping and where you are executing your program accessing to your Sql Server 2000 ?

    Have a nice day

  • Best is to run your code on a box where you have a sql2005 client installed.

    If you need to run the code locally on a box, best is you install sqlsmo from the (MS) Feature Pack for Microsoft SQL Server 2005 - November 2005:

    http://www.microsoft.com/downloads/details.aspx?familyid=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&displaylang=en

    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

  • Hello,

    Please,could you have a look on this link ?

    http://blogs.msdn.com/gertd/archive/2007/02/19/sql-server-2005-sp2.aspx

    Have a nice day

  • sridevi_kj (10/21/2008)


    Hi all,

    I added the SMO reference in .net 2.0 in one machine in which sql server 2005 is installed. I used the SMO object to create dynamic db. When i run the in the machines which having sql server 2005 it works well. But if that same code is executed in other machines which having sql server 2000 it won't work. So, I copied the SMO dll for sql server 2005 to the machine in which sql server 2000 is installed. But still, it generates the following error :

    [font="Arial Black"]Could not load the object Microsoft.SQL-Server.BatchParser[/font]

    I don't know how to access the SMO in sql server 2000. Please help me to rectify this problem. Thanks.

    to interract with sql2000 you need to use DMO not SMO, SMO is only for sql2005 onwards

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Perry Whittle (1/22/2009)


    to interract with sql2000 you need to use DMO not SMO, SMO is only for sql2005 onwards

    Not true. SMO works just fine with sql2000, I used to use it that way all the time. In fact, anybody who use's SSMS on a SQL2000 server is doing this also.

    DMO on the other hand, will not work on SQL2005 AFAIK, just as EM will not work on a SQL2005 server.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • IMO just copying SMO.dll will not do the trick you want.

    Keep in mind you can connect to non-local servers/instances as well, so you should be able to perform your actions from your sql2005(client) box.

    If you need it to be executed on another box, the links are provided (above) for the softwares you need to install as a prerequisit.

    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

Viewing 7 posts - 1 through 6 (of 6 total)

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