SQL Server SMO/DMO,18 - SQL Server,
Recent update: 2008-3-21

smo and batchparser on 64 bit

211 byte By Steven_Gr3y_B3ard at 2008-3-7
I understand that the batchparse dll is supposed to be installed in both the 32 and 64 bit GAC. But on my machine, I can find neither. My installation of SQL 2005 was typical not custom. What did I miss? TIA

SQL DMO - Backward Compatibility Components Redistributable

792 byte By ChrisW at 2008-3-6
I need to update our applications install program so it installs the latest SQL DMO. I've downloaded the "Microsoft SQL Server 2005 Backward Compatibility Components" MSI from http://www.microsoft.com/downloads/details.aspx?familyid=D09C1D60-A13C-4479-9B91-9E8B9D835CDC&displaylang=en.This ...

query builder

319 byte By prk at 2008-3-5
hi friends i've one question is it possible to use SMO to replicate "Query Designer" programmatically? i want to write a query builder for end users and am wondering which objects in SMO i need to use to achieve what i want. any ideas on this one much appreciated.Thank you very much for your ...

Create Script Database

256 byte By Spag at 2008-3-3
Hi, i want to know if there is a tool like scptxfr in SQL2005, in order to generate a script of all database. </P> I need this , because i have to make a job that automatically generates script of all database every day for backup.</P> Thks. </P>

Start and Stop a server using SMO

367 byte By MikeGustafson at 2008-3-1
I am trying to stop and start a server using SMO in .net 2005. I cannot find any function calls to do this on the server object like the old DMO has. The MSDN help system is missing the example to show how this is done. If anyone knows how to do this I would really appreciate some help or ...

.NET2 SMO Components

1263 byte By BLIS at 2008-2-28
I am new in VS2005 and I start with sql2005 express. I plan to use SQL express 2005 manager. When I tries to install this program the system asks for MS Framework,net2 SMO Components. Where can I download these components? Thank You Best regards ?yvind ...

Exporting data with SMO?

545 byte By alex.gorbatchev at 2008-2-27
I have searched low and high for some information on how to export data with SMO. My old build scripts were using SQLDMO.BulkCopy which was using BCP and it worked fast on entire database. I can't find a way to do the same with SMO. As alternative, I tried using bcp.exe on each table but it's ...

Detach sql2000 msde database using SMO.

712 byte By MikeGustafson at 2008-2-26
Hello, I am trying to detach a database from an instance of msde 2000 using smo. When I call the Server.DetachDatabase function using my valid server object I get the following error. "This method or property is accessible only while working against SQL Server 2005 or later." Does anyone know ...

Adding a loggin to a server

384 byte By MikeGustafson at 2008-2-25
In DMO the server object had an add method on the Logins collection. Does anyone know how this works in SMO the logins collection does not have an add. I have spent hours on this and just cannot figure out how to create a new login on a server using SMO. I guess I could allways script the ...

Start and Stop a server using SMO

367 byte By MikeGustafson at 2008-2-24
I am trying to stop and start a server using SMO in .net 2005. I cannot find any function calls to do this on the server object like the old DMO has. The MSDN help system is missing the example to show how this is done. If anyone knows how to do this I would really appreciate some help or ...

.NET2 SMO Components

1263 byte By BLIS at 2008-2-23
I am new in VS2005 and I start with sql2005 express. I plan to use SQL express 2005 manager. When I tries to install this program the system asks for MS Framework,net2 SMO Components. Where can I download these components? Thank You Best regards ?yvind ...

SqlServer SMO StoredProcedureParameter Bug?

2044 byte By DougHolland at 2008-2-22
I'm creating a Windows Forms application which auto-generates my stored procedures for me. Based upon a column's DataType property I'm creating instances of StoredProcedureParameter as below: if (column.InPrimaryKey) { StringBuilder parameterBuilder = new StringBuilder("@"); ...

List all databases accessible by a login

