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


Similar Messages:

DataSource Controls :: Running Sql Server Management Studio?

Aug 11, 2010

I am having a problem connecting to my SQL Server 2008 Express database with SQL Management Studio Express and from the website at the same time.

Everytime I want to view any pages in my site that access the database, I have to close management studio and restart the server for some reason or i get a failed login error message. Then when I want to go back to SSMS I get this error message:

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

Additional Information: Unable to open the physical file c:..... Operating system error 32: "32(The process cannot access the file because it is being used by another process.)" (Microsoft SQL Server, Error: 5120)

Is it NOT possible to work on the database through SSMS at the same time as viewing pages in the website that access the database?

I sure hope that there is a work around or something for this.

Just in case my connection string is:

<add name="ApplicationServices" connectionString="data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />

View 5 Replies

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

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 :: Advanced SQL Query - Drive Running Out Of Space

Jan 25, 2010

I have a query which is returning records like below which returns a list of tasks with a corresponding task type. there is a task table (wh_task) and a task type table (wh_task_type). What i want to achieve is a count of all the tickets per ticket type. So at the end of the query i will have a total for Administration / Maintenance tasks (1) and a total for Routine Maintenance Tasks (3). ** and all the other types *

There are many different types of task type so I dont want to have to hard code it. Can count all the occurencies of the different ticket types.

Task Name
Task Type
Date Completed
SBS Server C drive running out of space
Administration / Maintenance
16/07/2007 16:03:34
Patching Server(s).
Routine Maintenance
08/01/2009 06:51:56
Patching Server(s).
Routine Maintenance
11/02/2009 10:06:06
Patching Server(s).
Routine Maintenance
04/05/2009 06:53:24

I can also get wh_task_type_id.

Here is my SQL:

[Code]....

View 8 Replies

How To Optimize The Performance Of A Thread Running In Background

Feb 4, 2011

In my website, I am using thread to perform a repetitive process in background. Now the process takes around 30 to 45 seconds to update the database.

Basically the function performs the following:

1) Download the CSV from a website.

2) Parse the CSV and update the database tables.

I want to optimize the performance and decrease the time it takes to 15 seconds.

How can I do this?

EDIT:

Here is the Code:

[code]....

View 1 Replies

DataSource Controls :: SQL Server Management Studio Connect Over The Web?

Apr 22, 2010

I have been given a .NET type web hosting by my provider along with MSSQL. I am learing what that means and how to use it. Can I use my SQL Server 2008 Management Studio to connect to that SQL over the internet in order to put my database on the web? or how else can I use it?

View 1 Replies

DataSource Controls :: Login SQL Server Management Studio

Jan 8, 2010

I have just installed SQL Server 2005 on windows7. It was installed successfully. When I tried to open SSMS it became faild. It gives me SQL Server Error :18456 Login Failed. How can i find what server name I put to login? Because when It prompt me to login, in server combo box it shows me only <browse for server> option and it doesn't show me any option to select server. I put the default John-PCJOhn it gives me an error. I uninstall it two times and installed it again but every time it gives me same error. It was working fine before formating my laptop. Please give me a solution to login in to SSMS.

View 4 Replies

DataSource Controls :: Switch Connection SQL Management Studio

Apr 30, 2010

I'm trying to create a sql script that will connect to 1 server, backup 2 dbs, then connect to another server and restore the dbs. know i could create an application easily, use sqlcmd too but I wanted to do it on SQL Server Management Studio. I'm running version 10.0.2531.0

View 3 Replies

SQL Query Works In Management Studio But Not In C#

Mar 21, 2011

I have a problem doing a query with my software. I have a function which builds my query, and then execute it to fill a gridview. But it keep throwing me an exception : "The multi-part identifier "" could not be bound" with several columns. When I try the query in SQL Management Studio, it just works fine. I really don't understand. Here's the query.

