DataSource Controls :: Optimize My Sql Query In Sql 2005?

Mar 23, 2010

I am working on a project where in one SQL query i am using joins to fetch data from diffrent tables. The execution time of the query is 20 seconds for 80 rows on my local server. How can i optimize this.

View 3 Replies


Similar Messages:

DataSource Controls :: How To Optimize Query With Multiple Inner Joins

Mar 22, 2010

I have one question regarding how to make the below mentioned type of query more optimized so that mine query perfomace can be increased.

Select a.name1,a.address1,b.field3,c.field4,d.field6,e.field7
from a
inner join b on a.id=b.id
inner join c on c.id=b.id
inner join d on d.id=c.id
iner join e on e.id=d.id
union all
Select a1.name1,a1.address1,b1.field3,c.field4,d.field6,e.field7
from a1
inner join b1 on a1.id=b1.id
inner join c on c.id=b1.id
inner join d on d.id=c.id
iner join e on e.id=d.id
union all
Select a2.name1,a2.address1,b2.field3,c.field4,d.field6,e.field7
from a2
inner join b2 on a2.id=b2.id
inner join c on c.id=b2.id
inner join d on d.id=c.id
iner join e on e.id=d.id

All the above three select query at last using the same inner join condition, means last two inner join condition are the same for all the select query.

Is there any way so that this query can be optimized?

View 2 Replies

DataSource Controls :: Running SQL Query From SQL Management Studio - Optimize?

Jun 29, 2010

I have one query which is not responding even after 4 minutes. But same query is when called from asp.net pages (though stored procedure), responds within 10 seconds. My Query:

[Code]....

I don't want to know the ways to optimize the query as I have already changed the query and now it responds within fraction of second. I just want to know that, why it was not reponding after 4 minutes in SQL Management Studio and responds in just 10 seconds when run from asp.net through stored procedure. I am using SQL 2008 Express with Advanced services and .NET 3.5.

View 4 Replies

DataSource Controls :: Update Query With Sql Server 2005?

May 2, 2010

I have select query like this :

[Code]....

View 2 Replies

DataSource Controls :: Sqlserver 2005, Distinct Query Result Options?

Jul 8, 2010

i need record with id 1 and 3 only how do i get in sql server 2005.(means distinct empcod onl.

View 3 Replies

DataSource Controls :: How To Write Query Using Pivot Logic In Sql Server 2005

Jan 7, 2010

i have a table for customer forecast which contains customer, week number and quantit as columns. now i need to write query and list the week as column for each customer and each cell should have a quantity. how to write query for this using pivot logic. i dont want to use cursor.

View 3 Replies

DataSource Controls :: Select Query Doesn't Work When Data Is Present In Arabic MS Sql 2005

Jan 26, 2010

This query does not return any record

[code]....

View 3 Replies

DataSource Controls :: SqlDataSource And Parameters Query / Trying To Accomplish Is Building Dynamic Query

Aug 22, 2010

1. I have a GridView on my page and it uses sqldatasource with parameterized query. What I want to do is, on page load (where nothing has been selected so no parameter supplied), I want it to query everything (something like SELECT * FROM [this_table]) but since my SelectCommand is something like

SELECT * FROM [this_table] WHERE [this_column] = @someParameters AND [that_column] = @someParameters.

Can I play around with default value to achieve something like that but how ? Now, when the page loads, it doesn't show anything (No Gridview).

2. On my page, I made something like (username, gender, address, and more) and one single search button. That means, no single control enable auto postback. What I am trying to accomplish is building dynamic query

(if username specifed -> SELECT * FROM [this_table] WHERE [username] LIKE @username).

If both username and gender are specified (SELECT * FROM [this_table] WHERE [username] LIKE @username AND [gender] = @gender) and you know the rest. How can I do this using GridView and SqlDataSource ? To my knowledge, I can only specify one SELECT statement in a sqldatasource.

View 11 Replies

DataSource Controls :: Update Query Not Working When Using Query Builder To Configure Table Adapter

Jan 15, 2010

[code]...

This query works perfectly on the query analyser.

But when configuring the Table adapter ,I try executing the query and i get 0 rows affected.

What could I be getting wrong in this case.

NB:Existing GalleryID has been supplied.

View 1 Replies

DataSource Controls :: Can't Find Query's / By Right Clicking On Database Created A Query In Server Explorer?

May 17, 2010

By right clicking on my database i created a query in server explorer. But where are this query stored can't find them back. I should aspect that their is a folder query's like there is a folder tables but this isn't the case.

View 10 Replies

DataSource Controls :: How To Convert Sql Query Into Linq Query

Mar 10, 2010

select Groupid,GroupName,onorusername from palgroup where groupid in (select distinct Groupid

View 5 Replies

DataSource Controls :: Accessing FK From A Query Via Entity Query

Jan 21, 2010

I've got a query such as

Dim MediaQuery =
From m
In dB.DOWNLOADS _Where m.ID = id _Select

which returns a record from the database. One of the fields in the record is a FK to another table. I need to read this value to be able to set a dropdown based on the ID but I can't work out how to access it. For a standard record I can just do the following txtTitle.Text = MediaQuery.FirstOrDefault().TITLE

However with the foreign key it doesn't work like that. I've tried drpGroup.SelectedIndex = MediaQuery.FirstOrDefault().DOWNLOAD_GROUPS.ID where DOWNLOAD_GROUPS is the FK field but it returns Object reference not set to an instance of an object. If you're simply wanting to read some values from a single db record in the entitiy framework and one is a foreign key how should I go about getting the value?

View 2 Replies

DataSource Controls :: Sql Server 2005 Installation / Want To Go Back To Sql Server 2005?

Feb 3, 2010

i had the sql 2008 enterprise and i want to go back to sql server 2005 because in 2008 i created new database but when i did some changes in the table , it gave me an eror that i cant save thins and i need to creat new one if some one know what i'm talking aboutif not i need the sql server installation tutorial i tried by myself but probebly i did it wrong and now i cant connect well to the sql

View 2 Replies

Forms Data Controls :: Database Query For SQL 2005 Using C#.NET For 3 Field Values

Apr 28, 2010

How to query a SQL database with 3 field values ( From date, To date and based on a Dropdown Selection)

I use the below code:

sqls = "SELECT * FROM QlyData where Date >='" + txtstartdate.Text +
"' and Date<='" + txtenddate.Text +
"' and '" + supportgrp.Text +
"'";

Supportgrp.text is a Dropdown selection.I get the below error:

Exception Details: System.Data.SqlClient.SqlException: An expression of non-boolean type specified in a context where a condition is expected, near 'Database'.

View 2 Replies

DataSource Controls :: Downgrade .mdf To Us Eit In Sql 2005?

Mar 18, 2010

in sql 2008 .mdf file detached and attached db in sql 2005.

View 1 Replies

DataSource Controls :: Converting A DB In SQL 2005 To SQL 2008?

Jul 6, 2010

We currently have a DB in SQL 2005 and would like to convert it to SQL 2008 taking advantage of all the new features (if there are any) in SQL 2008. Would like to know the best approach or if there are any tools which can convert all the tables/views/storeprocs etc to 2008 specifications...

View 6 Replies

DataSource Controls :: SQL Server 2005 Synonyms?

Feb 25, 2010

Is there any way to alter or modify the synonyms in SQL Server 2005 (either using SQL Server Management Studio or T-SQL)

View 1 Replies

DataSource Controls :: Invalid Directory In Sql 2005

Jan 13, 2010

When i open a table in Sql 2005 i get an error Invalid directory

View 1 Replies

DataSource Controls :: Installing Sql Server 2005?

May 9, 2010

1 - Visual studio 2008 is already installed with sql server 2005 express edition installed implicity with it.

2 - Sql server 2005 management studion Express Edition is already installed.

3 - Today, I downloaded the one with Advanced Services and installed it but it did not compledte installation

A) [URL]
B) [URL]
C) [URL]
D) [URL]

