Forum Replies Created

Viewing 15 posts - 226 through 240 (of 595 total)

  • RE: GROUP BY WEEK

    quote:


    Hi Jay,

    Just being picky but why do have 'HAVING COUNT(*) > 0' in the query? Is it not superfluous as the query...

  • RE: re: too many arguments provided for stored procedu

    No need to delete the parameters like padmakumar suggested. It would just waste CPU effort. Simply create the command OUTSIDE of the Loop and execute for each record...

  • RE: How do I decide, why index here and not there?

    Actually, sounds like you need an OLAP solution since the data is for reporting only and will be read-only after the initial load. Check out MS OLAP services or...

  • RE: table properties

    These aren't properties of the table, but of the constraint in question that applies to column(s) in the table. Instead of rooting through the system tables trying to set...

  • RE: GROUP BY WEEK

    
    
    SELECT MONTH(DateField) , YEAR(DateField), COUNT(*)
    FROM MyTable
    GROUP BY MONTH(DateField) , YEAR(DateField)
    HAVING COUNT(*) > 0
  • RE: sub query...

    
    
    SELECT a.* FROM TableA a
    WHERE
    EXISTS
    (SELECT * FROM tableB b WHERE a.Column1 = b.column1 AND a.column2 = b.column2)

    or

    
    
    SELECT a.* FROM TableA a
    ...
  • RE: Optimizing SQL 2000

    run the query in query analyzer and look at the execution plan generated. target the section of the query that has the highest percentage of work. If you...

  • RE: SQL in ADO.NET vs Stored Procedure

    Stored procedures are much more maintainable, require less network traffic to transmit commands, and allow permissions to be more finely controlled. Just make sure you put together some sort...

  • RE: what is the best way to search between tow date fd

    
    
    tarih BETWEEN DATEADD(hour, 1, DATEDIFF(day, 0, GETDATE()))
    AND
    DATEADD(hour, 16, DATEDIFF(day, 0, tarihb)))
  • RE: what is the best way to search between tow date fd

    Then you need more parentheses. I think this is what you are looking for:

    
    
    WHERE
    (
    (dbo.mainb.tarih >= CONVERT(varchar, DATEADD([day], 0, GETDATE()), 112) + ' 16:00:00')
    AND...
  • RE: what is the best way to search between tow date fd

    no, your method of using CONVERT(VARCHAR...) is not incorrect, only inefficient. However your where condition:

    
    
    WHERE (dbo.mainb.meosar = 1)
    AND
    (dbo.mainb.tarih >= CONVERT(datetime, CONVERT(varchar, DATEADD([day], 0,...
  • RE: what is the best way to search between tow date fd

    1) ok, this:

    
    
    OR
    (dbo.mainb.tarih >= CONVERT(varchar, DATEADD([day], 0, GETDATE()), 112) + ' 16:00:00') AND (dbo.mainb.tarih <= CONVERT(varchar, DATEADD([day], 0, GETDATE()), 112) + ' 16:00:00')

    doesn't make sense. ...

  • RE: need help optimizing stored procedure

    Ann,

    Have you tried looking at the Execution plan generated by this procedure. I would gues that the JOINs are the least of your worries if there is a proper...

  • RE: what is the best way to search between tow date fd

    your original WHERE clause doesn't make sense for dbo.mainb.tarih...you are saying give me all records that have tarih greater than or equal to today at 1am and tarih is less...

  • RE: what is the best way to search between tow date fd

    Look at the code I posted; it explains how to add (or subtract) hours from GETDATE()...using DATEADD(hour, n, GETDATE())

Viewing 15 posts - 226 through 240 (of 595 total)