.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

find situation about a query that it is executing now

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :Sql Server
 
Hi all. I am a c# programmer. I have a update query that it need 2 minutes for executing (for each reason). I don't want discuss about its performance. My question is: How can I find situation about a query that it is executing now and it has not executed completely yet. for example How can find my c# code how many records are affected by my query every 10 seconds while that query is executing? Is sql profiler says that to us?


View Complete Post


More Related Resource Links

situation about a query that it is executing

  

Hi all. I am a c# programmer. I have a update query that it need 2 minutes for executing (for each reason). I don't want discuss about its performance.

My question is: How can I find about situation about a query that it is executing now and it has not executed completely yet. for example How can find my c# code how many records are affected by my query every 10 seconds while that query is executing? Is sql profiler says that to us?


situation about a query that it is executing now

  
Hi all. I am a c# programmer. I have a update query that it need 2 minutes for executing (for each reason). I don't want discuss about its performance. My question is: How can I find situation about a query that it is executing now and it has not executed completely yet. for example How can find my c# code how many records are affected by my query every 10 seconds while that query is executing? Is sql profiler says that to us?

Find SQL Query when report is executed

  
Hi All, I am using SSRS 2008 R2 verison of reporting services. I have a report and the data source for this report is Oracle 10i, it takes around 2 mins to execute the report. I want to find out the query, which is sent by the reporting services to the Oracle. Is there a way to find it out. Please help me with this. Thanks Vineeshvineesh1701

SQLDataAdapter/SQLDataReader takes lot of time for executing a query

  
All, I have a webpage with 6 drop down lists. User can start with selecting any drop down list first, and then proceed in any order.  1. Assume when the 1st dropdown is selected first, rest 5 drop downs (except 1st) are filtered/updated based on the selected value in the 1st dropdown. 2. Assume user selects the 4th dropdown second, rest 5 drop downs (except 4th) will be filtered/updated but the condition would be based on both 1st drop down and 4th drop down. But while filtering the first drop down, only the 4th drop down is used as filter (self-filter will be ignored). The code works fine but I see a very bad performance hit in time when the user selects the fourth dropdown after selecting three drop downs. I tried using both SQLDataAdapter and SQLDataReader but neither used to solve the issue. The code takes a lot of time on one line in either of the code (which is highlighted below). When I run the query in SQLServer Mgmt Studio, the query completes in a few seconds.Using SQLDataReader: SqlConnection conn = new SqlConnection(CONNECTION); SqlCommand ObjCmd = new SqlCommand(query, conn); ObjCmd.CommandTimeout = 600; conn.Open(); SqlDataReader daSelTools = ObjCmd.ExecuteReader(); //This line takes a lot of time ddl.Items.Clear(); // Call Read before accessing data. while (daSelTools.Read()) { ddl.Items.Add(new ListItem(String.Format("{0}",daSelTools[0])));

Please help me to find out distinct value from linq to sql query given.

  
profileuserDataContext db = new profileuserDataContext(); var Q = (from p in db.edufinals join RM in db.edufinals on p.UserName equals RM.UserName where p.name.StartsWith(srcval) select new { p.name, RM.ProfielID, RM.ProfielPic, RM.city }).OrderBy(x => x.name).Distinct().Take(10);//, p.Key.ProfielID, p.Key.ProfielPic, p.Key.city, p.Key.country foreach (var pg in Q.Distinct()) { Response.Write(pg.name); ..................................... .................................... } how to refine this query to get distinct "name" column? Please help me to find out exact value.

MDX Query - Find only new item that purchased in the last day or during the last week

  
Hi to all I whould like to write a MDX query to get new items that purchased in the last day and not purchased in the last 7 days or 30 days  , Also to find new items that purchased in the last 7 days and not purchased in the last 30 days , this is what i done until now CREATE   SET CURRENTCUBE.[FindNewWordIn_1_Day]   AS Filter   (nonempty([Keyword].[Keyword Name].members, ([Measures].[Count keyword],   NONEMPTY (Tail( Filter( [Time].[Date].MEMBERS ,   Not IsEmpty ([Measures].[Count keyword]) ), 1) ))) ,([Measures].[Count keyword], [Time].[Date].&[2010-09-10] )=0);   The value of [Time].[Date].&[2010-09-10] should be change to period that i want to check , ( 1 day, 7 day , 30 day)   the other one is lateset day with value NONEMPTY (Tail( Filter( [Time].[Date].MEMBERS , Not IsEmpty ([Measures].[Count keyword]) ), 1) with for you help ,   ofer  

VWD 2010 and Linq to Sql: can't find a query model for...

  

Hello!

I have added a linq to sql layer in my MVC 2 application.

This is the code I am using:


using (ProductPortalDataContext ctx = new ProductPortalDataContext())
            {
                var Title = from aps in ProductPortal.Models.AppSettingsView
                            where aps.LanguageID = Lang
                            select aps.WebSiteTitle;
            }


It says to be unable to find a quey model for AppSettings view and then says "where not found".

Tried googling, nothing came up. Tried searching here(first two pages) and nothing that seemed relevant popped up.

But the best of all, created a new ASP.NET applicatio, imported the model using Linq to SQL and it compiled!

No idea what I am doing wrong... hints?

(some time later...)

Ok, I tried adding a button and a label to the asp.net application j

SPView query to find if the current user belongs to a Group

  

HI All,

I´m trying to write a query for a list view that should return all items if the current user belong to a group. If the user doesn´t belongs to this group, no items should be returned.

So far, I could find many equal examples about using the CAML Membership element in a comparison with an AssignetTo field. But not making a comparison between the current user and a specific Sharepoint Group.

Any suggestions, please?

Thanks



Not identifying Sql Quote when executing query

  

Im using SQL Server 2008 R2, Server version 9.0 SP3

Im trying to do a replace on a comma seperated values before submitting to the "IN" condition.

Declare @inputrecords nvarchar(max)
Declare @inputrecordscsv nvarchar(max)
set @inputrecords = N'a,b,c'
set @inputrecordscsv = ''''+ replace(@inputrecords, ',', ''',''') + ''''

select * from MyTable
where Mytable.Record IN (@inputrecordscsv)
My intension is to get query work like this:
select * from MyTable
where Mytable.Record IN ('a','b','c')
But its not working, and its considering the @inputrecordscsv as a single string.
Any suggestions how to make it work?
 
Thanks
Sunny


 

 


asking for information about query situation

  

Hi all engineers.

I have an important trigger in my data base. It effects many many records so it need many much time for 4 or 5 minutes.

I want to show it's situation into bottom of my web page. for example every 10 seconds, it say how many records is affected?

or I want to show situation of every query. what is way?


How do find what query is being executed on specific session ID?

  

Hello,

I have a SP which writes to a table all processes which are being executed when application decides to stop waiting for results of the query. It works very well but problem is that it does not dump all SPIDs but only some of them which are being executing for a long time. Common pattern that a lot of SPIDs will be blocked by single SPID which will not be part of the output which is being generated. How do I dump all SPIDs and what they are doing along with SP below?

 

SELECT 
 t1.resource_type,
 'database'=db_name(resource_database_id),
 'blk object' = t1.resource_associated_entity_id,
 t1.request_mode,
 t1.request_session_id,
 t2.blocking_session_id,
	 t2.wait_duration_ms,

 (SELECT SUBSTRING(text, t3.statement_start_offset/2 + 1,
 		(CASE WHEN t3.statement_end_offset = -1 
 			THEN LEN(CONVERT(nvarchar(

see query situation

  

Hi all. I have a hage query that effects very very record. this query needs 3 minutes time for execute (in each reasons). I don't want discuss about its performance.
my question is: I want to see query situation and find how many records are affected in every 30 seconds.

while query is executing now and has not executed completely yet.

what should I do? Is it possible to do this?

do query or trigger says his situation with us?


situation about a query

  

Hi all. I am a c# programmer. I have a query that it need 2 minutes for executing (for each reason). I don't want to discuss about its performance.

My question is: How can I find situation about a query that it is executing now and it has not executed completely yet . for example How can my c# code find how many records are affected or percent_complete by my query every 10 seconds while that query is executing? Is sql profiler says that to us? I used "sys.dm_exec_requests" and "percent_complete" column, but it shows 0. what should I do?


Xpath query to find an Node who's attribute contains a forward slash - Going crazy

  

If  I have a .XML file that contains the following example:

<Socks Style ="Business/Business Casual/Casual"

</Socks

When I try to use the Xpath expression below to find the element above by searching for the value contained in the Style Attribute, the expression returns null:

//Socks [@Style='Business/Business Casual/Casual'] 

I downloaded xPath virtualizer and I noticed that the expression above is adding the namespace alias when it finds the embedded forward slash contained in the value of the Style Attribute (which is of course not what I want to happen).  This is driving me up a tree!!  Isn't there a way to escape the forward slash?  I know it is the slash that is the problem because for testing purposes I substituted dashes (-) in one of the nodes' Style Attribute values and then changed the xpath expression to match and it returned the exact node.

My goal is to do some replacements on all elements with the Style attribute based on each contents but I can't even try that because of this roadblock.

Please help anyone

-Rick

 


executing query in send mail task

  

Hello,

I need to execute a select statement in a send mail task in SSIS. I can send regular emails using this task, but is is possible to send a select statement through? I have tried xp_sendmail, but we are not allowed to turn this feature on, and  I have tried reporting services, but the service is not installed. Lots of road blocks... LOL

 

If this is not possible, please recommend an alternative...

Any help would be appreciated

Dave


Dave SQL Developer

How to find records based on CAPITAL and small letters in SQL Query?

  

Hi,

I stumbled upon this scenario at my work and it is really something I was not expecting. I know that in general SQL itself is not a CASE SENSITIVE language ... so it will not make any difference if i write select *, or SELECT * or SeLEct * ...

But recently I came across a situation where I am required to find results from a table where more than one record exists with just a difference of Captial and Small letter word. Let me explain my problem in detail,

I work for a government client, in one of their table they have list of all state statues and out of them some have exactly same string except in that string some letters are capitalized, e.g.  46b-12 (A) and 46b-12 (a) ... now my question is how can i write a query which can find only record that I search, e.g if I search select desc from statues where code='46b-12 (a)' ... it should find only one record not two.


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend