Is SQL 2005 Faster Then SQL2000?

Oct 2, 2007

We have a financial accounting system that has been certified for SQL 2005. Before I upgrade, I'm wondering if I should expect better/faster performance from SQL 2005 vs. SQL 2000?

Anything I should lookout for when upgrading to SQL 2005?

Thanks, Al

View 1 Replies


ADVERTISEMENT

Why SQL2005 Is NOT Faster Than SQL2000?

Apr 19, 2006

Hello!!

we use SQL2000(64bit) and we are considering our system to apply SQL2005

so i tested two SQL-Server on One Machine by installing each instance of them.

The RESULT..

i can't find difference of performance between two instance.

is there no impoving in Database engine?

 

* i'm sorry, for my poor sentence...

 

View 3 Replies View Related

SQL Server 2005 Is Better Than SQL2000 ..How??

May 24, 2008

SQL Server 2005 is better than SQL2000 ..How??..Which feature is  available in SQL2005 but not in SQL2000???

View 2 Replies View Related

How To Connect SQL2000 To Vb.net 2005?

Jan 3, 2007

May i know whether SQL2000 is compatible with vb.net 2005?
I cant find OLEDBDataAdapter in vb.net 2005, any ways to connect SQL 2000 to vb.net 2005?

View 3 Replies View Related

SQL2000 And 2005 Compatibility

Sep 28, 2007



Hi,

I've passed my ASP application database from SQL Server2000 to SQL Server 2005 and have some problems with the
new functions in SQL Server2005, which do not acsept the Date & Time format as SQL 2000..in insert query.

SQL2000 : dd/mm/yyyy
SQL2005: CONVERT(DATETIME,(DATE),103) = 27/12/2006

Is there some some other way of resolving the problem?

View 1 Replies View Related

Cannot Restore SQL2000 Backup To 2005 (Msg #601)

Jun 5, 2008

Hello,

In the process of migrating a logshipped database (in non recovery mode) from SQL2000 SP4 to SQL2005 SP2, I got the following error (sorry for the french translation!):
---
Conversion de la base de données 'AdStatistiques' de la version 539 à la version actuelle 611.
Base de données 'AdStatistiques' exécutant l'étape de mise à jour de la version 539 à la version 551.
Msg 601, Niveau 12, État 3, Ligne 1
Impossible de poursuivre l'analyse avec NOLOCK car les données ont été déplacées.
Msg 3167, Niveau 16, État 1, Ligne 1
RESTORE n'a pas pu démarrer la base de données 'adstatistiques'.
Msg 3013, Niveau 16, État 1, Ligne 1
RESTORE DATABASE s'est terminé anormalement.
---

Of course, the restore operation performs well when the destination is SQL2000. I suspect the integrity checker of SQL2005 to be less permissive, hence I run a checkdb on the original DB, which raise several errors, which are quite difficult for me to analyse:
[Sorry, it's in french again]
----
Serveur : Msg 8929, Niveau 16, État 1, Ligne 1
Objet ID = 2 : Erreurs trouvées dans le texte ID = 15620702208 possédé par l'enregistrement de données identifié par RID = (1:1385:13) id = 1902629821 and indid = 1.
Serveur : Msg 8929, Niveau 16, État 1, Ligne 1
Objet ID = 2 : Erreurs trouvées dans le texte ID = 15620767744 possédé par l'enregistrement de données identifié par RID = (1:1385:14) id = 1902629821 and indid = 2.
Serveur : Msg 8929, Niveau 16, État 1, Ligne 1
Objet ID = 2 : Erreurs trouvées dans le texte ID = 15620833280 possédé par l'enregistrement de données identifié par RID = (1:1385:15) id = 1902629821 and indid = 3.
Serveur : Msg 8929, Niveau 16, État 1, Ligne 1
Objet ID = 2 : Erreurs trouvées dans le texte ID = 15620898816 possédé par l'enregistrement de données identifié par RID = (1:1385:16) id = 1902629821 and indid = 4.
Serveur : Msg 8929, Niveau 16, État 1, Ligne 1
Objet ID = 2 : Erreurs trouvées dans le texte ID = 26594574336 possédé par l'enregistrement de données identifié par RID = (1:7153632:27) id = 1031010754 and indid = 5.
Serveur : Msg 8961, Niveau 16, État 1, Ligne 1
Erreur de table : Objet ID = 2. Le nœud text, ntext ou image à la page (1:1974), slot 0, texte ID = 26594574336 ne correspond pas à sa référence dans la page (1:191177), slot 10.
Serveur : Msg 8974, Niveau 16, État 1, Ligne 1
Nœud texte référencé par plusieurs nœuds. L'objet ID = 2, page de nœud text, ntext ou image (1:1974), slot 0, texte ID = 26594574336 est pointé par la page (1:191177), slot 10 et par la page (1:38504), slot 0.
Serveur : Msg 8965, Niveau 16, État 1, Ligne 1
Erreur de table : Objet ID = 2. Le nœud text, ntext ou image à la page (1:1111184), slot 0, texte ID = 15620767744 est référencé par la page (1:191177), slot 11, mais n'a pas été vu à l'analyse.
Serveur : Msg 8965, Niveau 16, État 1, Ligne 1
Erreur de table : Objet ID = 2. Le nœud text, ntext ou image à la page (1:1111185), slot 0, texte ID = 15620833280 est référencé par la page (1:191177), slot 12, mais n'a pas été vu à l'analyse.
RĂ©sultats DBCC pour 'AdStatistiques'.
RĂ©sultats DBCC pour 'sysobjects'.
Il y a 388 lignes dans 9 pages pour l'objet 'sysobjects'.
RĂ©sultats DBCC pour 'sysindexes'.
Serveur : Msg 8965, Niveau 16, État 1, Ligne 1
Erreur de table : Objet ID = 2. Le nœud text, ntext ou image à la page (1:1111186), slot 1, texte ID = 15620898816 est référencé par la page (1:1385), slot 16, mais n'a pas été vu à l'analyse.
Il y a 437 lignes dans 26 pages pour l'objet 'sysindexes'.
CHECKDB a trouvé 0 erreurs d'allocation et 10 erreurs de cohérence dans la table 'sysindexes' (objet ID = 2).
[SNIP]
RĂ©sultats DBCC pour 'AdStatPageHeure_OLD'.
Serveur : Msg 8977, Niveau 16, État 1, Ligne 1
Erreur de table : Objet ID = 1902629821, index ID = 1. Le nœud parent pour la page (1:1043307) n'a pas été rencontré.
Serveur : Msg 8977, Niveau 16, État 1, Ligne 1
Erreur de table : Objet ID = 1902629821, index ID = 1. Le nœud parent pour la page (1:1043308) n'a pas été rencontré.
Serveur : Msg 8977, Niveau 16, État 1, Ligne 1
Erreur de table : Objet ID = 1902629821, index ID = 1. Le nœud parent pour la page (1:1043309) n'a pas été rencontré.
Serveur : Msg 8977, Niveau 16, État 1, Ligne 1
[SNIP, several errors pretty similar here]

-Trop d'erreurs trouvées (201) pour l'objet ID = 1902629821. Pour voir tous les messages d'erreurs, relancez l'instruction avec 'WITH ALL_ERRORMSGS'.
Il y a 21062117 lignes dans 72062 pages pour l'objet 'AdStatPageHeure_OLD'.
CHECKDB a trouvé 0 erreurs d'allocation et 72063 erreurs de cohérence dans la table 'AdStatPageHeure_OLD' (objet ID = 1902629821).
---

Of course, I'd like to delete the AdStatPageHeure_OLD table but I get a cryptic error message when doing that, and I can't remove the indexes that, according to some other posts I browsed, could explain the behavior:
---

La page (1:1111186), slot 1 pour le noeud text, ntext ou image n'existe pas.
Page (1:1111186), slot 1 for text, ntext, or image node does not exist. (Microsoft SQL Server, Erreur : 7105)

Pour obtenir de l'aide, cliquez sur : http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=7105&LinkId=20476
---


Is there any easy option you can see to operate the transfer, since the backups I have from the DB already contain the data corruption?

Thanks a lot for any hint you could provide,
--
Julien

View 2 Replies View Related

Can I Restore SQL 2005 Backup On SQL2000

May 10, 2007

Hi all

i have taken backup of a database from SQL Server2005
can i Restore it on SQL Server2000 server?

Please help me

Thanks

View 2 Replies View Related

SQL2000 And 2005 Installed On The Same Server?

Dec 18, 2007

My company wants to combine our SQL2000 and SQL2005 severs onto one server. If I install SQL2000 and 2005 on one server and migrate the data bases will I have any performance issues? Is there any issues or conflicts known by putting them both on the same server?

View 4 Replies View Related

Execute SQL2000 PAckage In 2005

Mar 12, 2007



HI ALL,



Could you please help me on this issue.It is URgent .I am new to SSIS.



I am using DTS package in SSIS. I Have an SQLTask and DTS Package. I want to fail the SSIS PAckage when DTS 2000 Package Fails. I want to know How to populate the failure of DTS PAcage to SSIS PAcage.When i execute the SSIS Package the DTSPAckage task Failed Internally but it styays yellow for ever.it is not showing red Color in SSIS Package.Any help is greatyly appreciated.



Thanks

ISANAKA

View 1 Replies View Related

Can I Export/attach A MS SQL 2005 Database To MS SQL2000 ?

Feb 13, 2007

I know I can go from 2K to 2005, but can I go the other way ?

Thanks

View 1 Replies View Related

Xp_cmdshell Statement Worked In SQL2000 Not In 2005

Dec 7, 2007

Code Block
Hi All,

I've got a stored procedure called from a trigger on another database. There are two xp_cmdshell statements in the procedure. One writes a couple variables, passed from the trigger, into a text file. The second fires off an executable that uses the text file via a batch file.

Here's the code that worked on the old 32bit SQL2000 box





Code Block
begin
declare @cmd varchar(150)
select @cmd = 'echo ' + @sVariable1 + ',' + @sVariable2 +' > c:aFolderTextFile.txt'
exec master..xp_cmdshell @cmd

declare @cmd2 varchar(150)
select @cmd2 = 'c:aFolderRun.bat'
exec master..xp_cmdshell @cmd2
end






The new box is 64bit SQL2005. When invoked the stored procedure executes without an error. The textfile is written sucessfully. But, the executable called from the second xp_shell statement does not produce the expected result. Because there is no error I'm having trouble determining where the failure lies.


To troubleshoot the problem I've tried:



Running the batch file from the command prompt in the system32 directory... Success


Using sp_xp_cmdshell_proxy_account to be sure of the credentials of the running xp_cmdshell... Failure

My questions:

Does 64 Bit SQL2005 have a different set of parameters when invoking an executable from xp_cmdshell? ie Do I need to rewrite the batch file?
Is there another way call an executable, SQLCMD maybe?

Any help is appreciated...




Code Block
The batch file if you're curious:

"c:Program Files (x86)someVendersomeAppsomeEXE.exe" "C:aFolderTextFile.txt"








View 3 Replies View Related

SQL2000/2005 Logon Via Windows Group

May 30, 2007

I've come up against a wall with regards to adding login via a windows group. My end goal is to be able to manage sysadmin access to many servers via a domain group instead of via individual logins at each server.

I've got a mix of 2000 and 2005 servers, with a related issue for each. Searching far and wide has come up empty so far.

In each case below, the a login for the group was created via EM/SSMS, and set with the sysadmin role.

1. Domain Local Group

I added a domain local group "domainsql accounts" with myself among others as members, including the domain account for the sql and agent services.

Adding this group to SQL2005 worked fine, and authenticates my login as a member of this group. Oddly, xp_logininfo [domainsql accounts] , 'members' returns error code 0x8ac.
It does log me in, and it does correctly grant me sysadmin.

Adding this group to SQL2000 from EM, the group does not appear in the list for the domain. Typing it manually does recognize it as a group, but it does not allow login.

Review:
2000 fails login, fails xp_logininfo
2005 allows login, fails xp_logininfo

2. Domain Global Group

Next, I added a global group "domainsql dba", with myself among others as members.
This group IS viewable in SQL2000 EM to add as a login. Unfortunately, I still cannot login via windows auth. Even stranger, xp_logininfo [domainsql dba] , 'members' correctly returns the members of this group. I know SQL can authenticate that group, and I am part of that group, yet it won't authenticate my login?

SQL2005 fails to allow login but will also return member info via xp_logininfo.

Review:
2000 fails login, returns xp_logininfo
2005 fails login, returns xp_logininfo

The closest thing I found was a MS kb entry that suggested creating a local group, adding the domain group as a member of the local group, and adding a login for the local group. It didn't work.

Thanks for any offered suggestions

Chris

View 6 Replies View Related

Copy Records From 2005 Express To SQL2000 Database

Jul 9, 2007

I have an application which stores records on a local SQL Express and I need to move the records to a SQL 2000 database. I have the SQL 2000 server linked in the Express Management Console (under Linked Servers). I'm trying to use a stored procedure to accomplish this, but get an error "Invalid object name 'ngtxa4-rsmsz-01.newpurchase.tblRequest'." Express uses a table named tblTRequest in the TempPurchase database, while 2000 uses a table named tblRequest in a NewPurchase database. Here is the stored procedure I'm using:
USE [tempPurchase]
GO
/****** Object: StoredProcedure [dbo].[InsertRequestToMain] Script Date: 07/09/2007 08:54:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[InsertRequestToMain]
AS
BEGIN
INSERT INTO [ngtxa4-rsmsz-01].newpurchase.tblRequest
(fldRequestDate, fldRequiredBy, fldUserID, fldWorkAreaID, fldVendorID, fldClassID, fldEstimate, fldMemo, fldStatusID, fldStatusDate, fldSystemID,
fldtmpRequestID, fldUpdateCode)
SELECT fldRequestDate, fldRequiredBy, fldUserID, fldWorkAreaID, fldVendorID, fldClassID, fldEstimate, fldMemo, fldStatusID, fldStatusDate, fldSystemID,
tmpRequestID, UpdateCode
FROM tblTRequest
WHERE (fldHold = 0)
END

Any assistance with this would greatly be helpful. Thank you.

View 2 Replies View Related

What Are The Differences Between CD1 And CD2 Of The SQL Server 2005 Enterprise? And Can I Just Attach The Sql2000 MDF File Into Sql2005?

Feb 4, 2006

Hi
I have new bought the SQL server 2005 enterprise, but it have 2 CDs, so what are the differences between CD1 and CD2? and so which one should i install first? or is it necessary to install both two or just need to install one of them?
And about my original sql 2000 database, can i just attach it's MDF file into the sql 2005 engine, or which import wizard can load the sql 2000 MDF into sql 2005? or do i need to keep the sql 2000 engine before do this?
thx

View 1 Replies View Related

Sql2000 && Sql2005, Want Localhost To Use Sql2000

Sep 17, 2006

 i have sql2000 & sql2005 on the same machine. I am unable to register my localhost in sql2000, get an access denied error. How can I make my localhost use sql2000 database?

View 1 Replies View Related

Transfer Data(Cubes+virtual Cubes) From Sql2000 To Sql 2005

Jun 6, 2006

SĂĽleyman writes "I want to transfer databases with cubes and virtual cubes from SQL 2000 Analysis Server to SQL 2005 SQL Express.

1.how i can transfer the cubes?

2.how i can transfer the virtual cubes?

3.Why i see the tables(saw)and the cubes in SQL Managment only under Tables together and nothing under cubes?

Please help me
many thanks

SĂĽleyman from Germany/Frankfurt am Main"

View 1 Replies View Related

Migrate SQL2000 To SQL2000

May 13, 2008



i am in the process of Migrating SQL 2000 to my new SQL2000 server i want to know the what would the best way for me to migrate one SQL server to another SQL server on the same network and rename the new server to the old server and bring it up for use in our ecommerce website.

View 10 Replies View Related

Which Would Be Faster ?

Mar 28, 2007

hi all,    if i have a comma delimited string and want to insert each delimited substring into a table which of the following way is faster?pass the whole string into the a stored procedure and loop through the delimited string and pick out the substring and insert into the table orloop and pass the substring into a stored procedure and insert N times?or any other better ways someone could suggest me to do thanks! 

View 6 Replies View Related

Which Is Faster LIKE Or IN

Jul 27, 2001

i have a query that i can use either and get the same results. i just need to shave some time off... which is faster the LIKE or IN () ???

thanks

kim

View 2 Replies View Related

Can This Be Done Faster?

Jan 16, 2006

I was just wondering if this can be done any faster? code-wise that is...

Don't mind the converts, can't do without them, as the data discipline for the source table isn't always reliable, while I have to be absolutely sure the destination data ends in the required format.



UPDATE MATCH_basistabel
SET MATCH_basistabel.matchfelt = convert(varchar(50),ALL_tbl_medlemsinfo.sřgenavn),
MATCH_basistabel.sřgenavn = convert(varchar(50),ALL_tbl_medlemsinfo.sřgenavn),
MATCH_basistabel.medlemsnavn = convert(varchar(50),ALL_tbl_medlemsinfo.medlemsnav n),
MATCH_basistabel.medlemsnavn2 = convert(varchar(50),ALL_tbl_medlemsinfo.medlemsnav n2),
MATCH_basistabel.medlemsnummer = ALL_tbl_medlemsinfo.medlemsnummer,
MATCH_basistabel.nationalitet = convert(varchar(10), ALL_tbl_medlemsinfo.nationalitet),
MATCH_basistabel.organisationsnummer = convert(varchar(10),ALL_tbl_medlemsinfo.organisati onsnummer),
MATCH_basistabel.medlemskab = convert(varchar(20), ALL_tbl_medlemsinfo.medlemskab),
MATCH_basistabel.ipdn = ALL_tbl_medlemsinfo.ipdn,
MATCH_basistabel.ipdnroll = convert(varchar(20), ALL_tbl_medlemsinfo.ipdroll),
MATCH_basistabel.franavision = 1
FROM MATCH_basistabel, ALL_tbl_medlemsinfo
WHERE isnumeric(matchfelt) = 1
AND (convert(int, MATCH_basistabel.matchfelt) = convert(int, ALL_tbl_medlemsinfo.medlemsnummer)
AND MATCH_basistabel.franavision = 0)

View 14 Replies View Related

Run Faster

Feb 17, 2006

Hi Guys,

I have SQL file but it run slowly when comes to huge record. How do I make it faster. I do create an index but how to make use the index? Pls help me on this...

Many Thanks,

Regards,
Shaffiq

View 6 Replies View Related

NEED TO GO FASTER

Jun 18, 2007

View 2 Replies View Related

Which Is Faster?

Jul 20, 2005

I'm sonewhat new to MS SQL Server and I'm wondering about which of thefollowing two queries would be faster:DECLARE @ResidencesBuilt intDECLARE @BarracksBuilt intDECLARE @AirBaysBuilt intDECLARE @NuclearPlantsBuilt intDECLARE @FusionPlantsBuilt intDECLARE @StarMinesBuilt intDECLARE @TrainingCampsBuilt intDECLARE @FactoriesBuilt intSELECT@ResidencesBuilt = SUM(CASE WHEN BuildingType = 0 THEN Built END),@BarracksBuilt = SUM(CASE WHEN BuildingType = 1 THEN Built END),@AirBaysBuilt = SUM(CASE WHEN BuildingType = 2 THEN Built END),@NuclearPlantsBuilt = SUM(CASE WHEN BuildingType = 3 THEN Built END),@FusionPlantsBuilt = SUM(CASE WHEN BuildingType = 4 THEN Built END),@StarMinesBuilt = SUM(CASE WHEN BuildingType = 5 THEN Built END),@TrainingCampsBuilt = SUM(CASE WHEN BuildingType = 6 THEN Built END),@FactoriesBuilt = SUM(CASE WHEN BuildingType = 7 THEN Built END)FROM BuildingsGROUP BY kdIDHAVING kdID = 2902Or:DECLARE @ResidencesBuilt intDECLARE @BarracksBuilt intDECLARE @AirBaysBuilt intDECLARE @NuclearPlantsBuilt intDECLARE @FusionPlantsBuilt intDECLARE @StarMinesBuilt intDECLARE @TrainingCampsBuilt intDECLARE @FactoriesBuilt intSET @ResidencesBuilt = (SELECT Built FROM Buildings WHERE BuildingType = 0AND kdID = 2902)SET @BarracksBuilt = (SELECT Built FROM Buildings WHERE BuildingType = 1 ANDkdID = 2902)SET @AirBaysBuilt = (SELECT Built FROM Buildings WHERE BuildingType = 2 ANDkdID = 2902)SET @NuclearPlantsBuilt = (SELECT Built FROM Buildings WHERE BuildingType =3 AND kdID = 2902)SET @FusionPlantsBuilt = (SELECT Built FROM Buildings WHERE BuildingType = 4AND kdID = 2902)SET @StarMinesBuilt = (SELECT Built FROM Buildings WHERE BuildingType = 5AND kdID = 2902)SET @TrainingCampsBuilt = (SELECT Built FROM Buildings WHERE BuildingType =6 AND kdID = 2902)SET @FactoriesBuilt = (SELECT Built FROM Buildings WHERE BuildingType = 7AND kdID = 2902)The data source is:kdID BuildingType Built2902 6 02902 7 02902 4 02902 0 802902 2 02902 1 52902 3 402902 5 10Or:CREATE TABLE [dbo].[Buildings] ([kdID] [int],[BuildingType] [tinyint],[Built] [int])INSERT INTO Buildings (kdID, BuildingType, Built) VALUES (2902, 0, 80)INSERT INTO Buildings (kdID, BuildingType, Built) VALUES (2902, 1, 5)INSERT INTO Buildings (kdID, BuildingType, Built) VALUES (2902, 2, 0)INSERT INTO Buildings (kdID, BuildingType, Built) VALUES (2902, 3, 40)INSERT INTO Buildings (kdID, BuildingType, Built) VALUES (2902, 4, 0)INSERT INTO Buildings (kdID, BuildingType, Built) VALUES (2902, 5, 10)INSERT INTO Buildings (kdID, BuildingType, Built) VALUES (2902, 6, 0)INSERT INTO Buildings (kdID, BuildingType, Built) VALUES (2902, 7, 0)Analyzer says the first would be faster, but it has a lot of SUM()'s andwhatnot so I'm not too sure about this. There are also about 1000 rows inthe actual Buildings table. This will be a part of a stored procedure.

View 3 Replies View Related

Faster Way To Do This?

May 7, 2007

I want to know the # of users on our web site for each month in a given year. I'm looking for a faster way to do this--perhaps one that can leverage an index instead of reading the entire table! (My avg disk queue right now is above 7 and the query takes about 90 seconds).



Here's my current SP. Basically I'm calculating each month/year and using UNION to join them together, then pivot to rotate.



USE [TNS]

GO

/****** Object: StoredProcedure [dbo].[Unique_Login_IPs] Script Date: 05/07/2007 12:38:52 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

-- =============================================

-- Author: <Author,,Name>

-- Create date: <Create Date,,>

-- Description: <Description,,>

-- =============================================

ALTER PROCEDURE [dbo].[Unique_Login_IPs]

(

@year1 int,

@year2 int

)

AS

BEGIN

SET NOCOUNT OFF;



-- Define the years for testing purposes

set @year1 = 2006

set @year2 = 2007



SELECT month,[2006] as y2006,[2007] as y2007

FROM

(

SELECT @year1 AS year, 1 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year1) AND (MONTH(logged) = 1)) as tmpy1_1

UNION

SELECT @year1 AS year, 2 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog AS servicelog_1

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year1) AND (MONTH(logged) = 2)) as tmpy1_2

UNION

SELECT @year1 AS year, 3 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year1) AND (MONTH(logged) = 3)) as tmpy1_3

UNION

SELECT @year1 AS year, 4 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog AS servicelog_1

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year1) AND (MONTH(logged) = 4)) as tmpy1_4

UNION

SELECT @year1 AS year, 5 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year1) AND (MONTH(logged) = 5)) as tmpy1_5

UNION

SELECT @year1 AS year, 6 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog AS servicelog_1

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year1) AND (MONTH(logged) = 6)) as tmpy1_6

UNION

SELECT @year1 AS year, 7 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year1) AND (MONTH(logged) = 7)) as tmpy1_7

UNION

SELECT @year1 AS year, 8 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog AS servicelog_1

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year1) AND (MONTH(logged) = 8)) as tmpy1_8

UNION

SELECT @year1 AS year, 9 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year1) AND (MONTH(logged) = 9)) as tmpy1_9

UNION

SELECT @year1 AS year, 10 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog AS servicelog_1

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year1) AND (MONTH(logged) = 10)) as tmpy1_10

UNION

SELECT @year1 AS year, 11 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year1) AND (MONTH(logged) = 11)) as tmpy1_11

UNION

SELECT @year1 AS year, 12 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog AS servicelog_1

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year1) AND (MONTH(logged) = 12)) as tmpy1_12

UNION

SELECT @year2 AS year, 1 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year2) AND (MONTH(logged) = 1)) as tmpy1_1

UNION

SELECT @year2 AS year, 2 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog AS servicelog_1

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year2) AND (MONTH(logged) = 2)) as tmpy2_2

UNION

SELECT @year2 AS year, 3 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year2) AND (MONTH(logged) = 3)) as tmpy2_3

UNION

SELECT @year2 AS year, 4 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog AS servicelog_1

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year2) AND (MONTH(logged) = 4)) as tmpy2_4

UNION

SELECT @year2 AS year, 5 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year2) AND (MONTH(logged) = 5)) as tmpy2_5

UNION

SELECT @year2 AS year, 6 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog AS servicelog_1

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year2) AND (MONTH(logged) = 6)) as tmpy2_6

UNION

SELECT @year2 AS year, 7 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year2) AND (MONTH(logged) = 7)) as tmpy2_7

UNION

SELECT @year2 AS year, 8 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog AS servicelog_1

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year2) AND (MONTH(logged) = 8)) as tmpy2_8

UNION

SELECT @year2 AS year, 9 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year2) AND (MONTH(logged) = 9)) as tmpy2_9

UNION

SELECT @year2 AS year, 10 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog AS servicelog_1

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year2) AND (MONTH(logged) = 10)) as tmpy2_10

UNION

SELECT @year2 AS year, 11 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year2) AND (MONTH(logged) = 11)) as tmpy2_11

UNION

SELECT @year2 AS year, 12 AS month, COUNT(*) AS cnt

FROM (SELECT DISTINCT ipaddress

FROM servicelog AS servicelog_1

WHERE (method = 'LOGIN') AND (YEAR(logged) = @year2) AND (MONTH(logged) = 12)) as tmpy2_12

) piv

PIVOT

(

SUM(cnt)

FOR year IN

([2006],[2007])

) as child

END

View 1 Replies View Related

Sqldatasource Faster Than DAL???

May 14, 2007

Hi all, I m new to this forum and this is my first question. I m having 2 pages in my web site ... page 1 query directly to db using sqldatasource, the second page query through a BLL then DAL by following the step in this tutorial (http://www.asp.net/learn/dataaccess/tutorial02vb.aspx?tabid=63)....  Page 1 is using a "Like" query search and the Page 2 is the normal displaying some product detail.... Under normal circumstances, one will expect Page 1 will be way fastest than the Page 2... however the problem is Page 1 is in thunder speed while Page 2 takes 10 secs to load... 10 seconds is really not acceptable... I really couldnt figure out what happens... both Page 1 and Page 2 are using the same connection string which connection through a DSN....  How is the connection different by using sqldatasource and DAL?? Could someone please help....  ThanksP.S. I m using a Pervasive database 

View 5 Replies View Related

I Need A Faster Query

Jun 20, 2007

Hi y'all,
I've recently run a profiler on my code and following query took 7 seconds:
SELECT TOP 10 UI, COUNT(UI) AS Expr1 FROM table WHERE (UI <> 'custom_welcome') GROUP BY UI ORDER BY COUNT(UI) DESC
Is it possible to rewrite this so my code gets faster? It's also possible that it's due to the size of the table?
Thanks in advance! I'll let you know how long your query takes :)

View 4 Replies View Related

Faster Than Cursor?

Apr 8, 2008

I have a cursor prcedure that is pretty slow because as the cursor moves through the data I have three select statement on the same table to find other rows information. Is there a better way to do this?
 Simple Example of Code is:
DECLARE MyVARABLES 1 to X
DECLARE c1 CURSOR
FOR
SELECT MyData1, MyData2 to X
FROM MyTable
FOR UPDATE OF MyUpdateData
--Start Cursor
OPEN c1
FETCH NEXT FROM c1
INTO MyVariables
--LOOP
WHILE @@FETCH_STATUS = 0
BEGIN
-----------------------
-- Get other rows data to add to this rows data ......GUESSING THIS IS THE SLOW PART as the table is LARGESELECT MyVar1 = MyData1
FROM MyTable
WHERE MyTableColumns = MyVariables AND MyTableColumns2 <> MyVariables2  --FINDS OTHER ROW (I have three of these)   

--Calculate & Update
If MyVarable = 'this or that'
BEGIN
UPDATE MyTable
SET MyUpdateData = MyVar1 * x *y WHERE CURRENT OF c1
END
-------------------
-- NextFETCH NEXT FROM c1
INTO MyVarables 1 to xEND
CLOSE c1
DEALLOCATE c1

View 2 Replies View Related

Faster SQL Query

Mar 31, 2004

Hi!
I M basically an application developer & use simple sql queries in my programmings. I do not have much idea abt tuning/auditing part & thatswhy i m unable to answer them properly in my interviews. Can anybody give me some tips?????

Question 1:
In a stored procedure, One SELECT stmt is there & depending upon the @rowcount, it updates around 14000 records which is also written inside this stored procedure. Instead of writing this way, there is some other way which is faster than this. Can anybody tell me the correct way???

Question 2:Can anybody give me few examples like this?????? I need them desparetly.

Thanx. Bye.

View 37 Replies View Related

Transactions A Little Bit Faster

May 18, 2004

I´ve created a class to make some standard transaction development a little bit faster. The destructor seem to run, but something makes this object slow down the database, if SqlTransaction and/or SqlConnection isnt manualy handled with the method Commit(). Any ideas on how to handle the SqlTransaction and SqlConnection better?

public class DataTransaction
{
private bool blnError = false;
private ArrayList arrErrorList = new ArrayList();
private SqlConnectionobjConnection = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"].ToString());
private SqlTransactionobjTransaction;

public DataTransaction()
{
objConnection.Open();
objTransaction = objConnection.BeginTransaction();
}
~DataTransaction()
{
if(objTransaction.Connection != null)
{
objTransaction = null;
objConnection.Close();
}
}

public int ExecuteNonQuery(string Query)
{
int intRowsAffected = -1;

SqlCommand objCommand = new SqlCommand(Query, objConnection, objTransaction);

try
{
intRowsAffected = objCommand.ExecuteNonQuery();
}
catch(Exception e)
{
blnError = true;
arrErrorList.Add(e.ToString());
}
finally
{
objCommand.Dispose();
}
return intRowsAffected;
}

public System.Object ExecuteScalar(string Query)
{
System.Object objToReturn = null;

SqlCommand objCommand = new SqlCommand(Query, objConnection, objTransaction);

try
{
objToReturn = objCommand.ExecuteScalar();
}
catch(Exception e)
{
blnError = true;
arrErrorList.Add(e.ToString());
}
finally
{
objCommand.Dispose();
}
return objToReturn;
}
public bool Commit()
{
if(!blnError)
{
objTransaction.Commit();
return true;
}
else
{
objTransaction.Rollback();
return false;
}
objConnection.Close();
}
}

View 2 Replies View Related

Does A Job Execute MUCH Faster???

Dec 20, 2004

Hi,

Previosuly I was executing 2 DTS packages one afte the other manually and together they took a CONSIDERABLE time. The 1st one was pulling data from the OLPT, doing transformations and populating the tables in my Datamart and the 2nd one was doing a FULL process of all the dimensions and cubes.

However I tried scheduling the DTSs as jobs and havethen merged the 2 resulting jobs as a SINGLE job having 2 sequential steps. To my surprise the resulting job takes less than half the time (actually even lesser) as compared with my original approach i.e. running the DTSs. And I am talking about major improvement in terms of completion of the tasks here :)

Am i getting over excited here or is this natural? I assume that if this is correct then jobs much be some sort of "compiled" version as compared to DTS and maybe that's why I have this terrific improvement in terms of execution times.

I'll appreciate comments. Thanks

View 7 Replies View Related

How To Tell If One Query Is Faster Than Another

Jul 26, 2006

I have rewritten a stored procedure that consists of a single select that selects from a view. Essentially I combined the select in the view and the select in the sp into one select. I am now trying to determine if the new version is faster.

The estimated execution plan gives a ratio of 96% : 4% in favour of the new version when I run them together from a query window but when I try to time them I can't get a satisfactory result.

If I run each query once and display the difference between start and end time, they display 0. If I run each one 100, 200, etc times I get different results each time.

Is there anything I can do?

View 5 Replies View Related

Which WHERE Clause Would Be Faster?

Jun 17, 2004

Hypothetically,

If I had a WHERE clause that had to compare a string to another string would it be faster one way or another if I broke it down to three different, smaller searches?

An example:


WHERE a = 'abc'
OR a = 'def'
OR a = 'ghi'

as opposed to:

WHERE a = 'abcdefghi'



ddave

View 2 Replies View Related

Does A Job Execute MUCH Faster???

Dec 20, 2004

Hi,

Previosuly I was executing 2 DTS packages one afte the other manually and together they took a CONSIDERABLE time. The 1st one was pulling data from the OLPT, doing transformations and populating the tables in my Datamart and the 2nd one was doing a FULL process of all the dimensions and cubes.

However I tried scheduling the DTSs as jobs and havethen merged the 2 resulting jobs as a SINGLe job having 2 sequential steps. To my surprise the resulting job takes less than half the time (actually even lesser) as compared with my original approach i.e. running the DTSs.

Am i getting over excited here or is this natural? I assume that if this is correct then jobs much be some sort of "compiled" version as compared to DTS and maybe that's why I have this terrific improvement in terms of execution times.

I'll appreciate comments. Thanks

View 2 Replies View Related







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