Thursday, March 29, 2012

Error: Data Mining message

This may well be embarrasingly simple but....

I get this massage from Management Studion when I try to run any MDX

Error (Data mining): Either the user, LEONARD\Will Riley, does not have permission to access the referenced mining model, Contribution_Interest, or the object does not exist.

Is there something really simple I have missed?

Most likely you made syntax error in your MDX up tp a degree that it actually looks more like DMX than MDX, so AS tries to find mining model instead of cube. If you will paste your MDX statement, the forum should be able to help and fix it.|||

Yep, you got it

Once I plugged in what I knew to be some correctly structured MDX, the issue went away.

Cheers, Will

error: Cursor not returned from query

I'm a really beginner about sql2000.
During my test I have created the following query. It's works ok until I
do't add the code included in section A, when I add it the i obtain the
error: Cursor not returned from query

Anyone can help me?

Thanks Carlo M.

set nocount on

IF OBJECT_ID('storico_big') IS NULL -- section A begin
create table storico_big( data datetime,
bcarrier varchar(20),
bda CHAR(30),
bzone char(50),
bdur int) ;
insert into storico_big -- section A
end

select top 10000
adetdate,bcarrier,bda,bzone,bdur
from pp_cdr (nolock)
where
adetdate < :data_fin and adetdate > :data_in order by adetdate
set nocount off

-- end of queryIW2FIV (carlo.merlini[NONROMPERE]@.libero.it) writes:
> I'm a really beginner about sql2000.
> During my test I have created the following query. It's works ok until I
> do't add the code included in section A, when I add it the i obtain the
> error: Cursor not returned from query

Apparently you are using some environment unknown to me. At least I
don't recognize the message.

> IF OBJECT_ID('storico_big') IS NULL -- section A begin
> create table storico_big( data datetime,
> bcarrier varchar(20),
> bda CHAR(30),
> bzone char(50),
> bdur int) ;
> insert into storico_big -- section A
> end

Since there are several apparent syntax errors here, it would have been nice
if you environment had returned the errors from SQL Server, rather than
bitching about the missing cursor.

It can be a good to run the query from Query Analyzer to get better
error diagnostics.

I don't really want to suggest a correction, because I can't understand
what you are trying to do. It appears that in the same batch that you first
want to create a table, insert into it, and then select data from another
table.

Possibly you want to insert the data from the SELECT statement into
storico_big, but in such case you should

1) get rid of that extraneous end
2) add an explicit column list to the INSERT statement.

However, I have a feeling that if you insert data into the table, the
client environment will still complain about a missing cursor...

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Erland Sommarskog wrote:
> IW2FIV (carlo.merlini[NONROMPERE]@.libero.it) writes:
> > I'm a really beginner about sql2000.
> > During my test I have created the following query. It's works ok until I
> > do't add the code included in section A, when I add it the i obtain the
> > error: Cursor not returned from query
> Apparently you are using some environment unknown to me. At least I
> don't recognize the message.
I would suspect that it's some data layer (such as ADO, ADO.NET, DAO,
etc), which has at least two different methods of performing work in
the database - one for performing data retrieval and another (possibly
on another object, if the layer is object oriented) which allows data
manipulation.

For instance, ADO.NET has ExecuteReader and ExecuteNonQuery methods on
it's command object.

Damien|||Damien (Damien_The_Unbeliever@.hotmail.com) writes:
> I would suspect that it's some data layer (such as ADO, ADO.NET, DAO,
> etc), which has at least two different methods of performing work in
> the database - one for performing data retrieval and another (possibly
> on another object, if the layer is object oriented) which allows data
> manipulation.
> For instance, ADO.NET has ExecuteReader and ExecuteNonQuery methods on
> it's command object.

Obviously IWZFIV is not using ADO .Net. ADO .Net does work with cursors
at all, as far as a I know. A more substantial clue is the condition:

adetdate < :data_fin and adetdate > :data_in order by adetdate

Apparently IWZFIV is using some form of embedded SQL.

Anyway, I would not really describe ADO .Net as providing different methods
for different purposes. If all you want is minimalism, you can do every-
thing with ExecuteReader. The other methods, ExecuteNonQuery, ExecuteScalar
and DataAdapter.Fill can be seen as convenience methods implemented on
top of ExecuteReader. (OK, this is not really true. There are some
fine differences when there are multiple error messages and result sets
interleaved.)
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Error: CrystalDecisions.CrystalReports.Engine.FormulaException: Error in File C:\DOCUME~1\

