smo Questions
5
I have some code that uses SMO to populate a list of available SQL Servers and databases. While we no longer support SQL Server 2000, it's possible that the code could get run on a machine that SQL...
Regenerative asked 3/9, 2008 at 19:55
6
Ok, I've scoured the web, BOL, various forums and I'm no closer to an answer...hopefully you fine folks can lend a hand...
We've got a dozen or so SQL Servers (some 2k, some 2005) on a network. I'...
Malcom asked 11/2, 2009 at 16:29
2
I'm trying to restore a database from a .BAK file using C# and SMO. This is my code.
public static void RestoreDatabase()
{
string dbConnString = Configuration.DatabaseConnectionString;
ServerCo...
Hardboiled asked 6/4, 2015 at 12:55
2
Solved
Taking a database backup from another server I'm trying to restore to sqlexpress on the localhost. This restore will work via the gui but I'm having issues restoring it with powershell. I get the f...
Blazon asked 25/2, 2011 at 22:30
4
Solved
I am trying to look for a SQL table by name and if it exists drop it. This all needs to be done in C# using SMO.
To complicate it a bit more the table also has a schema other then "dbo".
Ultimatl...
1
Solved
I am attempting to use SMO to write a simple utility to backup/restore databases. This works very well when there is only one point in time in the backup file. However when there is a backup file t...
Vingtetun asked 12/8, 2014 at 0:1
1
I am attempting to use CollationInfo.Comparer from SMO to get my c# code to sort like SQL Server. I have gotten the correct collation, but my items still do not sort correctly.
var collationInfo =...
Petasus asked 19/7, 2012 at 13:33
1
I am hoping to use SMO to deploy a dacpac onto a remote SQL environment, away from my own development machine. In my project I reference a .dll file that is outputted into my build directory when I...
Numerous asked 16/10, 2013 at 8:29
1
I have installed localdatabase and created a shared instance, and using smo I am able to create localdatabase.
For my requirement I have to create a localdb shared instance.
I am creating local d...
2
Solved
I've read a dozen different blogs, as well as reading through the msdn examples and they just aren't working for me.
Ultimately what I'm trying to do is automate moving a DB from our production in...
Cucumber asked 26/10, 2009 at 20:26
1
Solved
I am getting list of stored procedures from database by using SMO. I have foreach loop over stored procedures to make my intended operatioans on them. However I need to use only user created stored...
Plebeian asked 23/12, 2013 at 9:29
4
Solved
I am trying to make a copy of a database to a new database on the same server. The server is my local computer running SQL 2008 Express under Windows XP.
Doing this should be quite easy using the ...
Club asked 6/11, 2008 at 11:42
4
Solved
My database has tables, views and all. And I need a way to generate SQL script for all the DDL in an automated manner. No need for data.
There are FK constraints so table creation scripts should b...
Kodak asked 17/10, 2013 at 18:35
1
Solved
I’m trying to take back-up of a large database using “Backup-SQLDatabase” cmdlet using following statement, but I’m getting time-out error after 10 minutes.
{Backup-SqlDatabase -ServerInstance $Se...
Desuetude asked 9/10, 2013 at 14:55
1
Solved
I'm trying to get programmatically what I can get manually from SSMS using Tasks > Generate Scripts
The code below works fine, EXCEPT it doesn't generate any constraints. I don't get any ALTER TAB...
Parasynthesis asked 24/9, 2013 at 22:3
1
I use SQL Server SMO to restore a .bak to a new database, but failed to work.
sql server is 2012 and smo object version is from the latest sdk version 11.0
file .bak was created using sql manage...
Habanera asked 17/1, 2013 at 10:8
1
Solved
I am trying to use the SMO for Sql Server 2008 R2 Standard, but I am running into an issue whenever I try to Dump an object.
The relevant code:
void Main()
{
var connectionString = @"Server=(l...
Undulation asked 12/3, 2013 at 13:0
4
Solved
I'm using IronPython and the clr module to retrieve SQL Server information via SMO. I'd like to retrieve/store this data in a SQL Server database using SQL Alchemy, but am having some trouble loadi...
Melia asked 8/6, 2010 at 15:1
1
Solved
Given a set of objects (tables, views, procs, ...) I want to drop all of them and all objects that depend on them.
This requires executing the drop operations in dependency order for both the obje...
Dobb asked 26/2, 2013 at 19:46
2
Solved
I have a app used for managing databases for demos of our software, one of the things that it does is get a copy of a database from a central server and restore it to a local SQL instance. Everythi...
Vociferous asked 30/11, 2011 at 19:57
1
I've got a C# program that fires off SQL Server Agent jobs using the SQL Server Management Objects (SMO) interfaces. It looks something like:
Server ssis_server = new Server(
new ServerConnection...
4
Solved
I have an application which performs backups and restores of SQL databases, this works fine on the local machine, however if I run this against a SQL server hosted on another machine I get the foll...
2
My C# application uses SMO to do various things with SQL Server instance chosen by a user. Particularly, it changes authentication mode:
ServerConnection conn = new ServerConnection(connection);
S...
Camphene asked 28/8, 2010 at 20:24
1
Solved
I came across this tutorial to understand how to execute SQL scripts with GO statements.
Now I want to know what can I get the output of the messages TAB.
With several GO statements, the output w...
Antibody asked 28/8, 2012 at 7:0
1
Solved
Having an error when using SMO. This code has been working in VB.Net 4 and was just moved to C# and is now not functioning.
Microsoft.SqlServer.Management.Smo.Server server = new Microsoft.SqlServ...
Supreme asked 16/3, 2012 at 20:29
© 2022 - 2024 — McMap. All rights reserved.