SELECT DISTINCT [NonConformite].[Numero],
CAST ([NonConformite].[Numero] AS varchar (255)) AS Champ1,
CAST ([NonConformiteDonneesComplementaires177_4].[Texte2] AS varchar (255)) AS Champ2,
CAST (NonConformite.dbo.[NonConformiteStatut].[Libelle] AS varchar (255)) AS Champ3,
CAST ([NonConformite].[Description] AS varchar (255)) AS Champ4 FROM [NonConformite].[dbo].[NonConformite]
LEFT JOIN NonConformite.dbo.[NonConformiteDonneesComplementaires] as NonConformiteDonneesComplementaires177_4
ON [NonConformite].[Numero] = [NonConformiteDonneesComplementaires177_4].[Numero]
LEFT JOIN NonConformite.dbo.[NonConformiteStatut]
ON [NonConformite].[CpteurStatut] = NonConformite.dbo.[NonConformiteStatut].[Cpteur]

I work on Windows 7 Pro, with Visual Studio 2008, SQL Server 2008 and in ASP.NET C#.

View 2 Replies

DataSource Controls :: Sql Management Studio - Clone Database Error

May 24, 2010

i am using sql express 08 & sql management studio exp 08. I tried to clone a database from another but an error occured. My steps:

[newDatabase] >> right click >> tasks >> restore >> databaseOn general section: from database = [databaseSource] >> backup sets: all checked

On options section: overwrite existing database: checked, recovery state: restore with recoveryClick [ OK ] button The error:

Restore failed for 'MyServerSQLEXPRESS'. (Microsoft.SqlServer.SmoExtended)

Additional information:

System.Data.SqlClient.SqlError: The file 'x:.........databaseSource.mdf' cannot be overwritten. It is being used by database 'databaseSource'. (Microsoft.SqlServer.Smo)

And why sql management studio tried to overwrite the dataSource (not newDatabase)? how to clone a database? I also tried backup databaseSource to file and then restore newDatabase from the file but resulting the same error.

View 3 Replies

DataSource Controls :: Install SSMSE (Management Studio) 2008?

Mar 18, 2010

I have instance of MS SQL Server 2005 on my computer. Is there any way to install SSMSE (Management Studio) 2008 to work with instance of MS SQL Server 2005? Operational System of my computer: Windows XP with 32 bit, processor 1.67 GHz.

View 2 Replies

DataSource Controls :: Cannot Get The Db Created In Sql Management Studio Express 2k5 Displayed

Jun 13, 2010

I followed the article How to: Create a Database (SQL Server Management Studio)" [URL] I got this:-

//image

Then I tried to add this database in vs08 but at first I got nothing, then I manually started the MSSQLSERVER, after that it just displays the System Databases not the database "test1" I made So how to make it realize that I have made a database and I want it to connect to that database?

//image

i need to connect to the db"test1" so that i can manupilate it using vs08 controls.

View 1 Replies

DataSource Controls :: Managing Users In SQL Server 2008 Management Studio?

Jul 12, 2010

I restored a database from another server, and everything looks good except the users.

I'm managing all this from SQL Server 2008 Management Studio as SA.

