Forum Replies Created

Viewing 15 posts - 1,846 through 1,860 (of 3,543 total)

  • RE: Hiring A DBA

    Great article, very informative

    quoteWith the "one job in ten years" policy I'm sure my resume would at the...
  • RE: The Daily Lookup

    quote...I like to poke fun at developers who dabble in SQL...

    Hey, I resemble that remark

  • RE: query to fetch records of last 7 day inclu....

    The only problem is with milliseconds for times of '23:59:59.003' to '23:59:59.997' which if present on day-8 then your query would include it.

    Therefore you would to use CONVERT(varchar(12), DATEADD(day, -8,...

  • RE: help we write this SQL weekday query

    SET DATEFIRST 1

    SELECT (DATEDIFF(week,'20060101',GETDATE())*5)+DATEPART(weekday,GETDATE())

    providing it is not run on a Sat/Sun

  • RE: query to fetch records of last 7 day inclu....

    WHERE DATEDIFF(day,[Date],GETDATE()) <= 7

    but this will not utilise any index on the date column

    whereas Peters solution will

  • RE: After delete Trigger on Transaction

    Your problem occurs when you have multiple deletes invlolving multiple accounts

    This would be my (ANSI-92  standard) way of doing it

    UPDATE a

    SET a.balance = a.balance - d.adjustment

    FROM accountBalance a...

  • RE: Grouping Issue

    Plus it would be more efficient to put the results of the two tables combined into a temp table first and then using that table. This would avoid the multiple...

  • RE: Grouping Issue

    Try this

    SELECT b.[RANK], MAX(b.[Url]) AS [Url], b.[DomainName]

    FROM (SELECT MAX(ss.[RANK]) AS [RANK], docs.[DomainName]

        FROM ContainsTable(Machinery_Docs, *, 'Lathe') AS ss

        INNER JOIN Machinery_Docs docs ON ss. = docs.[Url]

       ...

  • RE: What datatype is recommended for joining tables

    Lookup CHECKSUM in BOL, the recommendation of the use of an additional indexed hash column (int) may improve your queries.

  • RE: looking for images

    quote...a well-formed XML schema againt which well-formed HTML can be validated.

    There is a XML Schema for XHTML

  • RE: looking for images

    Not much

    SUBSTRING(col1,

      PATINDEX('%<IMG%',col1) + PATINDEX('%src="%',SUBSTRING(col1,PATINDEX('%<IMG%',col1),255))+4,

      PATINDEX('%"%',

        SUBSTRING(col1,PATINDEX('%<IMG%',col1) +

          PATINDEX('%src="%',SUBSTRING(col1,PATINDEX('%<IMG%',col1),255))+4,255)) - 1)

  • RE: Help with report-like sproc thing

    SELECT a.ActTitle AS [Activity],

    ISNULL(p.Progress,0) AS [Progress],

    ISNULL(p.Progress,0)*a.PercentageofWork/100 AS [Actual Work Weightage],

    SUM(ISNULL(p.Cumulative,0)) AS [Cumulative]

    FROM @Activities a

    LEFT OUTER JOIN (SELECT p2.ActID,

    SUM(CASE WHEN p2.WeekID = @WeekID THEN p2.ProgressPerc...

  • RE: Help with report-like sproc thing

    SELECT a.ActTitle AS [Activity],

    ISNULL(p.Progress,0) AS [Progress],

    ISNULL(p.Progress,0)*a.PercentageofWork/100 AS [Actual Work Weightage],

    ISNULL(p.Cumulative,0) AS [Cumulative]

    FROM @Activities a

    LEFT OUTER JOIN (SELECT p2.ActID,

    SUM(CASE WHEN p2.WeekID = @WeekID THEN p2.ProgressPerc...

  • RE: Help with report-like sproc thing

    SELECT a.ActTitle AS [Activity],

    ISNULL(p.ProgressPerc,0) AS [Progress],

    ISNULL(p.ProgressPerc,0)*a.PercentageofWork/100 AS [Actual Work Weightage],

    ISNULL((SELECT SUM(ISNULL(p2.ProgressPerc,0)) FROM @ProgressTbl...

  • RE: looking for images

    This is because one of the CHARINDEX is returning 0 (string not found) and being subtracted from resulting in a negative number for length to a substring, hence the error.

    What...

  • Viewing 15 posts - 1,846 through 1,860 (of 3,543 total)