View 4 Replies

DataSource Controls :: SQL Server 2005 Constraint?

Apr 24, 2010

let say i have 2 table (PARENT and STUDENT table)

the structure for both table are

STUDENT
PARENT
student_id (PK) parent_id (PK)
student_parent (FK) parent_status (the value is either ACTIVE OR INACTIVE)

- parent_id is refer by STUDENT table as a foreign key

- now i want to inactive the status for parent

- i want my system pop out a message something like "The parent you want to inactive is refer by a student, inactive is not allow"

- is it any constraint in SQL Server 2005 to help me check whether parent it is refer by student table? The concept i want to use is something like delete constraint in SQL Server 2005 mean it is not allow to delete a person who is refer by a student in STUDENT table.

View 9 Replies

DataSource Controls :: Saving Images To SQL 2005?

Mar 25, 2010

I have a work request web page that now has a need for my users to add screenshots to.

View 2 Replies

DataSource Controls :: Data MASKING In Sql 2005?

Apr 20, 2010

I have a requirement where in i need to do DATA MASKING, of the data in all the tables in my project.Please suggest me the ways to do this, as the masking procedure should not make any changes to the RULE's.For ex:- EMPLOYEE table , have fields like {empl_id, name, addrs, ph_no, email, dept_id} all the contents of these columns should be shuffled in such a way that all the referential intergrity remains same. Like the changes to the data should not affect the DEPARTMENT table , as the EMPLOYEE table is having a FOREIGN KEY relation with the DEPARTMENT.

View 1 Replies

DataSource Controls :: File/library For SQL 2005?

Feb 5, 2010

can any1 provide me a link to download set up file for help on sql server 2005. like msdn offline libraries..

View 2 Replies

DataSource Controls :: Sql 2005 COLLATE Charset ?

Mar 14, 2010

When I select

SELECT CAST('uyarı' AS varchar(200)) COLLATE Turkish_CI_AS

it returns me as uyari

simply it converts ı to i

But I do not want it. If I insert it into database manually it inserts but when I try to insert from stored procedure it does not.

View 6 Replies

DataSource Controls :: Tring To Connect To Db In Sql Server 2005?

Mar 26, 2010

i am tring to connect to my db in sql server 2005 :) and have some problem with it.the error that i get is : Keyword not supported: 'datasource'.the line that i have an error is :

[Code]....

my code is simple:

[Code]....

View 11 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved