Questions tagged [smo]

SQL Server Management Objects (SMO) are .NET objects for management of Microsoft SQL Server. The namespace is "Microsoft.SqlServer.Management.Smo".

The Microsoft.SqlServer.Management.Smo namespace contains classes that represent the core SQL Server Database Engine objects. These include instances, databases, tables, stored procedures, and views.

The Microsoft.SqlServer.Management.Smo namespace contains the instance object classes that represent SQL Server Database Engine objects and some utility classes that represent specific tasks, such as scripting. When a connection to the instance of the SQL Server Database Engine has been established by using a Server object variable, objects on the instance can be accessed by using the SMO instance objects. For example, you can use the Database object to access databases on the connected instance of SQL Server Database Engine. All the instance classes are related to the Server class in the object hierarchy. Utility classes exist outside of the Server class object hierarchy and represent specific tasks, such as backup or scripting.

Most of the classes Microsoft.SqlServer.Management.Smo namespace resides in the Microsoft.SqlServer.Smo.dll and Microsoft.SqlServer.SmoExtended.dll files. Additionally, some of the enumeration classes are in the Microsoft.SqlServer.SqlEnum.dll and Microsoft.SqlServer.SmoEnum.dll assembly files. You will have to import all four files to access all of the classes in the Microsoft.SqlServer.Management.Smo namespace.

src=http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.aspx

810 questions
0
votes
1 answer

SQL SMO exception causes finally block to be skipped?

I created a VS2010 Windows service project. In it I invoke the method Microsoft.SqlServer.Management.Smo.Database.ExecuteWithResults(expression). In my scenario the expression contains invalid SQL, so the call fails with an exception as expected. …
Dan
  • 1,215
  • 1
  • 10
  • 22
0
votes
1 answer

Why is Smo.Agent.JobServer is changing my SQL connection string?

Hi I'm noticing some odd behavior while using SMO and was wondering if anyone could provide some insight into this; when I first make any call to the Server.JobServer property (in this case, merely calling .ToString() which presumably lazy…
blue18hutthutt
  • 3,191
  • 5
  • 34
  • 57
0
votes
1 answer

SQL SMO Objects SqlRestore Method (ReadFileList)

Good afternoon all- I've searched around quite a bit, and found a few good resources on how to dynamically determine the names of the logical data file names contained within an and SQL .bak file. The SMO method Im working with requires that I pass…
0
votes
0 answers

How do I run a SQL Agent job with different parameters using SMO and without having to alter the JobStep definition?

I have some SSIS packages that are stored in the SQL Server and exposed via a SQL Agent Job I have written a component that allows me to dynamically build up the correct command line for the job step containing the SSIS package which allows me to…
blue18hutthutt
  • 3,191
  • 5
  • 34
  • 57
0
votes
1 answer

How to identify and get the sqlserver data files filepath

I am afraid that i am unable to locate the absolute path of the SQL SERVER data files. I have tried to so do by doing the following. foreach( Database db in srv.Databases) string filepath=db.PrimaryFilepath; string name=db.Name; …
Cute
  • 13,643
  • 36
  • 96
  • 112
0
votes
1 answer

How to get SMO application working on another Machine

I wrote an application using SMO it installs and runs fine on my dev pc, even installing in another location and running it, but when i move it to another machine it gives the following error Log Name: Application Source: .NET…
Theresa Forster
  • 1,914
  • 3
  • 19
  • 35
0
votes
1 answer

finding datafiles path including datafile name using SMO

i have did like foreach(LogFile lf in db.Databases) Console.WriteLine(lf.FileName) which displays the logfile path including extension.....My Problem is how to find the Datafiles exact path including extension..Give me the Guidance Any…
Cute
  • 13,643
  • 36
  • 96
  • 112
0
votes
3 answers

How to find where my data files and log files stored using smo in c#

Can anybody please tell me how to find the location where my data and log files stored using SMO in c#?
Cute
  • 13,643
  • 36
  • 96
  • 112
-1
votes
1 answer

c# Unit test for importing database using smo and checking sql connection

How can I implement a unit test for database transfer from remote server into localhost using smo. Also is it possible to test the sql connection? I don't have so much experience in Moq , NUnit. Any recommendations are highly appreciated.
Elena2020
  • 43
  • 1
  • 5
-1
votes
1 answer

how to reslove TypeError: 'float' object cannot be interpreted as an integer

im working with smo algorithm and received an error as float object cannot be interpreted as a integer.. since im new to python i got confused please help me with this... class SMO(): def…
Shibin Robin
  • 25
  • 1
  • 1
  • 9
-1
votes
1 answer

How to restore backup form one linked server to another linked server using C# SMO

Want to restore a database backup from linked server A to a database located on linked-server B using C#. prefer to use SMO. I can restore from my local backup to local machine. { conn = new ServerConnection { …
Farbod
  • 1
  • 2
-1
votes
1 answer

Restoring database with SMO - Reporting progress problems

I'm using the below to restore a database in VB.NET. This works but causes the interface to lockup if the user clicks anything. Also, I cannot get the progress label to update incrementally, it's blank until the backup is complete then displays…
madlan
  • 11
  • 4
-1
votes
1 answer

How to display the remote sql instances of a particular machine using SMO?

i wnat to display the Remote machine SQL instances using SMO .How to do this one. Suppose i am using the machine machine 1 from this machine i want to display the remote machine(ex machine2) SQL instances using smo how to this ?? i am using…
Cute
  • 13,643
  • 36
  • 96
  • 112
-2
votes
2 answers

Best way to run long running Sql Scripts in winforms and keep UI responsive

I have been working to write a SQL installer for my application and haven't been given a lot of time to work on it therefore its a bit dirty. My UI thread collects values from the form, plugs them into a series of SQL scritps and then one by one…
VinnyGuitara
  • 605
  • 8
  • 26
-3
votes
2 answers

Nofollow all external links - yes or no?

I am working with a company that is trying to build their online authority and they want to avoid any penalties from Google and other major search engines. The site is a social network (adult related) and users can create public profile, post links,…
Gary
  • 11
  • 5
1 2 3
53
54