The users are present in the [u]databaseName > security > users[/u] section, and they exist in [u]databaseServer > Security > Logins[/u]. However I can't change anything in the [u]databaseName > security > users[/u] section, because when I try and make a change, and then I hit OK to apply, it says "[i]login name must be specified[b][/b][/i]". But the login name field is grayed out and I can't modify it(even though I'm logged into the machine as Administrator and SQL as SA).

Also, in the user mapping section, when I try to map one of the users to a database, it says '[i]create failed user already exists[b][/b][/i]'...but I don't want to create the user, I just want to map that user to the appropriate databases...

View 2 Replies

DataSource Controls :: MS SQL Management Studio 2008 - Waiting Very Long For DB - Tree

Mar 22, 2010

I installed MS SQL Express 2008 with Advanced Services including Management Studio 2008. When I connect to the SQL server of my provider (shared hosting - one SQL server for many customers), it takes very long (up to serveral minutes) until all DBs are displayed in the object explorer (from which I then have to choose my DB). Somebody told me, the long waiting time occurs because Management Studio first checks rights (whichever rights that may be) with every DB that runs on the server.

But in Management Studio 2005 the behaviour is different - the DB Tree in the object explorer expands immediately! No waiting time! Does anyone know a solution for this? I don't want to install two separate versions of Management Studio just because of that!

View 1 Replies

DataSource Controls :: SQL Server Management Studio 2008 - Intellisense Not Working

Mar 25, 2010

I've just downloaded SQL Server Management Studio 2008 after using SSMS 2005 for the past years, however the intellisense isn't working in the Query-Builder. I've checked, and Intellisense is enabled. Is there any other reason this could not be working?

View 4 Replies

DataSource Controls :: SQL SERVER Management Studio Errors In Identify The Table?

Mar 30, 2010

I'm a beginner with ASP.NET. I'm using SQL Server2005 Management Studio. The problem I facing is arises when I tries to run any query,even the simplest, it doesn't identifies the table. as below:

View 4 Replies

DataSource Controls :: Want To Download SQL Profiler For Sql Server 2008 Management Studio Express

Jan 15, 2010

where can i download profiler from? i can't find it on google.

View 2 Replies

DataSource Controls :: Import Database Diagram At SQL Server Management Studio Express?

Feb 26, 2010

How do you import database diagram at SQL Server Management Studio Express (SSMSE)? Using SSMSE in checking my database through a shared server, the "Database Diagrams" folder has no import functionality.

View 1 Replies

DataSource Controls :: SQL Server 2008 Management Studio Failed Install Via Web Platform Installer

May 7, 2010

I sucessfully installed SQL Server Express 2010 on my windows server. I then tried to install the SQL Server 2008 management studio via Web Platform Installer but it failed (it did however sucessfully install powershell).

[Code]....

View 1 Replies

DataSource Controls :: Using Visual Studio 2008 Query Builder And Am Trying To Pass A Value To A Parameter That Uses The IN OPERATOR?

Jun 3, 2010

I'm using Visual Studio 2008 Query Builder and am trying to pass a value to a parameter that uses the IN OPERATOR.Here is my sql from qb:

SELECT COURSE_TITLE, INSTR_NAME, ADMIN_UNIT
FROM vwHRIC_EC_ContractSummary
WHERE (ADMIN_UNIT IN (@ADMIN_UNIT))

The trouble I am having is that if the parameter @ADMIN_UNIT contains more than one value such as (8X, CV) that the query doesn't return any data. If I run the same query with only one value such as (8X) it works fine.I have tried different formats like (8X, CV), ('8X', 'CV'), (8X; CV) but none have worked.I ran this same query in SQL Server Management Studio and and it returns data no problem but can't get it to work in Query Builder for my aspx application.Does anyone have any experience with this problem and how did you correct it?

View 3 Replies

SQL Server ::error Occur Paste The Generated Query Into Sql Management Studio?

Aug 4, 2010

I have been using a function that replaces some characters from my editor in asp.net with '+CHAR(x)+' to chain together a string with characters such as single quote that would otherwise break the query, i know how to escape the character using double single quote but i was wondering why i get this problem.The problem is that when the string gets too long about 7kb to 8kb its gets cut off for no reason, no error message gets displayed, the query is successful only the string cuts off at a point. When i escape the character without using '+CHAR(x)+' to add the character i can add a very long string that does not cut off,i am using Varchar(max) for my field, (have also tried text).I am using sql 2008 express edition, and encounter this problem when i paste the generated query into sql management studio, and when i execute the query fromasp.net code.

View 1 Replies

DataSource Controls :: SQL Management Studio With Win 7 Professional 32 - Bit - Error "Attach Database Failed"

Jul 5, 2010

When tried to attach the database i created in Visual Web Developer 2008 to SQL management studio i get an operating system error. TITLE: Microsoft SQL Server Management Studio Attach database failed for Server 'SHRAV-DESKTOPSQLEXPRESS'. (Microsoft.SqlServer.Smo) [URL]

ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) Unable to open the physical file "C:Websites est_1App_Data est.mdf".Operating system error 5: "5(failed to retrieve text for this error. Reason: 15105)". (Microsoft SQL Server, Error: 5120)................

View 1 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







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