Forum Replies Created

Viewing 15 posts - 1,441 through 1,455 (of 1,472 total)

  • RE: SQL 2005 SCRIPT to COMPARE

    Something like this should work:

    SELECT T.CandidateID,

    Missing=CASE WHEN T1.CandidateID IS NULL THEN 'Missing From Table 1'

    WHEN T2.CandidateID IS NULL THEN 'Missing From Table 2'

    ELSE 'Present in Both'

    END

    FROM (SELECT DISTINCT CandidateID

    FROM...

  • RE: Subquery returned more than 1 value

    Your syntax is all messed up. You have no closing parens on any of your ISNULL's or RTRIM's in addition to numerous other syntactical errors. However, due to...

  • RE: Re: User defined functions

    Would you use user defined functions for manipulations not involving a database table (i.e., string manipulation, input validation, etc.)

    If I wanted to manipulate a single value, or a very small...

  • RE: Appending numbers and text

    The phone number is a float, and when using CAST, it will give you scientific notation.

    Try this one:

    STR(phone, 10,0)

  • RE: Re: User defined functions

    What criteria do you use to evaluate the best option? Examine the query execution plan and select the one with the lowest overall subtree cost? Or something else?

    I personally avoid...

  • RE: Update Multiple Base Tables

    Not to mention the answer he gave had already been given, better, and in more detail before he bumped it. That post was in general a failure of epic...

  • RE: Need help with query

    I just realized that my query will fail in the case that there are no text files associated with a particular date. (IE. If all 5 customers are missing...

  • RE: int to date and time.

    The only thing that made sense to me with the time was that it was

    70004 7:00:04

    210053 21:00:53

    20003 2:00:03

    200002 20:00:02

    Seconds wouldn't work, as there are...

  • RE: Removing white space from a column

    Type faster! =)

  • RE: Need help with query

    So many cross joins, so little time!

    ---------- ALTER TABLE TO NORMALIZE DATA ------------------

    ALTER TABLE #ReportFiles

    ADD ReportDate datetime, Company varchar(20)

    UPDATE #ReportFiles

    SET ReportDate = CONVERT(SMALLDATETIME,SUBSTRING(FileName,1,CHARINDEX('_',filename)-1))

    WHERE ReportDate IS NULL

    UPDATE #ReportFiles

    SET Company = SUBSTRING(filename,CHARINDEX('_',filename,1)+1,(CHARINDEX('.',filename,1)-CHARINDEX('_',filename,1))-1)

    WHERE...

  • RE: Changing a set of Hardcoded values so they are picked up from a table

    I think I'm starting to grasp what you're after here, but to generate a solution, I'd like a bit more information than you've given.

    Please supply the following:

    A sampling of data...

  • RE: Conditional JOIN in a view possible?

    Sergiy:

    Thanks for the tip. I added in a DBCC FREEPROCCACHE before the views and reran the results, but still no differences worth mentioning. I'm guessing that's...

  • RE: WHERE Clause Question

    WHERE FirstName <> 'Jimmy' AND LastName <> 'Woods'

  • RE: Conditional JOIN in a view possible?

    I believed both my coalesce View and the UNION ALL to be viable solutions to your issue, but I was curious as to which was more efficient. I'll post...

  • RE: need help with INSERT

    As bitbucket noted, this question is somewhat limited on information. I went ahead and scripted up a solution(mainly because it gave me another opportunity to use a cross join),...

Viewing 15 posts - 1,441 through 1,455 (of 1,472 total)