SQL 2000 , Windows 2003 Service Takes 15 Minutes To Start

May 21, 2008




After differential restore I start Remedy service. It starts in few seconds.

After full restore the same service takes 15 minutes to start. Bothe the things are done through SQL service agent. Even manual restaring the service also takes 15 minutes after full restore. WHy is it happening this way?

View 5 Replies


ADVERTISEMENT

SQL Server Reporting Services 2005 Service Would Not Start On Windows Server 2003

Dec 13, 2007

SQL Server Reporting Services 2005 Service would not Start on windows server 2003. Working great till yesterday and no changes were made to config file.

Here is the error in Event log


Event Type: Error
Event Source: SQL Server Report Service
Event Category: None
Event ID: 0
Date: 12/13/2007
Time: 8:25:59 AM
User: N/A
Computer: XXXXXXXXXXX
Description:
Service cannot be started. Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: The report server has encountered a configuration error. See the report server log files for more information.
at Microsoft.ReportingServices.Library.ServiceAppDomainController.Start(Boolean firstTime)
at Microsoft.ReportingServices.NTService.ReportService.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


Here is i found in log files
ReportingServicesService!resourceutilities!4!12/13/2007-08:25:59:: i INFO: Running on 0 physical processors, 1 logical processors
ReportingServicesService!servicecontroller!4!12/13/2007-08:25:59:: e ERROR: Exception caught loading and setting code permissions policy level: System.Security.XmlSyntaxException: Invalid syntax on line 158.
at System.Security.Util.Parser.GetRequiredSizes(TokenizerStream stream, Int32& index)
at System.Security.Util.Parser.ParseContents()
at System.Security.Util.Parser..ctor(Tokenizer t)
at System.Security.SecurityManager.LoadPolicyLevelFromStringHelper(String str, String path, PolicyLevelType type)
at System.Security.SecurityManager.LoadPolicyLevelFromString(String str, PolicyLevelType type)
at Microsoft.ReportingServices.Library.ServiceController.SetAppDomainPolicy()
ReportingServicesService!servicecontroller!4!12/13/2007-08:25:59:: e ERROR: Error Starting Service: System.Security.XmlSyntaxException: Invalid syntax on line 158.
at System.Security.Util.Parser.GetRequiredSizes(TokenizerStream stream, Int32& index)
at System.Security.Util.Parser.ParseContents()
at System.Security.Util.Parser..ctor(Tokenizer t)
at System.Security.SecurityManager.LoadPolicyLevelFromStringHelper(String str, String path, PolicyLevelType type)
at System.Security.SecurityManager.LoadPolicyLevelFromString(String str, PolicyLevelType type)
at Microsoft.ReportingServices.Library.ServiceController.SetAppDomainPolicy()
at Microsoft.ReportingServices.Library.ServiceController.StartService(Boolean firstStart)

View 1 Replies View Related

Connection Problem To Sql 2000 On Windows 2003 From Windows 95

Jul 20, 2005

Hi all,I have a Windows 2003 server, which is also a terminal server forapplication, with sql 2000 installed. My company has developed anapplication that uses SQL 2000 as its database. The application is aclient/server one. In each client computer there's a link to theapplication on the server. There is no problem with Windows 98,Windows 2000 pro, Windows xp pro clients, but the windows 95 onescannot log in to the database. The log of the application shows thefollowing error:connection error -2147467259. Cannot open database requested in login'database name'. Login fails.Till a week ago the application was running on a Windows 2000 serverwith SQL 2000 install and the W95 clients had no problem connecting tothe database, so my guess is the error has something to do withWindows 2003 server, but what'causing the error?I tried to install a newer version of MDAC (MDAC 2.5, the last versionof MDAC you can install on W95)but with no success. By the way W95clients have no problem accessing shared folder on the Windows 2003server.Any idea?ThanksMarino

View 1 Replies View Related

MS SQL Reporting Service In Windows 2003 Server

Jul 27, 2005

Hi,I tried to Develop one Report in SQL Reporting Service. I haveinstalled SQL Reporting Serivice in Windows 2003 machine. SQL ServerDatabase is in another machine, running on Windows 2000. I developedand deployed the report and all went fine.When I tried to see the report through the Report Service Manager WebPage it is comming properly. But When I tried to See the report inanother web page, I'm not able to see the images. But the Data isgetting Displayed and only Image is not comming. When I exported thereport to Excel, the Image is comming over there.I am using Report Viewer control (Which came as Sample Program) inthe ASPX Page to render the report. I'm using SQL Server 2000 with SP3aand SQL Server 2000 reporting Service with SP1.I tried setting the Mime Time for the GIF image and even "*.*" inthe Mime Type settings of IIS 6.0. Even then its not displaying theimage.Can any one help me out in solving the problem?Thanks in Advance.With RegdsKrish

View 1 Replies View Related

