Monday, March 26, 2012
Link server very slow
Server Type : Microsoft OLE DB Provider for Oracle
Product name : ora
Data Source : sapdbproduction
Provider string : MSDAORA
Compare query response time (1 record)
PL-SQL : 0.5 sec
SQL Query Analyzer : 1.4 minute
How can i do?
Thanks in adv.Hi
Post the DDL and DML.
Regards
Mike
"teera" wrote:
> I created a link server to 'oracle', properties is below
> Server Type : Microsoft OLE DB Provider for Oracle
> Product name : ora
> Data Source : sapdbproduction
> Provider string : MSDAORA
> Compare query response time (1 record)
> PL-SQL : 0.5 sec
> SQL Query Analyzer : 1.4 minute
> How can i do?
> Thanks in adv.
>
>|||Mike
What is DDL and DML? Please explain me more?
Thanks
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:68EECFB8-4739-4277-A78A-A21F3F6CA33B@.microsoft.com...
> Hi
> Post the DDL and DML.
> Regards
> Mike
> "teera" wrote:
>> I created a link server to 'oracle', properties is below
>> Server Type : Microsoft OLE DB Provider for Oracle
>> Product name : ora
>> Data Source : sapdbproduction
>> Provider string : MSDAORA
>> Compare query response time (1 record)
>> PL-SQL : 0.5 sec
>> SQL Query Analyzer : 1.4 minute
>> How can i do?
>> Thanks in adv.
>>|||DDL = Data Definition Language. It's basically the schema of the
associated DB objects (table(s), index(es), view(s), trigger(s), etc.).
DML = Data Manipulation Language. It's the queries that you're running
against those DB objects (SELECT, INSERT, UPDATE, DELETE). The queries
about which you say the response time through the linked server is slow.
Basically, nobody can help you if you don't give any details about the
problem. To help we'll need to see things like execution plans,
indexing of search arguments, etc. We can't do that if we don't know
what your schema looks like and what query you're trying to execute
against that schema. It's possible that the entire table data is being
sent from the Oracle box to the SQL box (through the linked server) and
then any WHERE clause is being applied (which would explain the slow
performance through the link but not direct to Oracle) but we can't tell
if you don't show us the schema & queries involved.
Cheers,
Mike.
teera wrote:
> Mike
> What is DDL and DML? Please explain me more?
> Thanks
> "Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
> news:68EECFB8-4739-4277-A78A-A21F3F6CA33B@.microsoft.com...
>>Hi
>>Post the DDL and DML.
>>Regards
>>Mike
>>"teera" wrote:
>>
>>I created a link server to 'oracle', properties is below
>> Server Type : Microsoft OLE DB Provider for Oracle
>> Product name : ora
>> Data Source : sapdbproduction
>> Provider string : MSDAORA
>>Compare query response time (1 record)
>> PL-SQL : 0.5 sec
>> SQL Query Analyzer : 1.4 minute
>>How can i do?
>>Thanks in adv.
>>
>
>
--
ÿþC
Wednesday, March 21, 2012
Linear Regression and tolking the coefficient for each variabel?
When using linear regression in the SQL Server 2005 Business IntelIigence Studio I interpet the information below as follow: X has a standard deviation of +- 37.046. Is it possible to obtain the standard deviation of each coefficient in the regression expression?
You can get the variance of the coefficients from node_distribution of linear regression root node. The following DMX query will return the information you need:
select flattened Node_Distribution from [Model Name].Content where Node_type = 25
The query result is a DataTable with the following column names:
Node_Distribution.ATTRIBUTE_NAMENode_Distribution.ATTRIBUTE_VALUE
Node_Distribution.SUPPORTNode_Distribution.PROBABILITYNode_Distribution.VARIANCE
Node_Distribution.VALUETYPE
And the data rows will look like this:
C5Missing00.007874015748031501
C5228.58812310000.99212598425196997913.5033
C431.9528749318584006.737398583630157
C432.1589801071577000 8
C45.29710479474068006.737398583630159
59.33039676663630090944.677980779511
The rows with a value type 7 (emphasized in above table) contain the information you need. You might need to write a small C# program to iterate through the resulting datable to get the information you want.
Thanks,
Linear Regression and tolking the coefficient for each variabel?
When using linear regression in the SQL Server 2005 Business IntelIigence Studio I interpet the information below as follow: X has a standard deviation of +- 37.046. Is it possible to obtain the standard deviation of each coefficient in the regression expression?
You can get the variance of the coefficients from node_distribution of linear regression root node. The following DMX query will return the information you need:
select flattened Node_Distribution from [Model Name].Content where Node_type = 25
The query result is a DataTable with the following column names:
Node_Distribution.ATTRIBUTE_NAMENode_Distribution.ATTRIBUTE_VALUE
Node_Distribution.SUPPORTNode_Distribution.PROBABILITYNode_Distribution.VARIANCE
Node_Distribution.VALUETYPE
And the data rows will look like this:
C5Missing00.007874015748031501
C5228.58812310000.99212598425196997913.5033
C431.9528749318584006.737398583630157
C432.1589801071577000 8
C45.29710479474068006.737398583630159
59.33039676663630090944.677980779511
The rows with a value type 7 (emphasized in above table) contain the information you need. You might need to write a small C# program to iterate through the resulting datable to get the information you want.
Thanks,
sql
Monday, March 19, 2012
Line 1: Incorrect syntax near =
I'm getting the above error when i try to fill a Dataset through a
dataAdapter.
I presume it is to do with the sql statement. Below is the relevant
code:
string strPntUnitID = patientCodeLbl.Text;
string strPntFName = fNameLbl.Text;
string strPntLName = lNameLbl.Text;
// Create DataAdapter & Dataset
SqlDataAdapter daRelateDocToPnt = new SqlDataAdapter("SELECT patientNo,
doctorNo FROM tblPatient" +
"WHERE (pntUnitID = '"+ strPntUnitID +"') AND (pntFName = '"+
strPntFName +"')"+
"AND (pntLName = '"+ strPntLName +"')", conn);
DataSet dsDocNoToPnt = new DataSet();
// Create command builder, automatically generates the update commands
SqlCommandBuilder pntCmd = new SqlCommandBuilder(daRelateDocToPnt);
// Set the MissingSchemaAction property to AddWithKey because Fill will
not cause primary
// key & unique key information to be retrieved unless AddWithKey is
specified.
daRelateDocToPnt.MissingSchemaAction = MissingSchemaAction.AddWithKey;
// Use dataAdapter to fill DataSet
daRelateDocToPnt.Fill(dsDocNoToPnt, "Patient");
// place intDocNo into the dataset schema
dsDocNoToPnt.Tables["Patient"].Rows[0]["doctorNo"] = "intDocNo";
// Update The Database
daRelateDocToPnt.Update(dsDocNoToPnt, "Patient");
Can anyone spot the problem?
ThanksAt a quick glance, it seems that you have no space between tblPatient
and WHERE, but without seeing the actual command, it's hard to say. If
you build a SQL string dynamically, it's a good idea to provide a debug
mechanism - perhaps you can build up the string first and display it,
then instantiate the adapter using the string?
You might also want to consider writing a stored procedure to return
the results, and pass the ID and names as parameters.
Simon|||Thanks Simon , your quick glance worked, the space was the problem.|||Assimalyst (c_oxtoby@.hotmail.com) writes:
> I presume it is to do with the sql statement. Below is the relevant
> code:
> string strPntUnitID = patientCodeLbl.Text;
> string strPntFName = fNameLbl.Text;
> string strPntLName = lNameLbl.Text;
> // Create DataAdapter & Dataset
> SqlDataAdapter daRelateDocToPnt = new SqlDataAdapter("SELECT patientNo,
> doctorNo FROM tblPatient" +
> "WHERE (pntUnitID = '"+ strPntUnitID +"') AND (pntFName = '"+
> strPntFName +"')"+
> "AND (pntLName = '"+ strPntLName +"')", conn);
Rather than building the entire command this way, use parameterised
commands:
"SELECT patientNo, doctorNo FROM tblPatient " +
"WHERE (pntUnitID = @.PntUnitID AND (pntFName = @.strPntFName " +
"AND (pntLName = @.PntLName "
The use the parameters collection on the command object to define the
parameter.
If you wonder why, try your current code with someone whose last name
is O'Brien.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp