smo Questions
2
Solved
What I'm trying to do: Create an SQL script using C# to create an exact copy of an existing table.
My Question: How would you define the options in scriptingOptions to insure that the resulting s...
2
I am successfully using Powershell with SMO to backup most databases. However, I have several large databases in which I receive a "timeout" error "System.Data.SqlClient.SqlException: Timeout expir...
Totten asked 6/5, 2010 at 20:29
2
Solved
I am trying to verify the backup I have just done in c# using command against sql server Express
string _commandText = string.Format("RESTORE VERIFYONLY FROM DISK = '{0}'", backupLocation);
Sql...
Double asked 30/5, 2012 at 3:12
3
Solved
I am using Microsoft.SqlServer.Management.Smo.
My Code:
Server server = new Server(new ServerConnection( new SqlConnection(ConnectionString));
server.ConnectionContext.ExecuteNonQuery(script);
...
Tirza asked 9/5, 2012 at 7:53
2
I'm attempting to retrieve the DefaultValue of all the parameters in a StoredProcedure. My application is build in C# .NET accessing a Microsoft SQL 2008 Database.
I use the SqlCommandBuilder.Deri...
Polynices asked 16/12, 2011 at 0:31
3
Solved
How can I change the logical database name when restoring a database with SMO?
/Viktor
Linebreeding asked 20/2, 2010 at 5:50
1
Solved
I am using SMO to script out my objects from Sql server database using .Net code. But as of now I am going through a sequential loop.
foreach(var table in TableCollection)
{
var stringCollection...
Eupatorium asked 7/3, 2012 at 5:44
3
Solved
I would like to automate script generation (in SSMS --> Tasks --> Generate Scripts) in SSMS 2008. I have read that SQL Server 2008 does not support Database Publishing Wizard (including SQLPUBWIZ S...
Dispensable asked 15/8, 2010 at 18:26
2
Solved
I am sing C#, .NET 3.5, and SMO to create a copy of a database (our production database) to some other databases (our DEV and Test-database) in SQL Server 2005.
I have managed to create a backup f...
Rajah asked 16/8, 2011 at 14:0
1
Solved
I am using SQL Server Management Studio 2008 R2 to manage a SQL Azure database. When I try to right-click on any of the objects in the database, and do Script Table As -> CREATE -> New Query Editor...
Hubbard asked 22/9, 2011 at 20:28
6
Solved
I need to change some primary keys from non-clustered to clustered but I can't drop the constraint because it is referenced from other foreign keys.
How can I find the tables that reference a prim...
Lackey asked 19/4, 2009 at 14:44
3
Solved
I'm trying to dynamically get a databases Table structure using only C# code as follows:
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
public class LoadSt...
Bilection asked 24/8, 2010 at 12:28
2
Solved
How can i backup and restore a database with file stream Using SMO in C#.
i found some attributes in Server Class in SMO Like "FilestreamLevel" and "FilestreamShareName"
but i do not know how to us...
Wiltz asked 5/7, 2011 at 11:30
2
Solved
I use vb.net to backup sql '05 - '08 databases. It works great on smaller databases. but when it comes to large databases it fails at 30 or 40 percent with the error: The backup or restore was abor...
Greenstein asked 18/5, 2011 at 18:33
1
Solved
I have a .NET application where I restore a number of databases using SMO. The timeout setting in the connection string is set to 0 (unlimited). Most databases restore fine, except one databases th...
Toxin asked 12/5, 2011 at 13:55
4
Can anybody explain me what I wrong I am doing in the following piece of code:
DataTable dt=SmoApplication.EnumAvailableSqlServer(true);
Server sr = new Server("Test");
foreach(DataBase db in sr....
Winniewinnifred asked 15/7, 2009 at 10:23
6
I am using SQL Server 2005 Express. I want to use SMO to loop through each table in a database and change each Char column to a Varchar column. If a column is a member of the primary key, I need to...
Duckling asked 29/7, 2010 at 15:4
2
Solved
I have an small question I didn't found an answer yet: how do I get in c# and using Microsoft.SqlServer.Smo the table a foreign key column is referring to?
foreach (Column column in currentTable....
Longways asked 19/1, 2009 at 19:49
3
Solved
I have a SQL 2008 DB. I am running a form that backs that DB up, then tries to update it. If the update fails the idea is to restore that backup. Here is the code I am using to restore the backup. ...
Uranous asked 23/9, 2009 at 15:14
9
Solved
source
http://technet.microsoft.com/en-us/library/ms162234%28SQL.100%29.aspx
code
//Connect to the local, default instance of SQL Server.
{
Server srv = default(Server);
srv = new Server()...
2
Solved
I need to perform a database restore from my application. Before doing this, I want to kill all processes as follows:
private void KillAllProcessesOnSMARTDatabases(Server targetServer)
{
target...
Discomposure asked 17/9, 2009 at 14:18
3
Solved
I'm currently using SMO and C# to traverse databases to create a tree of settings representing various aspects of the two databases, then comparing these trees to see where and how they are differe...
Encumber asked 30/12, 2008 at 22:40
© 2022 - 2024 — McMap. All rights reserved.