3070 byte By DanWilliams at 2008-2-22
Hi all. I am new to SQL-DMO so sorry if what i am asking is really easy. Is it possible to get a list of all objects (including databases) which are accessible for a particular login. So far I have: Dim oSQLServer As SQLDMO.SQLServerDim oSQLDatabase As SQLDMO.DatabaseDim oSQLLogin As New ...

Restoring or attaching the *.mdf file

481 byte By Niraj at 2008-2-21
Hai,I am trying to attach the *.mdf file then i am getting the error 1813.The problem occurs when our development database transcation running out of memory disk, then I dettach database and at the time of dettaching database some of users are connected. I kill the session of all users. After I ...

Get a list of columns

2949 byte By DanJurden at 2008-2-20
I'm trying to get a list of columns from a table. Here is my code: public List<string> GetColumns(string serverName, string dataBaseName, string tableName) { List<string> columns = new List<string>(); Server server = new Server(serverName); ...

Poor performance when looping through table columns

2129 byte By RussellMason at 2008-2-20
Hi Is there a performant way to loop through all columns on a table accessing lots of properties against the table and each column? If I do this on a single table with 100 columns it takes forever! If I look at Profiler this seems to generate 1000s of queries. I have tried using ...

SMO ServerConnection common dialog?

142 byte By Grant_csi at 2008-2-20
Is there a common dialog I can use to prompt a user for connection information to be used to create an SMO ServerConnection object. Thanks,

how to install SQLDMO without install SQLserver?

177 byte By gibic at 2008-2-19
Hi, I want to using SQLDMO futures and I want to connect to remote SQL server but i don t want to install SQL server. Can I install SQLDMO without SQL server? Thank you.

SMO Script Method

177 byte By eric_c007 at 2008-2-18
Does anybody have any detailed information on the SMO script method? I am trying to write a VBScript that will script the logins on a SQL 2005 server. Thanks! Eric </span>

smo and batchparser on 64 bit

210 byte By Steven_Gr3y_B3ard at 2008-2-17
I understand that the batchparse dll is supposed to be installed in both the 32 and 64 bit GAC. But on my machine, I can find neither. My installation of SQL 2005 was typical not custom. What did I miss? TIA

SQL DMO - Backward Compatibility Components Redistributable

784 byte By ChrisW at 2008-2-16
I need to update our applications install program so it installs the latest SQL DMO. I've downloaded the "Microsoft SQL Server 2005 Backward Compatibility Components" MSI from http://www.microsoft.com/downloads/details.aspx?familyid=D09C1D60-A13C-4479-9B91-9E8B9D835CDC&displaylang=en.This ...

query builder

319 byte By prk at 2008-2-15
hi friends i've one question is it possible to use SMO to replicate "Query Designer" programmatically? i want to write a query builder for end users and am wondering which objects in SMO i need to use to achieve what i want. any ideas on this one much appreciated.Thank you very much for your ...

List of tables in use by a view

133 byte By ArtyArochita at 2008-2-15
Hi, I wonder if I can list the tables (and views) used inside a view, I mean the list of tables in the FROM clause Thanks, Arty

SMO Scripter generated script does not run on SQL 2000

218 byte By angelok at 2008-2-15
I seem to be running into a problem getting a script (of the entire db) generated by SMO to run on 2000. It looks like it puts all kinds of SQL 2005 specific TSQL in the script, which fails on 2000. Any ideas? Angelo

Bug, Can not create varchar(max) columns with SMO

499 byte By evrenokcu at 2008-2-15
I just want to create a varchar(max) column with SMO. My code is as follows. Instead of varchar(max), a column with datatype varchar(1) is created!!!Table t = new Table(db, "t1");t.Columns.Add(new Column(t, "c1", new DataType(SqlDataType.NVarCharMax)));t.Alter();That seems to be a bug of ...

Deploy SMO project

408 byte By M.B at 2008-2-15
Hi,I'm writting a tools with SMO that supports SQL Server 2005 and 2000 and I'm wondering wich components do I have to include in my setup to support both versions ?With SQLServer 2000 my application throws a following message :"Could not load type ...

Copy Database with Microsoft.SqlServer.Management.Smo.Transfer breaks identity columns

1103 byte By VladislavLevashov at 2008-2-14
Hello I have a task to copy at runtime "etalon" database inside one same SQL 2005 server. Everythings ok except identity fields: identity breaks in new database.I use such code: Transfer xfr = new Transfer(db); xfr.CopyAllObjects = true; xfr.Options.ContinueScriptingOnError = true; ...

Restoring or attaching the *.mdf file

468 byte By Niraj at 2008-2-14
Hai,I am trying to attach the *.mdf file then i am getting the error 1813.The problem occurs when our development database transcation running out of memory disk, then I dettach database and at the time of dettaching database some of users are connected. I kill the session of all users. After I ...

This SMO transfer script doesnt transfer ?

2499 byte By LuisEstebanValenciaMCP. at 2008-2-13
Hello, this takes a lot of time but when I got to sql server management studio there are no objects there!!What am I missing?private void button1_Click(object sender, EventArgs e) { Server sv = new Server("ESTACION15"); Database db = sv.Databases["GescomDllo"] ; Database db2 = new ...

Error while restoring database,

370 byte By DrZombie at 2008-2-13
Hi,Im trying to restore a database, when i try to restore by selecting the file groups option it gives me an error Microsoft SQL DMO The backup set holds a backup of a database other than the existing database. RESTORE DATABASE terminated abnormally. I tried deleting all the tables and the ...

Microsoft.SqlServer.Management.Trace.TraceServer - Examples ?

676 byte By StevenWilmot at 2008-2-12
I'm trying to find ANY examples of using the Microsoft.SqlServer.Management.Trace namespace.What I'm looking for is an example of being able to create and initialise a new trace, haing this processed on the Server, and then initializes some sort of traceReader against this.e.g the equivalent ...

Automated backups in SQL Express?

556 byte By ChrisW. at 2008-2-11
I've realize that the SQL Agent service is no longer available now that i've upgraded from MSDE 2000 to SQL Server Express. I would like to find out the easiest way I could go about creating an automated backup solution for SQL Server Express. Previously I created Jobs in the SQL Agent ...

Execute installation script.

285 byte By LuisEstebanValenciaMCP. at 2008-2-10
Hello. I will export the database generated script for all objects, I want to make an installer that executes that script on the remote server, I think the installer must ask for sa password; anyway thats not the problem, How can I make with SMO execute an script file? Thanks

TRACE FREEZES CURRENT CONTEXT

408 byte By NebimYazilim at 2008-2-10
Hello,I have troubles when using SMO trace event. I can start trace in windows application (not console application) but window is frozen it does not allow you to play with controls in the window. I use Thread.Slep event but still doesn't work window cursor is cursor.wait. Does anybody know ...

DMO restore problem

2543 byte By SandyZ at 2008-2-8
I have a C++ app that is using SQLDMO with SqlServer2000. I am Restoring a database using only the .bak file, moving the .mdf and .ldf files. The following is the code:#ifdef USE_SQLDMO try { if(m_cpServer == NULL) return E_FAIL; _RestorePtr cpRestore; ...

BCP using SMO

572 byte By BaskarJoshi at 2008-2-8
We have a SQLServer 2000 stored procedure, which imports data from files using SQL-DMO BulkCopy object(sp_OACreate is used to create the objects). We also use Format files to aide the import. Now, we are planning to convert this stored procedure to .NET application using Visual Studio 2005. ...

SQLNAMESPACE object in YUKON

1047 byte By ShaunMichael at 2008-2-7
Hi Problem:From the past times we have been using DMO to create SQL Server jobs on SQL Server instances. For SQL Server 2000 and older versions like 7.0, our dependency was in huge amount on SQLNamespace functionality to make up the scheduled job property dialog ...

This SMO transfer script doesnt transfer ?

2500 byte By LuisEstebanValenciaMCP. at 2008-2-7
Hello, this takes a lot of time but when I got to sql server management studio there are no objects there!!What am I missing?private void button1_Click(object sender, EventArgs e) { Server sv = new Server("ESTACION15"); Database db = sv.Databases["GescomDllo"] ; Database db2 = new ...

SQL 2005 RTM - SQLDMO "Backward compatibility Redist"

1158 byte By ScottLezberg at 2008-2-7
I have downloaded the SQL 2005 RTM Developer Edition. Can someone point me to the file name and location of "'backward compatibility redist'"?ThanksScottFAQ at http://blogs.msdn.com/mwories/articles/dmofaq.aspx"Q: Is SQL-DMO still supported with SQL Server 2005?A: Yes, SQL-DMO will be fully ...

READ LDF FILES

615 byte By ismar at 2008-2-7
I would like to know is it possible and how to read LOG files with SQL-DMO?My clients would like to know who is doing what and when. Actually I would like to trace table activites these are DELETES, UPDATES & INSERTS only. Also I know that it is possible to do it with triggers & jobs by ...

SMO & DMO FAQ

613 byte By MichielWories at 2008-2-6
I have posted common questions on my blog. Take a look at the FAQ before posting questions in this forum. I will continue to add on answers for common questions as I go. I hope this helps finding answers faster! http://blogs.msdn.com/mwories/articles/smoindex.aspxComments, let me know! ...

How can I get or set a foreign key's 'on update cascade' or 'on insert cascade' by SQLDMO?

934 byte By KOLY at 2008-2-6
Hello,everyone! I have a problem with sqldmo's KEY object,please help me! When creating a foreign key constraint with 'on update cascade ' or 'on delete no action ' by T-SQL,we can do like this: ALTER TABLE [dbo].[myForeignTableName] with nocheck ADD CONSTRAINT [FK_mykeyname] FOREIGN KEY ...

Cannot run job created by SMO

5017 byte By Vuong at 2008-2-5
I've create a SQL Agent job using C# SMO to process an Analysis Service Database (see code below). When I tried to start job from Management Studio, I get the following error message...any ideas?TITLE: Microsoft.SqlServer.Smo Start failed for Job 'Schedule Job OLAPProj'. For help, click: ...

Cannot access property XmlSchemaNamespace

409 byte By sschleicher at 2008-2-5
After assigning a default value to the DefaultConstraint.Text property, I get the following error: Cannot access property XmlSchemaNamespace.This property is not available on SQL Server 2000. I am going against a SQL server 2000, but I am only assigning a default value to an existing column ...

using WriteNotifyEventHandler with tracefiles

404 byte By CathalConnolly at 2008-2-4
I've a fined tuned trace running that outputs the result to a tracefile. Currently I'm using the TraceTable class to read back the trace, which works fine. However I'm trying to use the WriteNotify event to react when this file changes, but it never appears to fire. I'm using the beta2 of ...

SMO

312 byte By oz4000 at 2008-2-4
hi everybody,I want to add the Microsoft.Server.smo.dll to my VS 2003 .net project.However, when I try to do just that, I get an exception (A reference to Microsoft.SqlServer.Smo.dll could not be added. this is not a valid assembly or COM component etc).Any idea ?Ozbourn ...

TableCollection does not contain any table?

1687 byte By DavidN. at 2008-2-4
Hi All,I have the following C# code to get the table scripts, and it does not work. I debugged the code and learned that it does not find any table in the smoDatabase.Tables collection, so the foreach() loop exits immediately.Can someone shed a light? Thanks in advancepublic Sample(){ Server ...

Example connecting to SQLExpress file

112 byte By Mykre at 2008-2-4
Has any one got a simple script, or referance to a small example of connecting to a sql express file using smo.

about speed during search for keywords in the script of the view

546 byte By shai at 2008-2-3
hi,In my project i want to search whether there is a 'select *' in the script of a view,whether there is a 'group by ' clouse ,whether min() and Max() functions contain indexed columns,whether the view contains a temperory table or a sub query etc.i can do this searches by loading th...

Set default value on column object

584 byte By sschleicher at 2008-2-3
I am trying to set the default on a column object and it does not seem to be the same as SQL-DMO. In SQL-DMO, I just set the DRIDefault.Text property and it was all good. Now when I set the Default property I get an error creating the table telling me that getdate() is not a default. At this ...

SQL Server

Site Classified