sqldmo

Programmatically retrieve database table creation script in .NET

I need to be able to retrieve a CREATE TABLE script to recreate a specific table in a SQL Server (2000) database, programmatically (I'm using C#). Obviously you can do this with Enterprise Manager but I would like to automate it. I've been playing around with SQLDMO which offers a Backup command, but I'm not sure if this will give a SQ...

VB6 support for SQL SMO and .Net 2.0

We are trying to move from using SQL DMO to SMO in our COM+ based application, as we are dropping support for SQL Server 2000 and adding support for SQL Server 2008 in addition to SQL Server 2005. I have been reading around on this, and found this particular quip on this microsoft forum: "SMO is only supported in VB/C#.Net 2005. It r...

How to make app fully SQL Server 2005 compatible?

We have an application that use MSSQL, when we move to 2005, basically we recommend to our client to apply the backward compatibility package and that’s it, but somebody ask me what to do to be 100% compatible on 2005. I was thinking on 1. Compatibility level: SQL Server 2005 (90) 2. Remove any DMO reference, and replaced by SMO 3. Conne...

Does an ASP.NET SQL Library Exist for Managing Tables?

Does anyone know of a SQL library in ASP.NET that can be used to manage tables? Eg SQLTable table = new SQLTable(); table.AddColumn(“First name”, varchar, 100); table.AddColumn(“Last name”, varchar, 100); if(table.ColumnExists(“Company”)) table.RemoveColumn(“Company”); The operations I am looking for are adding, editing and deleti...

How to list SQL 2005 Express instances

I would like to list what instances of SQL 2005 Server (Express Editon) are installed on local or remote machine (my app is in Native C++). I found that i can make it by SQLDMO, however it seems that SQLDMO does not see SQL 2005 Express Edition and call to ListAvailableSqlServers returns empty list. How can i make it? Playing with syste...

Using COM objects in a T4 template?

Hi gang, I'm new to Visual Studio's T4 template engine, and I'm wondering how I can use COM objects to build templates. Specifically, SQL-DMO (to generate classes from stored procedures on a SQL 2000 server, SNO is not an option). Have any of you guys done this? Any tips? <#@ import namespace="SQLDMO" #> is not working. Thanks! ...

Application cannot find Microsoft.SQLServer.SMO on SQL 2008 machine

Hi, I have code that uses Microsoft.SqlServer.Management.Smo. (Built in Visual Studio 2005 SP1) It works fine on SQL 2000 & SQL 2005 machine. But when it is run on SQL 2008 machine it throws an exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=9.0.242.0, Culture=neutral, Pu...

EnumFiles of SQL DMO using c++

while retrieving data and log files of Mirror Database(Ex:TestDB) using EnumFiles() of sql dmo seeing following error: ERROR: Microsoft SQL-DMO (ODBC SQLState: 42000) [Microsoft][ODBC SQL Server Driver][SQL Server]The database "TestDB" cannot be opened. It is acting as a mirror database. so can anyone please tell me how to retrieve all...

SQL Server EnumParameters Method on StoredProcedure object in SQL Server 2008 SQL-DMO

Hello all you wonderfully helpful people, What is the alternative to EnumParameters in SQL Server 2008? This MSDN article mentions that this method is going away, so what should be used instead? http://msdn.microsoft.com/en-us/library/ms133474%28SQL.90%29.aspx Here is the error we receive when attempting to use this method: Micros...

Numeric Columns In SQLDMO BulkCopy

I have a table with numeric columns. When I'm using SQLDMO bulkcopy to insert data , its failing. Please help. ...

Is there a way to specify a domain to look at when using SQLDMO to list SQL servers?

Pardon me if this is a basic question, but I'm just starting to delve into using SQLDMO and I've not been able to find a specific answer to what I'm looking for. The scenario is this: I am trying to list the running SQL Servers in a combo box, but the problem I'm running into is that they are on a different domain than the one that I a...

Problem using SQLDMO/Vb6 against SQL Server 2008

I have a client, that uses SQLDMO for a portion of a custom application that was written against SQL Server 2000, and they recently upgraded to SQL Server 2008. The majority of the app still runs fine (doesn't use SQLDMO), but the admin functions which rely on SQLDMO stopped working. I installed the SQL2005 backward compatibility pack,...

SQL Server 2008 alternative for SQL-DMO

Hi! I previously was using SQL-DMO to automatically generate scripts from the database. Now I upgraded to SQL Server 2008 and I don’t want to use this feature anymore since Microsoft will be dropping this feature off. Is there any other alternative I can use to connect to a server and generate scripts automatically from a database? An...

sql2008,sqldmo to sqlsmo

Hi! I previously was using SQL-DMO to automatically generate scripts from the database. Now I upgraded to SQL Server 2008 and I don’t want to use this feature anymore since Microsoft will be dropping this feature off. Now i want to convert the stored procedure below to 'sqlsmo' version Any answer is welcome. Thanks in advance. This i...