Hello,

I am having a crystal report using datastored in a dataset. When I select one of items in a dropdownlist, it gives me this error message. Note that I used that code before in another web page using a different crystal report and a different dataSet and it worked successfully, but this time it doesn't work...anyone can tell me what causes this error and how to solve it?

NOTE: I am using a vb code behind in my .aspx page

Error in File C:\DOCUME~1\AM-TK-~1\ASPNET\LOCALS~1\Temp\temp_03ca344b-568e-4ea1-bea8-94f3ef92bbcd.rpt: Error in formula <Record_Selection>. '{StProd2.ItemDescription}' The result of selection formula must be a boolean.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:CrystalDecisions.CrystalReports.Engine.FormulaException: Error in File C:\DOCUME~1\AM-TK-~1\ASPNET\LOCALS~1\Temp\temp_03ca344b-568e-4ea1-bea8-94f3ef92bbcd.rpt: Error in formula <Record_Selection>. '{StProd2.ItemDescription}' The result of selection formula must be a boolean.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[FormulaException: Error in File C:\DOCUME~1\AM-TK-~1\ASPNET\LOCALS~1\Temp\temp_03ca344b-568e-4ea1-bea8-94f3ef92bbcd.rpt:Error in formula <Record_Selection>. '{StProd2.ItemDescription}'The result of selection formula must be a boolean.]  . F(String  , EngineExceptionErrorID  )  . A(Int16   , Int32   )  . @.(Int16  ) CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext) CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext) CrystalDecisions.Web.ReportAgent.u(Boolean  N) CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e) System.Web.UI.Control.PreRenderRecursiveInternal() System.Web.UI.Control.PreRenderRecursiveInternal() System.Web.UI.Control.PreRenderRecursiveInternal() System.Web.UI.Page.ProcessRequestMain()

Dear Frnd',

It will nice if you provied more info, like in drop you are selecting which report to get or some value on which parameter it get the dataset.

or what are the datatype in database & on report.

Some more detail need to get it root.

Error: CREATE ASSEMBLY for assembly

I am trying to deploy a Database Project with Visual Studio 2005 and SQL Server 2005 Standard.

I import “System.IO” and have therefore set the permission levels to EXTERNAL_ACCESS.

I am receiving the same error message that many folks have received.

CREATE ASSEMBLY for assembly 'Images' failed because assembly 'Images' is not authorized for PERMISSION_SET = EXTERNAL_ACCESS.

The assembly is authorized when either of the following is true: the database owner (DBO) has EXTERNAL ACCESS ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with EXTERNAL ACCESS ASSEMBLY permission. If you have restored or attached this database, make sure the database owner is mapped to the correct login on this server. If not, use sp_changedbowner to fix the problem. Images.

My CLR access is “on”

I have tried

1) From master run: GRANT EXTERNAL ACCESS ASSEMBLY to [Builtin\Administrators].

2) From master run: GRANT EXTERNAL ACCESS ASSEMBLY to “My Windows Authentication ID”.

3) Run ALTER DATABASE MYDATABASE SET TRUSTWORTHY ON

4) In Visual Studio .NET 2005 Set the permission levels to ‘external’

5) Tried Builtin\Administrators and my SQL Server Windows Authenticated Login ID for the ASSEMBLY OWNER.

I can compile BUT NOT DEPLOY

Any help would be greatly appreciated.

Regards Steve

Who is the owner of the database ?

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Hi Thanks for the reply.

