maintenance

Technical Article

RE: nested cursors

  • Reply

I am not sure if this always works, but could you try removing the print and select statements in the following code (for second SP) WHILE ( @fetch_status2= 0) BEGIN select @cmplt_code WHILE (@Month <> 14) BEGIN print @month Do Let me know if it worked for you Edited by - mandard on 06/24/2003 12:24:39 […]

You rated this post out of 5. Change rating

2003-06-24

Technical Article

RE: Move sqlserver to another server

  • Reply

I have done this exact thing and found it worked much more easily than expected. 1. backup db's, including master - just in case 2. down server remove drives 3. Hookup drives to new box, and if the drive designation is the same as it was before then continue, else backup, detach and reattach as […]

You rated this post out of 5. Change rating

2003-06-19

Technical Article

RE: Combining Two Grouping Select Statements

  • Reply

This is not what the poster is asking for. They are requesting that in the same query, return both scalar and non-scalar aggregates, ie count of all and also count of a single group, and given the format the poster wanted (repeating the scalar aggregate in each row), none of the solutions presented so far […]

You rated this post out of 5. Change rating

2003-06-19

Technical Article

RE: Combining Two Grouping Select Statements

  • Reply

You need to use a CASE statment instead of WHERE clause to restrict the values going into the aggregate. The code below assumes that you can't have negative values in dbo.Defect_Data.SUMDEFECTS. So you don't need to restrict the input to the SUM. If you did, you would use a CASE statement as with QDefectCount, but […]

You rated this post out of 5. Change rating

2003-06-19

Technical Article

RE: Combining Two Grouping Select Statements

  • Reply

You need to use a CASE statment instead of WHERE clause to restrict the values going into the aggregate. The code below assumes that you can't have negative values in dbo.Defect_Data.SUMDEFECTS. So you don't need to restrict the input to the SUM. If you did, you would use a CASE statement as with QDefectCount, but […]

You rated this post out of 5. Change rating

2003-06-19

1 reads

Technical Article

RE: Combining Two Grouping Select Statements

  • Reply

You need to use a CASE statment instead of WHERE clause to restrict the values going into the aggregate. The code below assumes that you can't have negative values in dbo.Defect_Data.SUMDEFECTS. So you don't need to restrict the input to the SUM. If you did, you would use a CASE statement as with QDefectCount, but […]

You rated this post out of 5. Change rating

2003-06-19

1 reads

Technical Article

RE: shrink logs

  • Reply

The script below will solve your problem,it runs for bot sql 7.0 an sql 2000. -- Caution : database compatibility level must be 7.0 or higher .. dbcc shrinkfile ( [Logical Log File Name], truncateonly ) backup log [Logical Database Name] with truncate_only GO if exists ( select * from sysobjects where name ='tmp_00000000000001a') drop […]

You rated this post out of 5. Change rating

2003-06-19

1 reads

Technical Article

RE: Combining Two Grouping Select Statements

  • Reply

With all the time we spent on this thread you probably could have just done 2 calls to the database, and used the results of the second call in your summary row... I'm all out of ideas. Generally, I try to break unrelated queries into different resultsets; perhaps someone else out there has an answer...

You rated this post out of 5. Change rating

2003-06-18

2 reads

Blogs

SQL Saturday Boston 2024 Slides

By

Thanks to everyone that came to my talks. Slides are below. Best Practices for...

Small Data SF 2024

By

I can’t remember how I heard about Small Data SF 2024, but it caught...

A New Word: Moledro

By

moledro – n. a feeling of resonant connection with an author or artist you’ll...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers