what/how do install to my VS 2023 so that I have Microsoft.SQLServer.Management available

elsvieta 346 Reputation points
2023-09-11T17:36:50.0066667+00:00

hi all,

I am trying to write a method that launches an Agent job from an asp.net page, I need:

using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Agent;

I tried Project-> Add Reference, but found nothing when Searching for Microsoft.SqlServer.Management.

Any idea what I need to install and where do I get it?

Thanks,
elsvieta

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,540 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,150 questions
0 comments No comments
{count} vote

Accepted answer
  1. Olaf Helper 45,366 Reputation points
    2023-09-12T07:00:25.7+00:00

    write a method that launches an Agent job

    Easier way is with a SQL command + plain SQL with sp_start_job (Transact-SQL)

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Viorel 118.5K Reputation points
    2023-09-11T19:21:54.8266667+00:00

    Try to use the “Manage NuGet Packages...” command for your project, go to Browse tab, find and install the Microsoft.SqlServer.SqlManagementObjects package.

    0 comments No comments

  2. Lan Huang-MSFT 29,916 Reputation points Microsoft Vendor
    2023-09-12T06:58:26.3966667+00:00

    Hi @elsvieta,

    Beginning with SQL Server 2017 SMO is distributed as the Microsoft.SqlServer.SqlManagementObjects NuGet package to allow users to develop applications with SMO.

    Installing SMO

    Creating a Visual C# SMO project in Visual Studio.NET

    User's image

    User's image

    User's image

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.