Install Sql Reporting Service - Windows 2003

Sep 21, 2005

Hello

View 4 Replies View Related

Windows Server 2003 Service Pack 2 Issues?

Oct 24, 2007

I run SQL Server 2005 x64 Enterprise Edition SP2 on a Windows Server 2003 R2 Enterprise Edition SP1 server. This is our main database server and my question is, has anyone had any issues (database related or other) after installing Windows Server 2003 Service Pack 2?

Thanks!

View 2 Replies View Related

SQL SERVER Integration Service And Windows 2003 Installation Bug

Sep 11, 2006

Hello,

I am trying to install SQL SERVER2005 on windows 2003 server.It is not installing SSIS designer.why is it so?

View 10 Replies View Related

SQL SERVER Integration Service And Windows 2003 Installation Bug

Sep 11, 2006

Hello,

I am trying to install SQL SERVER2005 on windows 2003 server.It is not installing SSIS designer.why is it so?





Regards

Kuldeep

View 1 Replies View Related

(Windows Server 2003) Cannot Run SQLSERVERAGENT Service Under Non Admin User After SP1 Installation

Aug 14, 2006

Hi All,

I need a hand here, referring to this knowledge base on Microsoft (http://support.microsoft.com/default.aspx?scid=kb;en-us;Q283811) i applied this knowledge base, and it worked, the MSSQL and SQLSERVERAGENT have run under local non admin account.

But after i installed SP1, MSSQL service is ok, but SQLSERVERAGENT wont run. The warning message is : "Some service run and then stop if they have no work to do."

Is there any way i can install SP1 but in the same time run SQLSERVERAGENT under local non admin account?

Your assistance will be much appreciated

thank you very much in advance.

Felix Adhitya

View 4 Replies View Related

Sql 2000 With Windows 2003

Jul 23, 2005

When windows 2003 server is not log on to the domain, SQL worksfine.(workgroup) Everyone can connect to SQL. When everyone is on thedomain, nothing can connect remotely to SQL.

View 1 Replies View Related

SQL 2000 Authentication From Windows 2003

Jul 27, 2006

I'm working on deploying an ASP.NET 2.0 app onto a Windows 2003 server and I'm having trouble with SQL 2000 authentication. When I run my app from my development box running IIS 5.1 I have no problems. In order to get it to work on my this machine, I had set the account for anonymous access to run under an ASPNETDOMAIN account and configured my SQL database to allow this account.On the Windows 2003 box with IIS 6.0, I've done the same thing with anonymous access for the web app, and also created an application pool that the app runs under and have set the application pool to run under the same account. It appears the app is looking for a local SQL 2005 instance (which doesn't exist). Why would it do this and what do I need to change for this to work?Error:An error has occurred while establishing a connection to
the server.  When connecting to SQL Server 2005, this failure may be
caused by the fact that under the default settings SQL Server does not
allow remote connections. (provider: SQL Network Interfaces, error: 26
- Error Locating Server/Instance Specified)Stack Trace:[SqlException (0x80131904): An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735043 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) +820 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +130 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.Management.SqlServices.GetSqlConnection(String server, String user, String password, Boolean trusted, String connectionString) +68

View 2 Replies View Related

Server 2000 And Windows 2003

Oct 26, 2004

Hello y'all,
I have to do a new install of SERVER 2000 using WINDOWS 2003 . Has anyone done this. If so, what are the steps. Should I expect any problems ? Any help appreciated.
Thanx

View 1 Replies View Related

SQL Server 2000 And Windows 2003 SBS

Jul 23, 2005

I have XP workstations and windows 2003 SBS. I setup an ODBC for anapplication (tried both User and System DSN), but after a few usage, I getthe following error:Connection failed:SQLState: 'HY000'SQL Server Error: 0[Microsoft][ODBC SQL Server Driver]Cannot generate SSPI context.Any ideas? Is this a bug?--Thank youPlease post only

View 3 Replies View Related

MS SQL 2000 And Windows 2003 Cluster

Jul 20, 2005

I installed MS SQL 2000 on a Windows 2003 server cluster (no servicepacks). Both nodes are online and both domain controllers are online.I tried to install SP3 and got the following error:--------------Logon Account could not be validated.No authority could be contacted for authentication.---------------I installed SQL SP 2 and did not get the error but I do get it everytime I try to install SP3.Does anybody have an idea that might help resolve the problem.

View 2 Replies View Related

SQL Server 2005 Client Tools Not Shown Up In Start Menu On Windows 2003 Server

Jul 18, 2007

Hello,



I have installed SQL server 2005 enterprise edition on Windows 2003 virtual PC (full installation). The installation went through successfully. However, after install completed, I cannot find any of the client tools under the start menu -> all programs -> Microsoft SQL server 2005 menu. The only item listed under the SQL server 2005 is Configuration Tools, which is used to configure the database server.



I have tried to install the client component again (in case I didn't install them at the first place) but the installation process cannot be started since it detected that the client components have been installed already. I can also see the sql server native client running in the services.



The server engine is working fine since I can connect to that sql server using another machine where I have the client tool (SQL server management studio).



One of my friends has exactly the same problem. He installed the sql server 2005 Standard edition on windows 2003 server (full installation), but the client tools are not showing up in the start menu either.



I also checked the location for the SQL server management studio (Microsoft SQL server/90/Tools/Binn/VSShell/Common7/IDE), there is only one folder called publicAssemblies listed under. Is this correct or something is missing?



Thanks

View 11 Replies View Related

Stored Proc Takes 45+ MINUTES!

Aug 14, 2007

Hi guys -

I have been googling all day and not found a reasonable solution to my problem.

Here is what I am trying to do. The T-SQL code is included at the bottom of this message.

- The user can specify columns that are stored in a CVColumn table (the data for which comes from an external source). For example, we may provide LastName and FirstName columns and the user could add ShoeSize and FavoriteColor.

- When we get the data from the other source, we create it as a dataset in the *code* with each user-defined field as a column of the table and each person as a row in the table. This is used *everywhere* including binding to grids, etc... So the dataset may look like this:
PersonID
LastName
FirstName
ShoeSize
FavoriteColor

- The dba has required that the data be stored in a normalized fashion. Since we don't know what the columns are - the data is stored in the *table* as:
PersonID
ColumnName
ColumnValue

- When the user gets the data from the external source the first time, the code loops through every person row and every column of the row to insert fields into the table using an Insert stored proc. This performs reasonable well.

- When the code retrieves the data from the database, it needs to reformat the data into one row per person, one column per field so that all of the other code can do the binding, etc.

- So I created a temp table with the appropriate rows and columns and then updated that table with the appropriate data. *This* is the stored proc that has been running now for almost an hour.

- There *must* be a way to do this that performs better?

Here is my T-SQL:




Code Snippet
DECLARE @columnNamesWithSizes varchar(8000)
DECLARE @delim varchar(1)
DECLARE @values varchar(8000)
-- Get the set of column names
SET @columnNamesWithSizes='swiCMKey VARCHAR(4092), swiCMContactManager VarChar(100), swiCMContactManagerID int,
swiCMFolder VarChar(4092), swiCMCVFolder VarChar(4092)'
SELECT @columnNamesWithSizes=COALESCE(@columnNamesWithSizes + ',', '') + ColumnName + ' VARCHAR(50)' FROM CVColumn
-- Create the table with the desired set of columns
EXEC ('CREATE TABLE ##tempTable ( ' + @columnNamesWithSizes + ')')

-- Insert the primary key into each row
EXEC ('INSERT INTO ##tempTable (swiCMKey) SELECT DISTINCT ContactID as swiCMKey FROM CVContact')
-- Use a cursor to loop through all of the records
SET @delim=''''
DECLARE @swiCMKey VARCHAR(4096)
DECLARE contactList CURSOR FOR
SELECT swiCMKey FROM ##tempTable
OPEN contactList
FETCH NEXT FROM contactList INTO @swiCMKey

-- Loop until all rows in temp table have been processed.
WHILE @@FETCH_STATUS = 0
BEGIN
SET @values=null
-- Retrieve all of the columns for this contact
SELECT @values = COALESCE(@values + ',', '') + ColumnName + '=' + @delim + COALESCE(Value,'') + @delim
FROM CVContact
WHERE CVContact.ContactID=@swiCMKey

-- Perform the update to the temp table with the column values
EXEC ('UPDATE ##tempTable SET ' + @values + ' WHERE swiCMKey=' + @delim + @swiCMKey + @delim)

-- Get the next one
FETCH NEXT FROM contactList INTO @swiCMKey
END
CLOSE contactList
DEALLOCATE contactList
-- Return the results
SELECT * from ##tempTable
-- Kill the temp table
DROP TABLE ##tempTable






Any ideas or othre suggestions would be much appreciated!

(BTW - up until today the data from the code-based dataset was stored as XML and then read back as XML. However, we found with 80,000+ people that it took 5 minutes to read the XML. But that is faster than this stored proc!<G>)

View 6 Replies View Related

SQL 2000 Poor Performance On Windows 2003

Mar 30, 2006

Hi
we have a windows 2003 server with 4 xeon 3Gh and 8 gb of memory.
Now, when run a query or when click for properties is slowwwww very slow.

No error in the event view

Any idea
TIA
Abel
:angel:

View 4 Replies View Related

SQL 2000 On Windows 2003 Memory Limits

Mar 11, 2004

Can anyone confirm that SQL 2000 Standard Edition is still limited to 2GB of memory utilization on Windows 2003 Server?

In addition, anyone have suggestions for deploying SQL 2000 on Windows 2003?

TIA

View 1 Replies View Related

Is Sqlserver 2000 Compatible With Windows 2003 ?

Jul 20, 2005

Hi !when installing sqlserver 2000 on a Windows 2003 server it explicitlytells "server not compatible with Windows 2003" during install, but itcan carry on.After we applied serfice pack 3a then the db server seems to runnormally, but does it risk to behave randomly afterwards ???Is sqlserver 2000 standard edition compatible with Windows 2003 server?Or does it exist a specific sqlserver edition for Win2003 ?thanks !Patrice

View 2 Replies View Related

SQL Server 2000 CE 2.0 On Windows Mobile 2003

Jan 28, 2008

Does SQL Server 2000 CE 2.0 work on Windows Mobile 2003?

Thank you,

Ken Carlino
ServiceMaster

View 6 Replies View Related

Windows 2003 SP1 Comaptibility With SQL Server 2000 (SP3)

Jun 22, 2006

Hello there,

We got SQL Server 2000 Standard Edition SP3 running on Windows 2003 server.

Now, we would like to apply windows 2003 SP1 to the Operating System.

We are concerned that whether windows 2003 SP1 is compatible with SQL server 2000 (SP3)?

I was looking at the application comaptibility chart for Windows 2003 SP1.Among them SQL Server 2000 Enterprise Edition Service Pack 3a was listed but not the Standard Edition.

My Question - Is windows 2003 server SP1 is compatible with SQL Server 2000 (SP3)?

Thanks

View 2 Replies View Related

Running SQL 2000 On Windows 2003 64-bit Intel

Jan 23, 2008

Can SQL 2000 32 bit run on a Windows 2003 64-bit Intel OS installation? What about the SQL 2000 64 bit version? Is the Enterprise Edition required for this?

View 1 Replies View Related

Windows 2003 64bit Running SQL 2000 SP4

Sep 28, 2006

I have been running Windows 2003 64bit and SQL2000 SP4 for over 2 months with out any issues.

Sadly we had a server crash "NTldr missing or corrupted"

now when the one engineer looked at it he suggested to reload the server with Windows 2003 32 bit version as there were known compatibility problems between 2003 64bit and SQL 2000 32bit but that you can install SQL 2000 32bit onto a Windows 2003 64 bit server.

Now i dont really believe this statement nor can i find any documentation supporting this. I believe this server might have crashed due to a new patch that was released the last 2 or 3 week either on Windows or SQL. Does anyone know where i can verify what patches was released?

Maybe someone else can share their thoughts with me.



View 3 Replies View Related

SSIS: Opening Package Takes 8 Minutes

Apr 20, 2006

I have an IS package containing approx. 10 tasks in the control flow - one of these tasks is a rather large data flow containing around 50 transformations plus 3 sources and two destinations. Around 10 of these are script components and another 10 are Union All transformations. The rest are primarily lookups, conditional splits and derived column transformation.

The XML file containing the package is approx. 4.5 MB. As I am developing the package, it is becoming increasingly slow to work with as more transformations are added to the data flow. Now, it takes 8 minutes every time I have to open the package for development (DelayValidation is even set to true) and DTExec (not the debugger) uses the same amount of time before it starts executing the package. It also takes a very long time to edit the data flow, as I typically have to wait 1-2 minutes every time the designer has to "commit" a change.

Does anyone have any idea what can be done to speed up the package - both with regard to development and execution?

View 4 Replies View Related

Client Failover Takes 1 To 3 Minutes After Database Has Failed Over

May 12, 2008



We are having problems getting the ADO.NET client to failover in a timely manner in a web application. Here's what happens:

1) Database fails over in 3 to 5 seconds
2) Clients attempt to login to primary and receive SQL server not available errors
3) The clients slowly start to connect and succeed without errorson the secondary.
4) We are still see SQL Server login errors on the primary, even after the failover
5) When we failback to the primary, it all happens within a few seconds (no problems)

If we recycle IIS, this problem goes away

Here's what we have tried
1) Turning off connection pooling (has no effect). We also can see the connections get killed on the primary server
2) Applying this hotfix (http://support.microsoft.com/kb/944099)

And yes, we are running a script to sync up the SIDS so that doesn't appear to be a problem. What seems to be happening is the primary server is getting stuck in the ADO.NET application memory. The problem is we don't know how to fix it.

BTW, our hardware is SQL Server 2005, Windows Server 2003, .NET 2.0 (and .NET 3.5)

Let me know if you need additional information. Thanks in advance

View 2 Replies View Related

Memory Sizing For A SQL 2000 Cluster - Windows 2003 Enterprise SP1

Oct 4, 2007



I am looking for some recommendations for memory sizing and options for a SQL 2000 Cluster. This is a two node cluster built on Windows 2003 ENT SP1 (x86). Both the nodes have the following hardware:

- 4 x Dual Core AMD Processors
- 16 GB Memory
- EMC Shared Disk

We are running six SQL 2000 instances and don't expect each of these instances to use more than 1.7 GB of memory. All these instances are going to support BizTalk 2004 Databases. I already have /PAE enabled on the nodes. I am looking for the following answers:

- Do I need to enable AWE on all the instances even if the instances ? Currently, we don't have that enabled and we have seen some issues regarding excessive paging even when there is physical memory available. The DBAs think that we don't need to enable AWE. I am bit confused on this one.

- We normally run 3 instances on each node and would like size the cluster in such a way that it can take six instances in case of a node failure

Any input will be highly appreciated.

View 4 Replies View Related

SQL Server 2000 Installation Problems On Windows 2003 Ent X64 Cluster

Jun 26, 2006

I have a Windows 2003 Enterprise x64 edition cluster setup and functioning normally. Now, I am trying to get SQL Server 2000 installed as a failover cluster but am having some difficulty. When installing, I get the message '[sqsrvres] ODBC sqldriverconnect failed' in the event log. The message happens when the installer is trying to bring the SQL Server Service resource online.

I am able to ping the name of the instance successfully. I am able to manually start the 'MSSQL$InstanceName' service. I have turned off the firewall on both machines, but this did not help. I have the DTC Service setup as a resource in the same cluster group.

I also read http://support.microsoft.com/default.aspx?scid=kb;en-us;815431 which seemed promising, but did not reolve the problem.



Any help would be much appreciated.

Andy

View 2 Replies View Related

Getting Replication To Work On Windows 2003 Server X64 Environment Using SQL 2000

Feb 28, 2006

I have a mobile device application using mobile sql 2005 replicating with sql 2000 in a x86 environment. This works fine!

I'm having issues getting this to work under Windows Server 2003 X64.

I've got all the components installed under the X64 environment including CLR 2.0 X64 and the mobile sql tools. the but when I run the Configure Web Synchronization Wizard I get the following error. SQL Server 2005 Mobile Edition Server Tools were not found on the IIS server. Run the SQL Server 2005 Mobile Edition Server Tools installer....

My question is: Were do I get the X64 version of these tools?

sqlce30setupen.msi
sql2Ken@P4.msi

The SQL environment is X86 as follows: SQL2000 SP4

Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft Corporation Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)

Any help would be much appreciated!

View 6 Replies View Related

Query Runs In Sub Second Time Until I Put It In A Stored Procedure Then It Takes 2 Minutes.

Jun 25, 2007

The query below runs in sub second time if I don't call it as a stored procedure. I have looked at the execution plan for both the query and the query as a stored procedure and they are the same.
When I put the query into a stored procedure it takes over 2 minutes to run.
All feedback (even the ugly stuff) is more than welcome. I want to master this issue and forever put it behind me.
This is the sql when I just execute it outright:1 DECLARE
2 @WebUserID nvarchar(20)
3 ,@DocumentTypeID int
4 ,@RouteID nvarchar(10)
5 ,@CustomerID nvarchar(15)
6 ,@DocumentIDPrefix nvarchar(20)
7 ,@StartDate datetime
8 ,@EndDate datetime
9 ,@OversoldOnly bit
10 ,@DexCustomersOnly bit
11 ,@DeviationsOnly bit
12 ,@CashNoPaymentOnly bit
13 ,@SignatureName nvarchar(45)
14 ,@SortExpression varchar(200)
15 ,@StartRowIndex int
16 ,@MaximumRows int
17
18 SET @WebUserID = 'manager'
19 SET @DocumentTypeID = 0
20 SET @DocumentIDPrefix = '%'
21 SET @StartDate = '04/17/2007'
22 SET @EndDate = '04/19/2007'
23 SET @OversoldOnly = 0
24 SET @DexCustomersOnly = 0
25 SET @DeviationsOnly = 0
26 SET @CashNoPaymentOnly = 0
27 SET @SortExpression = ''
28 SET @StartRowIndex = 0
29 SET @MaximumRows = 20;
30
31 WITH OrderedDocumentHistory AS
32 (
33 SELECT
34 dh.DocumentHistoryID
35 ,dh.DocumentID
36 ,dh.DocumentTypeID
37 ,dh.DocumentTypeDesc
38 ,dh.RouteID
39 ,dh.RouteDesc
40 ,dh.CustomerID
41 ,dh.CustomerName
42 ,dh.DocDate
43 ,ISNULL(dc.HasReceipt, 0) AS 'HasReceipt'
44 ,ddt.Description AS 'SignatureReason'
45 ,a.Amount
46 ,ROW_NUMBER() OVER (ORDER BY dh.DocDate DESC) AS 'RowNumber'
47 FROM
48 DocumentHistory dh
49 INNER JOIN Customers c ON dh.CustomerID = c.CustomerID
50 INNER JOIN DeviationTypes ddt ON dh.DriverDeviationTypeID = ddt.DeviationTypeID
51 INNER JOIN
52 (
53 SELECT
54 DocumentHistoryID
55 ,(COALESCE(SUM((CONVERT(INT, Units + DeviationUnits)) * (UnitPrice - UnitDiscount)) + SUM((CONVERT(INT, Cases + DeviationCases)) * (CasePrice - CaseDiscount)), 0.0)) AS Amount
56 FROM
57 DocumentHistoryItems dhia
58 GROUP BY
59 dhia.DocumentHistoryID
60 ) AS a ON a.DocumentHistoryID = dh.DocumentHistoryID
61 LEFT OUTER JOIN
62 (
63 SELECT DISTINCT
64 dca.DocumentID
65 ,1 AS 'HasReceipt'
66 FROM
67 DocumentCollections dca
68 ) AS dc ON dh.DocumentID = dc.DocumentID
69 WHERE
70 dh.DocDate BETWEEN @StartDate AND @EndDate
71 AND (dh.DocumentTypeID = @DocumentTypeID OR @DocumentTypeID IS NULL)
72 AND (dh.RouteID = @RouteID OR @RouteID IS NULL)
73 AND (dh.CustomerID = @CustomerID OR @CustomerID IS NULL)
74 AND dh.DocumentID LIKE @DocumentIDPrefix
75 AND CASE WHEN @OversoldOnly = 1 THEN ISNULL( (SELECT TOP 1 (dhio.DeviationUnits + dhio.DeviationCases) FROM DocumentHistoryItems dhio WHERE dh.DocumentHistoryID = dhio.DocumentHistoryID AND (dhio.DeviationUnits > 0 OR dhio.DeviationCases > 0)), 0) ELSE 1 END > 0
76 AND CASE WHEN @DexCustomersOnly = 1 THEN c.DEXEnable ELSE 'Y' END = 'Y'
77 AND CASE WHEN @DeviationsOnly = 1 THEN ISNULL( (SELECT TOP 1 (dhio.DeviationUnits + dhio.DeviationCases) FROM DocumentHistoryItems dhio WHERE dh.DocumentHistoryID = dhio.DocumentHistoryID AND (dhio.DeviationUnits != 0 OR dhio.DeviationCases != 0)), 0) ELSE 1 END != 0
78 AND CASE WHEN @CashNoPaymentOnly = 1 THEN dh.Terms ELSE 'CHECK/CASH' END = 'CHECK/CASH'
79 AND CASE WHEN @CashNoPaymentOnly = 1 THEN (SELECT MAX(dhio.AlcoholPct) FROM DocumentHistoryItems dhio WHERE dhio.DocumentHistoryID = dh.DocumentHistoryID) ELSE 1 END > 0
80 AND CASE WHEN @CashNoPaymentOnly = 1 THEN ISNULL(dc.HasReceipt, 0) ELSE 0 END = 0
81 AND (dh.SigName = @SignatureName OR @SignatureName IS NULL)
82 AND (c.WarehouseID IN (SELECT WarehouseID FROM WebUserWarehouses WHERE WebUserID = @WebUserID)
83 OR @WebUserID IS NULL)
84 )
85
86 SELECT
87 DocumentHistoryID
88 ,DocumentID
89 ,DocumentTypeDesc
90 ,RouteID
91 ,RouteDesc
92 ,CustomerID
93 ,CustomerName
94 ,DocDate
95 ,Amount
96 ,HasReceipt
97 ,SignatureReason
98 FROM
99 OrderedDocumentHistory
100 WHERE
101 RowNumber BETWEEN (@StartRowIndex + 1) AND (@StartRowIndex + @MaximumRows) Here is the sql for creating the stored procedure.  1 CREATE Procedure w_DocumentHistory_Select
2 (
3 @WebUserID nvarchar(20)
4 ,@DocumentTypeID int
5 ,@RouteID nvarchar(10)
6 ,@CustomerID nvarchar(15)
7 ,@DocumentIDPrefix nvarchar(20)
8 ,@StartDate datetime
9 ,@EndDate datetime
10 ,@OversoldOnly bit
11 ,@DexCustomersOnly bit
12 ,@DeviationsOnly bit
13 ,@CashNoPaymentOnly bit
14 ,@SignatureName nvarchar(45)
15 ,@SortExpression varchar(200)
16 ,@StartRowIndex int
17 ,@MaximumRows int
18 )
19 AS
20 SET NOCOUNT ON
21
22 IF LEN(@SortExpression) = 0 OR @SortExpression IS NULL
23 SET @SortExpression = 'Number DESC'
24
25 IF @StartRowIndex IS NULL
26 SET @StartRowIndex = 0
27
28 IF @MaximumRows IS NULL
29 SELECT
30 @MaximumRows = COUNT(dh.DocumentHistoryID)
31 FROM
32 DocumentHistory dh;
33
34 WITH OrderedDocumentHistory AS
35 (
36 SELECT
37 dh.DocumentHistoryID
38 ,dh.DocumentID
39 ,dh.DocumentTypeID
40 ,dh.DocumentTypeDesc
41 ,dh.RouteID
42 ,dh.RouteDesc
43 ,dh.CustomerID
44 ,dh.CustomerName
45 ,dh.DocDate
46 ,ISNULL(dc.HasReceipt, 0) AS 'HasReceipt'
47 ,ddt.Description AS 'SignatureReason'
48 ,a.Amount
49 ,CASE
50 WHEN @SortExpression = 'Number DESC' THEN (ROW_NUMBER() OVER (ORDER BY dh.DocumentID DESC))
51 WHEN @SortExpression = 'Number ASC' THEN (ROW_NUMBER() OVER (ORDER BY dh.DocumentID ASC))
52 WHEN @SortExpression = 'CustomerName DESC' THEN (ROW_NUMBER() OVER (ORDER BY dh.CustomerName DESC))
53 WHEN @SortExpression = 'CustomerName ASC' THEN (ROW_NUMBER() OVER (ORDER BY dh.CustomerName ASC))
54 WHEN @SortExpression = 'CompletedDate DESC' THEN (ROW_NUMBER() OVER (ORDER BY dh.DocDate DESC))
55 WHEN @SortExpression = 'CompletedDate ASC' THEN (ROW_NUMBER() OVER (ORDER BY dh.DocDate ASC))
56 WHEN @SortExpression = 'RouteDescription DESC' THEN (ROW_NUMBER() OVER (ORDER BY dh.RouteDesc DESC))
57 WHEN @SortExpression = 'RouteDescription ASC' THEN (ROW_NUMBER() OVER (ORDER BY dh.RouteDesc ASC))
58 END AS 'RowNumber'
59 FROM
60 DocumentHistory dh
61 INNER JOIN Customers c ON dh.CustomerID = c.CustomerID
62 INNER JOIN DeviationTypes ddt ON dh.DriverDeviationTypeID = ddt.DeviationTypeID
63 INNER JOIN
64 (
65 SELECT
66 DocumentHistoryID
67 ,(COALESCE(SUM((CONVERT(INT, Units + DeviationUnits)) * (UnitPrice - UnitDiscount)) + SUM((CONVERT(INT, Cases + DeviationCases)) * (CasePrice - CaseDiscount)), 0.0)) AS Amount
68 FROM
69 DocumentHistoryItems dhia
70 GROUP BY
71 dhia.DocumentHistoryID
72 ) AS a ON a.DocumentHistoryID = dh.DocumentHistoryID
73 LEFT OUTER JOIN
74 (
75 SELECT DISTINCT
76 dca.DocumentID
77 ,1 AS 'HasReceipt'
78 FROM
79 DocumentCollections dca
80 ) AS dc ON dh.DocumentID = dc.DocumentID
81 WHERE
82 dh.DocDate BETWEEN @StartDate AND @EndDate
83 AND (dh.DocumentTypeID = @DocumentTypeID OR @DocumentTypeID IS NULL)
84 AND (dh.RouteID = @RouteID OR @RouteID IS NULL)
85 AND (dh.CustomerID = @CustomerID OR @CustomerID IS NULL)
86 AND dh.DocumentID LIKE @DocumentIDPrefix
87 AND CASE WHEN @OversoldOnly = 1 THEN ISNULL( (SELECT TOP 1 (dhio.DeviationUnits + dhio.DeviationCases) FROM DocumentHistoryItems dhio WHERE dh.DocumentHistoryID = dhio.DocumentHistoryID AND (dhio.DeviationUnits > 0 OR dhio.DeviationCases > 0)), 0) ELSE 1 END > 0
88 AND CASE WHEN @DexCustomersOnly = 1 THEN c.DEXEnable ELSE 'Y' END = 'Y'
89 AND CASE WHEN @DeviationsOnly = 1 THEN ISNULL((SELECT TOP 1 (dhio.DeviationUnits + dhio.DeviationCases) FROM DocumentHistoryItems dhio WHERE dh.DocumentHistoryID = dhio.DocumentHistoryID AND (dhio.DeviationUnits != 0 OR dhio.DeviationCases != 0)), 0) ELSE 1 END != 0
90 AND CASE WHEN @CashNoPaymentOnly = 1 THEN dh.Terms ELSE 'CHECK/CASH' END = 'CHECK/CASH'
91 AND CASE WHEN @CashNoPaymentOnly = 1 THEN (SELECT MAX(dhio.AlcoholPct) FROM DocumentHistoryItems dhio WHERE dhio.DocumentHistoryID = dh.DocumentHistoryID) ELSE 1 END > 0
92 AND CASE WHEN @CashNoPaymentOnly = 1 THEN ISNULL(dc.HasReceipt, 0) ELSE 0 END = 0
93 AND (dh.SigName = @SignatureName OR @SignatureName IS NULL)
94 AND (c.WarehouseID IN (SELECT WarehouseID FROM WebUserWarehouses WHERE WebUserID = @WebUserID)
95 OR @WebUserID IS NULL)
96 )
97 SELECT
98 DocumentHistoryID
99 ,DocumentID
100 ,DocumentTypeDesc
101 ,RouteID
102 ,RouteDesc
103 ,CustomerID
104 ,CustomerName
105 ,DocDate
106 ,Amount
107 ,HasReceipt
108 ,SignatureReason
109 FROM
110 OrderedDocumentHistory
111 WHERE
112 RowNumber BETWEEN (@StartRowIndex + 1) AND (@StartRowIndex + @MaximumRows)
 

 Here is the code for calling the stored procedure:1 DECLARE @RC int
2 DECLARE @WebUserID nvarchar(20)
3 DECLARE @DocumentTypeID int
4 DECLARE @RouteID nvarchar(10)
5 DECLARE @CustomerID nvarchar(15)
6 DECLARE @DocumentIDPrefix nvarchar(20)
7 DECLARE @StartDate datetime
8 DECLARE @EndDate datetime
9 DECLARE @OversoldOnly bit
10 DECLARE @DexCustomersOnly bit
11 DECLARE @DeviationsOnly bit
12 DECLARE @CashNoPaymentOnly bit
13 DECLARE @SignatureName nvarchar(45)
14 DECLARE @SortExpression varchar(200)
15 DECLARE @StartRowIndex int
16 DECLARE @MaximumRows int
17
18 SET @WebUserID = 'manager'
19 SET @DocumentTypeID = 0
20 SET @DocumentIDPrefix = '%'
21 SET @StartDate = '04/17/2007'
22 SET @EndDate = '04/19/2007'
23 SET @OversoldOnly = 0
24 SET @DexCustomersOnly = 0
25 SET @DeviationsOnly = 0
26 SET @CashNoPaymentOnly = 0
27 SET @SortExpression = ''
28 SET @StartRowIndex = 0
29 SET @MaximumRows = 20;
30
31 EXECUTE @RC = [Odom].[dbo].[w_DocumentHistory_Select]
32 @WebUserID
33 ,@DocumentTypeID
34 ,@RouteID
35 ,@CustomerID
36 ,@DocumentIDPrefix
37 ,@StartDate
38 ,@EndDate
39 ,@OversoldOnly
40 ,@DexCustomersOnly
41 ,@DeviationsOnly
42 ,@CashNoPaymentOnly
43 ,@SignatureName
44 ,@SortExpression
45 ,@StartRowIndex
46 ,@MaximumRows
 

View 3 Replies View Related

Package Runs In 1 Minutes In Visual Studio But Takes 5+ (sometimes Hanges) As Job

Jan 26, 2007

I have an SSIS package that when run from Visual Studio takes 1 minute or less to complete. When I schedule this package to run as a SQL Server job it takes 5+ and sometimes hangs complaining about buffers.

The server is a 4 way 3ghz Xeon (dual core) with 8GB ram and this was the only package running.

When I look in the log I see that the package is running and processing data, although very very very very very slowly.

Has anyone else experienced this?

Thanks for your help

Marcus

View 5 Replies View Related

Upgrading 32 Bit SQL 2000 SP4 Ent Running On 64 Bit Windows 2003 Enterprise To SQL2005 64 Bit In Place

Sep 14, 2005

Will it be possible to do an in-place upgrade from SQL 2000 Server Enterprise SP4 32 bit running on top of 64 bit Windows 2003 Enterprise , clustered, to SQL 2005 Enterprise 64 bit?
The 32 bit SQL 2000 to 64 bit SQL 2005 in place upgrade seems questionable to me...
Anybody tried anything like this?

View 1 Replies View Related

Microsoft##EESS And MSDE SQL 2000 On Windows 2003 Small Business Server

Jan 25, 2007

Currently a server running 2003 small business operating system has MSDE 2000 and Microsoft##SSEE.

A memory problem exists with SQL consuming over 50% of RAM. Total RAM is 4GB.

There is a SQL 2000 patch for this type of problem. However, it calls for SQL to be upgraded to SP4.

Problem:
Can this MSDE 2000 be upgraded with SP4 and have memory patch applied with Microsoft##SSEE also on this box?



Please let me know. Thank you.

View 3 Replies View Related

Service Pack Available For Sql Server 2000 With Windows XP.

Oct 12, 2006

 How to find out the SP available for sql server 2000 with win xp 

View 8 Replies View Related







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