I am running with Windows Authentication at the present moment , under the ID Administrator1 (running under windows Vista.(still would like to get reporting services to run Smile ) . I did read the article on "Opening up the Administrator ID in Vista and installing SQL Server 2005 under that ID."

Re my current problem....

I managed to get it to deploy. I assigned Administrator1 as an "owner" of the database and gave the ID security administrator rights. I did the same with Builtin/Administrator.

I found something very interesting. I am able to deploy CLR stored precedures from the Visual Studio environment but not CLR functions. (EXTERNAL ACCESS) In order to deply functions I must compile the Dll and create SQL to CREATE the ASSEMBLYfrom within the SQL Server Environment. Any ideas why.?

Once again thanks for the help? Very much appreciated.

Steve

|||

OK Folks this took me about 3 hours to do BUT I have resolved the problem and it WORKS!!!

BTW I am using SQL Server 2005 Standard and Visual Studio.NET Enterprise

First create a Strong key as described in“The secret of strong naming”

DO NOT DODELAY SIGNING !!!!!!

http://www.ondotnet.com/pub/a/dotnet/2003/04/28/strongnaming.html

Sn – k MyKeyFile.snk

FIND OUT WHERE THE SNK FILE WAS COMPILED.

Go into VS2005 .NET and under project / properties in the signing page click the Sign the Assembly check box and browse to find MyKeyFile.snk

The database page

Mark the assembly for external access and leave the owner blank

Now we must go to the article

http://sqljunkies.com/WebLog/ktegels/archive/2006/08/14/safetydancelite.aspx

The text below comes from this article....Smile

A kinder, lighter Safety Dance for the SQLCLR

A few months ago, I published a step-by-step procedure for using certificate to sign an assembly so an external access or unsafe assembly could be run without having to set the hosting database to trustworthy. The major problem with that process was its weight: a lot of steps and some still requirements in terms of certificate management. Turns out that yes, there is an easier way to make it work.

Part one -- preparing the master database

1. As needed, start a series of queries against the MASTER database.

2. Create the target database (meaning execute a CREATE DATABASE query).

3. Code and compile the assembly you want to deploy. Make sure you sign the assembly with a strong name key file. This can be done with a PFX file generated by Visual Studio.

4. Create an asymmetric key from from the compiled assembly using a statement like this: create asymmetric key <key_name> from executable file = '<path_to_dll_file>'

USE Master

GO

create asymmetric key imageskeyFile from executable file = 'C:\YEAR 2007\Images\Images\bin\Debug\Images.dll'

5. Create a login based on that asymmetric key using a statement like this: create login <login_name> from asymmetric key <key_name>

Use Master

Go

create login ImageMaker from asymmetric key imageskeyFile

6. Grant that login the right to create either or both an unsafe or external access assembly (as needed) using: grant unsafe assembly to <login_name>

Use Master

Go

grant EXTERNAL ACCESS assembly to ImageMaker

Part two -- preparing the hosting database

1. As needed, start a series of queries against the desired user database.

2. Create a user in that database mapped to the login created in part, step 5. (e.g. create user <db_user> from login <login_name>)

3. Give that user the right to catalog an assembly, e.g.: grant create assembly to <db_user>

4. Catalog the desired assembly using the now trusted asymmetric key with a statement like: create assembly <assembly_name> authorization <db_user> from '<path_to_dll_file>' with permission_set = unsafe or external access as shown below

SET QUOTED_IDENTIFIER OFF

USE YEAR2007

GO

CREATE ASSEMBLY Images

AUTHORIZATION ImageMaker

FROM "C:\YEAR 2007\Images\Images\bin\Debug\Images.dll"

WITH PERMISSION_SET = EXTERNAL_ACCESS

GO

Error: Could not get a list of SSIS packages from the project.

Hello,

I have a SSIS package and I am trying to build it using devenv.com from command line. It gives me this error:

Error: Could not get a list of SSIS packages from the project.

However if I open the project in Visual Studio it builds properly. In project property I have set CreateDeploymentUtility=true.

This is what I do from command line:

devenv.com MySSIS.sln /Build "Development|Default"

Any idea what I should do ?

Thanks

Deval

Hello,

There is no solution to it as far as I know if we set CreateDeploymentUtility=true. If you uncheck it then it will work fine.

Thanks

Deval

Error: Could not find stored procedure !!

Hi,

Error: Could not find stored procedure.

I Installed the SQL Server SP2 and the error still occurs when ever I call the stored procedure from my windows app!!

Any Help ?

what's the name of SP you want to call?|||

In design window its : GetMonthRecord;1

in code window its: GetMonthRecord_1

I tried to rename it to : GetMonthRecord

the same error occurs !!

|||

Would you mind running this query and posting the results so that we can get some more information related to the object:

select uid,
left ([name], 30) as [name]
from sysobjects
where [name] like 'GetMonthRecord%'

|||

I run this query:

select uid,

left ([name], 30) as [name]

from sysobjects

where [name] like 'ThisMonthRecords%'

the result is:

1 ThisMonthRecords

|||

Now try:

exec ThisMonthRecords

and post the results

|||

executed succecfully the result is integer:

2

//

I'm facing the problem only with VS2005, when I add the procedure as queryTableAdapter, no error in code, but the error uccours after calling the SP.

error: Could not find SP upd.sp_MSrepl_xxx_xxxxxx_1

Trying to set up replication as follows:

SQL2000 publisher , acting as it's own distributor (v8.0.760)

Transactional Replication with updateable subscriptions

SQL2005 subscriber (v9.00.3042)

Push subscription with immediate updating from distributor to subscriber and queued updating from subscriber to distributor

The set-up went smoothly and changes in the publication db flow down to the subscriber as expected. However, changes at the subscriber fail to flow up to the publisher.

The Queue Reader agent reports the error "Server MyServer, Database publisher_db : ODBC Error: Could not find stored procedure "upd.sp_MSrepl_ins_mytable_1"

The SP 'sp_MSrepl_ins_mytable_1' exists in the publisher db but the owner is 'dbo' not 'upd' (there is no such login as 'upd' on the server)

The only useful article I have found on the net suggests that this could be caused by a bug (jn SP3?) but the situation described in that article and the fix/workaround for it don't seem to apply for me.

The problem and fix in that article was: table MSsubscription agents in the subscriber db had a queue_id value of 'mssqlqueue' and the fix was to set it to 'mssqlqueuev2'.
However, it is already ''mssqlqueuev2' in my subscription db so I'm at a loss to explain why it's still generating calls looking for SPs owned by 'upd'.


other info:

Just to see if it would work around my immediate peoblem I tried creating a user called 'upd' and duplicating the SPs.
This worked up to a point. Changes replicated up to my publisher ok. However, when I created a conflict (changed same row on publisher and subscriber at same time)
the Queue Reader fell over with error: "Server MyServer, Database publisher_db : ODBC Error: Could not find stored procedure "upd.1".
-


Investigated the stored procdure sys.sp_replqueuemonitor in my subscription database and found statements like this:
select publisher, publisher_db, publication, queue_server, queue_id
from dbo.MSsubscription_agents
where
publisher = case when @.publisher is NULL then publisher else UPPER(@.publisher) end AND
publisher_db = case when @.publisherdb is NULL then publisher_db else @.publisherdb end AND
publication = case when @.publication is NULL then publication else @.publication end AND
update_mode IN (2,3) AND
queue_id != N'mssqlqueue'
note that the queue_id is is looking for is 'mssqlqueue'.
If I manually run sys.sp_replqueuemonitor I get no results (unsurprising since the data in dbo.MSsubscription_agents has queue_id='mssqlqueuev2'.

It looks to me as if some of the SPs created when the publication and/or subscription was set up are incorrect...?
--

Any advice or suggestions on how to approach this problem?


Check your article properties, somehow the destination owner must have been changed to "upd" along the way. You can also query sysarticles in your published database to see if this owner exists anywhere. Please let me know if this is not the case.|||

The owner for each article is set to 'dbo'. When it first happened there wasn't a login (or schema) called 'upd' in existence on the either of the publication or subscriber servers.

I'm just trialling this with a very small test db (2 tables) so no one else would be playing around with it. I've also recreated the database and publication from scratch several times with the same result.

I'm thinking it may be a bug or an incorrectly applied service pack (the servers are not under our control, I don't even know who maintains them) .

It's bound to be probably related to the fact that I'm trying to replicate between SQL2000 and SQL2005 servers. I know that merge replication with a SQL2000 publisher and a SQL2005 subscriber is not supported but transactional replication is supported (though I'm not 100% sure that encompases transactional replication with updateable subscribers...)

|||sorry, i totally missed the updatable subscriber part, let me reread your thread and dig in some more.|||

The plot thickens...

If I create a subscriber on the same box as the publisher (i.e. publisher & subscriber are both SQL2000) it all works fine.

If the subscriber is SQL2005 it errors looking for SPs owned by 'upd'...

|||it's most likely a bug then. You're going to have to call customer support and open a case on this one if you want to get this type of scenario to work.|||

Thanks for the help. We've abandoned replication for now (we were trying to retrofit it into an existing legacy tas a temporary workaround which is really more trouble than it's worth)

If we do need to get it working I'll raise it with customer support...

Cheers

Tony

|||My opinion would be to upgrade the SQL 2000 node to SQL 2005 and look into merge replication or transactional replication using Peer to Peer.