Showing posts with label objects. Show all posts
Showing posts with label objects. Show all posts

Tuesday, March 27, 2012

Can not find Microsoft.SqlServer.InstApi when trying to run a SMO trace

I install the follwing components

1.Microsoft SQL Server 2005 Management Objects Collection

2.Microsoft Core XML Services (MSXML) 6.0

3.Microsoft SQL Server Native Client

(available from http://www.microsoft.com/downloads/details.aspx?FamilyID=d09c1d60-a13c-4479-9b91-9e8b9d835cdc&DisplayLang=en)

on a clean machine with no SQL Server 2005 client tools.

I get the following error.

Failed to initialize object as reader.
Could not load file or assembly 'Microsoft.SqlServer.Instapi, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

A gacutil tells me that this assembly is not installed.

Is there are way to run SMO trace without having to install the 2005 client tools and only the Management Objects Collection and necessary components?

Sample code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.SqlServer.Management.Trace;
using Microsoft.SqlServer.Management.Common;


namespace SMOTraceTestProgram
{
public partial class Form1 : Form
{

public Form1()
{
InitializeComponent();
}


private void bStart_Click(object sender, EventArgs e)
{


TraceServer smoTraceServerReader;

ConnectionInfoBase cInfoBase = new SqlConnectionInfo();
SetupConnectionInfoBase((cInfoBase as SqlConnectionInfo));

smoTraceServerReader = new TraceServer();

try
{
smoTraceServerReader.InitializeAsReader(cInfoBase, "2005NOSPIDFilter.tdf");
smoTraceServerReader.Stop();
MessageBox.Show("Trace Started and stopped successfully");
}
catch (Exception exception)
{
StringBuilder sb = new StringBuilder();
sb.Append(exception.Message);

Exception ex = exception.InnerException;
while(ex != null)
{
sb.Append(ex.Message);
ex = ex.InnerException;
}
MessageBox.Show(sb.ToString());
}

}

private void SetupConnectionInfoBase(SqlConnectionInfo sqlConnectionInfo)
{
sqlConnectionInfo.ServerName = eSeverName.Text;


if (eUserName.Text.Length > 0)
{
sqlConnectionInfo.UserName = eUserName.Text;
sqlConnectionInfo.Password = ePassword.Text;
sqlConnectionInfo.UseIntegratedSecurity = false;
}
else
{
sqlConnectionInfo.UseIntegratedSecurity = true;
}

}

}
}

I have reproduced this issue in house and can confirm that this is a problem with the Microsoft SQL Server 2005 Management Objects Collection. We will consider this issue for inclusion in Service Pack 2.

As for workarounds, I don't have one. I tried Gac'cing the missing DLL, but there is apparently more registration required, as evidenced by the new error message I got. ("Failed to initialize object as reader.Failed to get SQL Tools directory path from InstAPI.")

|||

Thanks James,

Appreciate the feedback. For the time being I will get the users of my profiling tool to install management tools from the SQL Server 2005 Install. This seems to install the necessary components for SMO Trace to work.

Look forward to a fix though, as this installs a lot more than is required.

sql

Sunday, March 25, 2012

Can not create objects in master

Hi,
I'm trying to create a sp in the database master, but I
cann't, I got an error message
Server: Msg 2714, Level 16, State 5, Procedure Sp_Backup,
Line 41
There is already an object named 'Sp_Backup' in the
database.
but I login as sa user and I got the same error.
could somebody help me, please? I think is a configuration
parameter.
Thanks in advance,
Javier RosasHello Javier !
The error say itself that there is alwasy a SP named SP_BACKUP in there.
Just try this to find whos owning the sp:
USE MASTER
SELECT SO.name, SU.Name
FROM sysobjects SO INNER JOIN
sysusers SU ON SO.UID = SU.UID
WHERE SO.name = 'SP_BACKUP'
THEN CHECK you is logged on:
SELECT USER_NAME()
If they are both identical (Owner and LoggedON Persons), you have to drop
the SP first
or create it for antoher user
CREATE PROCEDURE OWNER.SP_NAME
HTH, Jens Süßmeyer.|||No, the problem is that the object doesn't exist!!!
I can change the name, but the problem is the same, in fact, if I were creating a table (or another object) I got the same mistake!!
Thanks.
>--Original Message--
>Hello Javier !
>The error say itself that there is alwasy a SP named SP_BACKUP in there.
>Just try this to find whos owning the sp:
>USE MASTER
>SELECT SO.name, SU.Name
>FROM sysobjects SO INNER JOIN
> sysusers SU ON SO.UID =3D SU.UID
>WHERE SO.name =3D 'SP_BACKUP'
>THEN CHECK you is logged on:
>SELECT USER_NAME()
>If they are both identical (Owner and LoggedON Persons), you have to drop
>the SP first
>or create it for antoher user
>CREATE PROCEDURE OWNER.SP_NAME
>HTH, Jens S=FC=DFmeyer.
>
>.
>|||It seems there is an issue with your stored procedure create script.
Note that the error message is referring to line 41. However, without
the script source, it's difficult to determine the exact cause of the
error.
Also, user stored procedures should not be prefixed with ''sp_' and it's
not a good practice to create user objects in the master database.
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"Javier Rosas" <jrosashe@.accival.com.mx> wrote in message
news:003701c36fe8$764bf0d0$a501280a@.phx.gbl...
> Hi,
> I'm trying to create a sp in the database master, but I
> cann't, I got an error message
> Server: Msg 2714, Level 16, State 5, Procedure Sp_Backup,
> Line 41
> There is already an object named 'Sp_Backup' in the
> database.
> but I login as sa user and I got the same error.
> could somebody help me, please? I think is a configuration
> parameter.
> Thanks in advance,
> Javier Rosas

Can not Copy and Paste

Hi,

For some reason I can not cut and past objects in BIDS?

I receive the following error:

TITLE: Microsoft Visual Studio

An error occurred while objects were being copied. SSIS Designer could not serialize the SSIS runtime objects.


ADDITIONAL INFORMATION:

Could not copy object 'XSQL CICDB Synonym' to the clipboard.
(Microsoft.DataTransformationServices.Design)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%u00ae+Visual+Studio%u00ae+2005&ProdVer=8.0.50727.42&EvtSrc=Microsoft.DataTransformationServices.Design.SR&EvtID=SerializeComponentsFailed&LinkId=20476

Invalid access to memory location. (Exception from HRESULT: 0x800703E6) (Microsoft.SqlServer.ManagedDTS)


BUTTONS:

OK

Any ideas why?

Thanks!

just a hunch: try rebooting your machine.|||

Rebooted several times. Does not resolve issue.

Thanks!

|||

willajo wrote:

Rebooted several times. Does not resolve issue.

Thanks!

just a hunch: try re-installing BIDS.sql

Saturday, February 25, 2012

Can I use business objects as a data source?

We have decided to use business objects in our new application, which seems to be working well, since they can be used as a binding source for grids, etc.

I am trying to evaluate whether SSIS is a practical solution for our ETL requirements. The problem is, I can't find any examples or references, or even the slightest hint that anyone is using them with business objects. Any attempts to search yield a ton of results which are based on a commercial product called "Business Objects" rather than the design pattern.

It is currently a requirement of our development team that all data access must be done via business objects, rather than communicating directly with the database.

Can anyone provide some more information (besides just suggesting I write a custom connection manager)? Is there anyone who has actually made SSIS work with business objects?

Thanks, Richard

What is a "business object"?|||I don't know what kind of information you're looking for. Yes, it can be done. Yes, you'll have to write custom components to talk to the business objects instead of the database. I've done it for Reporting Services as a custom data extension (source) and it wasn't a bunch of fun. SSIS I think would be even less. Biggest downside I can think of off-hand is that you won't be able to bulk load into the database (think row-by-row), which is going to be really painful in an ETL scenario. I've never heard of an ETL process that wasn't allowed to access the database directly.
|||I'd concur with Jay's assessment. I've done some similar work in the past. Business objects are usually not very efficient for accessing large amounts of data. If your data movement is going to be on an individual row basis, I'm not sure SSIS is the best option for implementing it.|||

We are a 3PL, so in our case, ETL is more along the lines of importing batches of orders and exporting batches of shipping confirmations from and to a variety of data formats. Row-by-row is not an issue.

It would be nice to find a working example of how to do this prior to investing a bunch of time into SSIS.

|||This sounds more like BizTalk than SSIS. It isn't your business objects that I'd be concerned about in SSIS, it's the "variety of data formats". SSIS wants to move 10,000+ rows per second between well-defined sources and destinations and do a bunch of transformations along the way. BizTalk wants to route transactions between different systems and talk different formats to each one.
|||

BizTalk has a price tag. We already have SSIS. Everything I've read to date on it indicates that it is something we should be able to use to meet our needs. I am not questioning whether SSIS is the best choice. I would like to know if anyone has used it successfully with business objects, and if so, can they provide some examples, or other helpful information.

Thanks, Richard.

|||What will your business objects be constructed as? COM objects, web services, .NET assemblies? That has an impact on how easy they are to interface with.|||

SSIS Evaluator wrote:

BizTalk has a price tag. We already have SSIS. Everything I've read to date on it indicates that it is something we should be able to use to meet our needs. I am not questioning whether SSIS is the best choice. I would like to know if anyone has used it successfully with business objects, and if so, can they provide some examples, or other helpful information.

Thanks, Richard.

Can I reiterate Phil's question (above)? What exactly are these "business objects"?

-Jamie

|||

It's a generic term for objects that represent business entities and the rules associated with those entities. So you might have a Customer business object, with all the attributes that a customer has, and methods to represent any operations that can be performed on the customer. Usually, these provide a layer of abstraction between the database and the user interface. Business objects know where their data is stored for persistence, and user interfaces request information from the business objects rather than accessing the database directly. Changes in the data from the UI are also handled through the business object. Data validation, enforcement of business rules, etc, are all handled in the business object.

In the OP's case, evidently they have made an architectural decision that all data access has to go through these business objects. As has been stated, it is possible to do this with SSIS. The degree of complexity depends in large part on how the business objects are implemented. If this is being looked at a method to handle importing or exporting data from business objects to an external database, it might work OK, assuming performance is not the major concern. If it is for business object to business object communication, I really think the OP would be better off investigating other tools.