Showing posts with label returns. Show all posts
Showing posts with label returns. Show all posts

Thursday, March 22, 2012

ASYNC_NETWORK_IO issue

I am running a Stored procedure which select from a table and returns approx 800000 records. When calling from any client machine it takes long time to return the result (90 sec). It waits for ASYNC_NETWORK_IO which is pushing the result to client. If select statement is used with TOP operator to return less number of records it executes faster. When calling from the server the stored proc returns data in 13 sec with all records. In another machine of identical HW and configuration this problem is not there. Can anyone help how to improve ASYNC_NETWORK_IO issue?

SQL-2005 SP1 64 bit Standard on Active/Passive cluster
Windows -2003 Ent.


Thanks
-Ashis

Hi, Ashis,

Did you encounter this problem during replication? If not, can you please post your question to "SQL Server Database Engine " or "Transact SQL" alias? That way, you have a better chance of getting an answer.

Thanks,

Zhiqiang Feng

Tuesday, March 20, 2012

Association Prediction by Rules Still Returns Itemsets

If I use this code with an association model, it still returns itemsets for me - when it should be returning only nodes with rules associated with them (according to sqlserverdatamining.com). If I try adding 'AND $PROBABILITY > .25' to the where clause, it returns 0 results for every query I try. Any clue why this may be happening?

Code Snippet

SELECT FLATTENED
(SELECT * FROM PredictAssociation([Product],20,
INCLUDE_NODE_ID,INCLUDE_STATISTICS)
WHERE $NODEID<>'')
FROM
[ProductRecommend]
PREDICTION JOIN
OPENQUERY([ds],
'SELECT
[PRODUCTCLASSID],[DESCRIPTION]
FROM
[Product_Table]
WHERE
[PRODUCTCLASSID] = ''1234'' AND [DESCRIPTION] = ''DESC''
') AS t

ON
[ProductRecommend].[Product].[PRODUCTCLASSID] = t.[PRODUCTCLASSID] AND
[ProductRecommend].[Product].[DESCRIPTION] = t.[DESCRIPTION]

This query returns more relevant results than those lacking the filtering by $NODEID, however the results should have higher probabilities than .047! Please help! Thanks!

Okay, I just reconstructed the same query using my data in a relational mining model (instead of OLAP) and got reasonable results. Would anyone know how to fix this for OLAP or be able to point me in a direction where I could go to learn how to do it? Thanks.

|||What is the MINIMUM_PROBABILITY value for the OLAP mining model?
Is it different than the one from the relational model?

One more thing (which you probably know already) -- the query you posted initially executes one prediction (PredictAssociation ... 20) for each row in the data source query (does not group together multiple input rows belonging to the same transaction).
Basically, only rules having a single item on the left hand side will be used in prediction.

Saturday, February 25, 2012

Assembly MyAssembly was not found in the SQL catalog of database MyDB

I’m trying to register my CLR UDF in SQL 2005 using this code

CREATE FUNCTION GetSomething() RETURNS INT

AS EXTERNAL NAME MyAssembly.MyFunction.MyMethod

When I run it against my DB I get this error:

Assembly MyAssembly was not found in the SQL catalog of database MyDB

I’ve successfully registered my custom assembly in the DB (I see it under Assemblies folder), and I’ve set CRL Enabled to 1 in my DB.

What am I doing wrong?

Thanks in advance

A couple of things:

1. make sure that the CREATE FUNCTION call is actually executed in the database where MyAssembly is located.
2. Make sure that you spell the name correctly of the assembly

if both of those are OK:
1. then check that you do not have any namespaces in the class name. For example, VB injects a namespace into the assembly, so the class name would be [namespace.classname].
2. make sure that the classname and method name are capitalize correctly - they are case sensitive.

Niels

|||I have same problem and I do deployment using Visual Studio .NET 2005 final release, it is as nightmare to see these outstanding bug free products ...

Assembly MyAssembly was not found in the SQL catalog of database MyDB

I’m trying to register my CLR UDF in SQL 2005 using this code

CREATE FUNCTION GetSomething() RETURNS INT

AS EXTERNAL NAME MyAssembly.MyFunction.MyMethod

When I run it against my DB I get this error:

Assembly MyAssembly was not found in the SQL catalog of database MyDB

I’ve successfully registered my custom assembly in the DB (I see it under Assemblies folder), and I’ve set CRL Enabled to 1 in my DB.

What am I doing wrong?

Thanks in advance

A couple of things:

1. make sure that the CREATE FUNCTION call is actually executed in the database where MyAssembly is located.
2. Make sure that you spell the name correctly of the assembly

if both of those are OK:
1. then check that you do not have any namespaces in the class name. For example, VB injects a namespace into the assembly, so the class name would be [namespace.classname].
2. make sure that the classname and method name are capitalize correctly - they are case sensitive.

Niels

|||I have same problem and I do deployment using Visual Studio .NET 2005 final release, it is as nightmare to see these outstanding bug free products ...

Sunday, February 12, 2012

ASP.Net dev site not running using ASPNET account?

VS2005

Hi

If I run the below code (this simply connects to SQL Server and returns the user name the connection is made under):

 Dim ConnectionAs New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("LocalSqlServer").ToString)Dim AttCommandAs New SqlCommand("SELECT System_USER", Connection) Connection.Open()Dim AttendanceReaderAs SqlDataReader = AttCommand.ExecuteReader AttendanceReader.Read() Debug.Print(AttendanceReader.Item(0).ToString)
I get:

MyDomain\pootle.flump

Which is the account I am running on the dev machine. I expected ASP.Net to run as ASPNET irrespective of the currently logged in account. Am I plain wrong? Do I need to change something in IIS? Do I need to change something in ASP.Net?

Any help greatly appreciated

Thanks

VS2005 by default uses a local web server running under your account, rather than a web site running under IIS. This is a change from VS2002/2003.

|||

Thank you

You say this is default - is there a way to change this?

|||

Hi

Does anyone know how to (or if I should be...) run the site (on dev machine) using the ASPNET account?

Thanks