Forum Replies Created

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

  • RE: Bulk insert fails when we use a format file

    Not sure about the error but because your file is character you cannot use SQLINT for field definitions although BCP will output this in a fmt file by default.

    Try this...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Hiring A DBA

    Great article, very informative

    quoteWith the "one job in ten years" policy I'm sure my resume would at the...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: The Daily Lookup

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

    Hey, I resemble that remark

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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,...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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]

       ...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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)

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • 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...

    Far away is close at hand in the images of elsewhere.
    Anon.

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