|
I done that Execution plan.actually that storedprocedure contains 7 queries....for that execution plan its display query cost one 8% ,another 23% etc....
please can u tell me how we can identify
Raaj
|
|
|
|
|
Its at this point you need to consult the help. Once you understand what the execution plan is telling you it will enable you to make the necessary changes. You can try taking the individual queries and putting them into the "Analyse Query In Database Tuning Advisor" Query menu item. This will give you some hints at what could be done.
Alternativley you could hire someone who understands sql server performance tuning.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
thanks for ur suggestion....
thanks alot
Raaj
|
|
|
|
|
You're welcome. Performance tuning is a complex topic - some would say its more of a black art than science!
Bob
Ashfield Consultants Ltd
|
|
|
|
|
That's true, although I've considered it more like playing chess. Next time I go out consulting this area, I'll take my magic wand with me. It'll make an impression (at least somekind...)
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hi
Help me.
- Use Visual Studio 2005
- As programming language, use C#
Merge SQLite data with HTML template. This action should be done using one 'Merge' button click.
Show merged document in webbrowser.
Save merged document to PDF.
- Merger
Replaces '##[fieldname]##' in the HTML template document with data from the corresponding
column of the SQLite table.
Create one new page in the document for each record in the SQLite table.
Thank you.
Regards,
Och-Erdene
|
|
|
|
|
So what is your problem - all I see is a homework question.
Also you should read the guidlines for posting your title is not acceptable.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
Can somebody guide me on reading a password protected excel file with c#.net?
I am using VS2005, Excel 2003/2007 (? Does it make difference?)
Appreciate your help.
Thanks
Sunitha
|
|
|
|
|
One way to do that is to use Excel interop from C#. Refer to: Workbook Members (2003 System)[^].
Note, this question isn't exactly about databases so perhaps a better forum would have been for example C#[^]
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Get the password from those who protected the worksheet/workbook.
The world is a stage and most of us are desperately unrehearsed.
—Sean O’Casey, Playwright
|
|
|
|
|
Came across this artcile[^] (ROW_NUMBER)
But this is sql specific, while great help I think - if I were to use Sybase then this is not relevant. Is there anything from ADO.NET 2/3 by now? Or do we still need to implement it ourselves?
Reading up on NHibernate[^] - even they have paging facility.
Thanks
dev
|
|
|
|
|
|
Good stuff! - I think this is paging facilitated by ADO.NET (although DataAdapter only, won't help with say IDbCommand+ExecuteReader situation)
<br />
int currentIndex = 0;<br />
int pageSize = 5;<br />
<br />
string orderSQL = "SELECT * FROM Orders ORDER BY OrderID";<br />
SqlDataAdapter adapter = new SqlDataAdapter(orderSQL, connection);<br />
<br />
DataSet dataSet = new DataSet();<br />
adapter.Fill(dataSet, currentIndex, pageSize, "Orders");<br />
Have gone back in time and been doing MFC for two years - when was thsi available in dotnet I don't remember seeing it?
Thanks!
dev
|
|
|
|
|
Also yes seems Sql specific - i.e. IDataAdapter of type "SqlDataAdapter"
Example pattern:
<br />
int currentIndex = 0;<br />
int pageSize = 5;<br />
<br />
DataSet oDataSet = new DataSet("MyData");<br />
DbProviderFactory oDbFactory = System.Data.Common.DbProviderFactories.GetFactory(strProvider);<br />
IDbConnection oConn = oDbFactory.CreateConnection(); oConn.ConnectionString = strConn;<br />
IDbCommand oSqlCmd = oDbProviderFactory.CreateCommand(); oSqlCmd.CommandText = strCmd; oSqlCmd.Connection = oConn; oSqlCmd.CommandTimeout = 10000;<br />
IDataParameter param = cmd.CreateParameter(); param.ParameterName = "@employeeId"; param.Value = 1120; param.Direction = ParameterDirection.Input; cmd.Parameters.Add(param);<br />
IDataAdapter oAdapter = oDbProviderFactory.CreateDataAdapter(); oAdapter.SelectCommand = oSqlCmd; oConn.Open(); oAdapter.Fill(oDataSet, currentIndex, pageSize, "MyData"); ATTN! paging is Sql specific, i.e. oAdapter of type "SqlDataAdapter"<br />
DataView oView = oDataSet.Tables[0].DefaultView; oView.Sort = "Column1, Column2 DESC"; <br />
dev
|
|
|
|
|
Data adapter is implemented for:
- System.Data.Odbc.OdbcDataAdapter
- System.Data.OleDb.OleDbDataAdapter
- System.Data.SqlClient.SqlDataAdapter
- System.Data.OracleClient.OracleDataAdapter
I don't recall seeing paging with ExecuteReader directly. Of course if you implement a stored procedure which returns a result set and take paging position as parameter, you can use that with ExecuteReader.
I think paging has been possible from .Net framework 1.1, see: Paging Through a Query Result[^].
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
to lazy to check each but I bet paging not available to all data adapters
dev
|
|
|
|
|
devvvy wrote: I bet paging not available to all data adapters
Why not. The operation is quite simple since the adapter reads all the records, but returns only those records you define by page settings. Rest of the records are thrown away.
Also this Fill version is defined in the base class (DataAdapter) so every inherited class have this functionality.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hi.
I want to concat some row field in a string.
for example its my view
name id
---- ---
RRR 3
eee 1
ddd 3
i want to pass the id "3" to my function and get the "RRR ddd" as my result.
sepel
|
|
|
|
|
You don't say what's your problem exactly. Create a function where id is passed as parameter and varchar as return type. In the function you fetch and concatenate the strings.
Refer to CREATE FUNCTION (Transact-SQL)[^].
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Tank you.
Mika Wendelius wrote: In the function you fetch and concatenate the strings
My problem is That function.
How i should Fetch rows?
sepel
|
|
|
|
|
|
|
Hi All
I Wount to " Select 15 & 10 " from Pervaisve Version 8 DataBase
But the Pervasive give me Error For The Sql Statment .
How To Do This Sql Statment In Pervasive 8 ?
Thanks for Any body help me
Thaer
|
|
|
|
|
I use the following code to ruturn value
SELECT Tbl_BuildingAggrement.*, Tbl_Building.*, Tbl_BuildCustomer.*, Tbl_Rent_Receipts.*, Tbl_Temple_Registration.*
FROM Tbl_BuildingAggrement INNER JOIN Tbl_Building ON Tbl_BuildingAggrement.BL_Building_Id = Tbl_Building.Build_Id
INNER JOIN Tbl_BuildCustomer ON Tbl_BuildingAggrement.BL_Cust_Id = Tbl_BuildCustomer.BuCust_Id
FULL OUTER JOIN Tbl_Rent_Receipts ON Tbl_BuildingAggrement.BL_Id = Tbl_Rent_Receipts.RntAggId
CROSS JOIN Tbl_Temple_Registration
WHERE Tbl_BuildingAggrement.BL_Building_Id =1 AND Tbl_BuildingAggrement.BL_AggDate between CONVERT(DATETIME, '22/Mar/2009', 102) and CONVERT(DATETIME, '22/Nov/2008', 102)
It display null value ,but i want to display Tbl_Temple_Registration details. that i used in this cross join.
But it didn't display values .What the Solution for this .If cross join return values .
|
|
|
|
|
I seriously think you need to use an inner join. Do some reading on join types.
If you split the selects do they both return results!
If query 1 return 3 records and query 2 return 5 records you will have 15 records in your result set.
You do not need to convert your dates to string to do the filtering, this will work
Tbl_BuildingAggrement.BL_AggDate between '22/Mar/2009' and '22/Nov/2008'
Never underestimate the power of human stupidity
RAH
|
|
|
|