Forum Replies Created

Viewing 15 posts - 136 through 150 (of 155 total)

  • RE: OPENQUERY - Is there any way to...

    The method I used for a similar issue to the OP about a year ago was to build up the OPENQUERY() call inside a dynamic statement. Something along the...

  • RE: Database name, best practice?

    In my own opinion, and as a standard I've seen in many different environments, I'd prefer the same name in all environments. This allows you to write scripts that...

  • RE: Memory Utilization

    SQL Server by default will attempt to use all (except for a few hundred MB) of the memory on a server. Given that it's up to 7.4 GB, we...

  • RE: pro's and con's of flatfile db backup

    What exactly do you mean by a "flatfile" database backup? Are you referring to just copying the .MDF and .LDF files to a different location?

    If so, then the biggest...

  • RE: performance problem on Production and test servers but not on local development machines

    A major difference between your development and production environments could be CPU resources, specifically the number of cores. It's possible that in production the Maximum Degree of Parallelism has...

  • RE: Hourly Group By

    Jeff Moden (8/30/2009)


    You certainly had the right idea. Just so you know, though... Since you were striving for a 2k solution, be advised that spt_Values only has 0-255 contiguous...

  • RE: Hourly Group By

    Whoops, I mistakenly thought that spt_values was accurate up to 32K instead of 2048. I should have double-checked that one. The error will manifest as a problem if...

  • RE: Hourly Group By

    I'll do it, because I just love writing SQL Server 2000-compatible code without using temp tables 🙂

    DECLARE @StartDate datetime, @EndDate datetime

    SELECT @StartDate = '2009-08-01', @EndDate = '2009-08-30'

    SELECT Periods.SalesHour, ISNULL(Sales.SalesAmount, 0)...

  • RE: Sql Memory upgrade

    It sounds like AWE hasn't kicked in. Have a look in the ERRORLOG to see if there's an "AWE Enabled" message near the start.

    You've mentioned configuring AWE Enabled with...

  • RE: Hourly Group By

    Jeff Moden (8/30/2009)


    Heh... what are you folks going to do if there's more than one day in the query? 😉

    See if management will change their requirements? 😉

    We've passed...

  • RE: Hourly Group By

    setlan1983 (8/28/2009)


    possible that I list out all the 24 hours sales amount while some of the hours sales amount is zero?

    To do this, you'll need a list of all...

  • RE: Hourly Group By

    It sounds like you're using SQL Server 2000 - I have the same problem running my query under SQL Server 2000. Try this instead, which should work with either...

  • RE: Hourly Group By

    The only way you should get that error is if the "CONVERT(varchar(13), SalesDT, 121)" part used in the SELECT clause is different from the value used in the GROUP BY...

  • RE: Hourly Group By

    What was the error? I'm guessing a conversion error, but the following code block works for me:

    CREATE TABLE #Sales (SalesDT datetime, SalesAmt money)

    INSERT INTO #Sales (SalesDT, SalesAmt) VALUES ('2009-08-28...

  • RE: Hourly Group By

    You could try converting the datetime to a varchar(13), and grouping by that, with a result like '2009-08-28 13'.

    SELECT CONVERT(varchar(13), SalesDT, 121) + ':00', Sum(SalesAmt) AS SalesAmount FROM Sales

    WHERE SalesDT...

Viewing 15 posts - 136 through 150 (of 155 total)