Recent update: 2008-3-21
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
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 ...
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 ...
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>
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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("@"); ...
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 ...
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 ...
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); ...
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 ...
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,
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.
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>
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
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 ...
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 ...
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
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
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 ...
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 ...
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; ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
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 ...
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; ...
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. ...
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 ...
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 ...
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 ...
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 ...
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! ...
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 ...
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: ...
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 ...
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 ...
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 ...
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 ...
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.
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...
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 ...