SMOs support really everything you will need. Databases, drop databases and backup databases can be created. Using this you can build many Database applications. tableįoreach (Property myTableProperty in ["Employee",Ĭonsole.WriteLine(myTableProperty.Name + " : " + myTableProperty.Value) List down all the properties and its values of. List down all the user-defined function of AdventureWorksįoreach (UserDefinedFunction myUserDefinedFunction in myAdventureWorks.UserDefinedFunctions)Ĭonsole.WriteLine(myUserDefinedFunction.Name) List down all the Stored Procedures of AdventureWorksįoreach (StoredProcedure myStoredProcedure in myAdventureWorks.StoredProcedures)Ĭonsole.WriteLine(myStoredProcedure.Name) List down all the tables of AdventureWorksįoreach (Table myTable in myAdventureWorks.Tables)
List down all the databases on the serverįoreach (Database myDatabase in myServer.Databases)ĭatabase myAdventureWorks = myServer.Databases Users of SQL Server Management Studio are now able to benefit from the innovations and features in Azure Data Studio. Retrieving databases, tables, SPs, UDFs and Properties Beginning with SQL Server Management Studio (SSMS) 18.7, Azure Data Studio is automatically installed alongside SSMS. If (rbSQLServerAuthentication1.Checked = true ) P rivate void btnConnect_Click( object sender, EventArgs e) get all the database list on that server ServerConnection conn = new ServerConnection () Ĭonn.LoginSecure = false //using sqlserver auth These are the minimum files that are required to build an SMO application: Then click "Browse" then locate the SMO assemblies in the "C:\Program Files\Microsoft SQL Server\110\SDK\Assemblies\" folder, and then select the following files.
Since it is managed code, no wrapper class is required.
#Alternative to sql server management studio code#
SQL Server Management Objects (SMOs) were introduced by Microsoft to manage SQL Server objects in C#. This is the managed code replacement of DMOs.