Forum Replies Created

Viewing 15 posts - 181 through 195 (of 14,952 total)

  • RE: "USE DATABASE" in stored procedure

    I don't follow what you're trying to do. Are you trying to get the proc to execute in each database, or trying to get it to insert the statement...

  • RE: Something random to ponder

    Okay, so we don't get confused with District Attorneys, but people think my job title is "Doing Business As". Not much of an improvement. 🙂

    But there are lots of...

  • RE: Max Date from Unnormalized Table

    Can you post the table definition and sample data (as insert statements) instead of an Excel spreadsheet?

    Pardon my paranoia, but this is the internet, and trusting a file that could...

  • RE: Date Comparisons

    lnardozi 61862 (1/9/2013)


    Aargh! I knew that! Failure to engage brain before engaging fingers!

    ROUND(@date,0,1)

    is what I meant.

    That still doesn't get around the implicit conversion issues I pointed out.

    Try this:

    DECLARE @Date DATETIME2...

  • RE: Date Comparisons

    Michael Valentine Jones (1/8/2013)


    paul.j.kemna (1/7/2013)


    Other than issues with sorting and MAX, are there any potential issues with using something like CONVERT([varchar](10), datetimefield, 101) which yields a mm/dd/yyyy varchar value.

    That is,...

  • RE: Decimal separator missed when pasting into excel from sql query

    fbernausberraondo (1/8/2013)


    Thank you very much to you all for your answers. At least I don't feel like a complete newbie as I can see there is not a straightforward solution...

  • RE: sql server memory

    Oracle_91 (1/8/2013)


    Hi Gus,

    I am just testing/learning memory concepts over here. not to throttle any productions systems 🙂

    Ah! That makes sense then.

    Yeah, learning how to deliberately overload the data cache...

  • RE: How's this for a Job Description

    Grant Fritchey (1/8/2013)


    hisakimatama (1/8/2013)


    No kidding. I saw the SQL-related bits and figured the salary was acceptable enough, then I caught the rest of it... Ack. Amusingly, there's...

  • RE: Merge issue

    Do it in two steps. Merge can't insert into a different table. Not really.

  • RE: New more powerful servers are slower than old ones?

    My first guess would be the virtual machines aren't configured correctly for optimal SQL Server performance. If not done exactly right, it's pretty usual to get some performance degredation...

  • RE: Restore C drive (OS, SQL assemblies) to another disk to save the day

    Sounds like it should work. So long as the backup can be restored successfully.

  • RE: Date Comparisons

    If you really need the numeric part of the date, you can do either of these:

    DECLARE @D1 DATETIME = '2013-01-08 13:00', @D2 DATETIME = '2013-01-08 11:00';

    SELECT FLOOR(CAST(@D1 AS FLOAT)), FLOOR(CAST(@D2...

  • RE: Date Comparisons

    lnardozi 61862 (1/8/2013)


    That's why I cast the date as an int. The fractional part of the date is the time. Casting is pretty fast.

    Rounding errors.

    Try this:

    DECLARE @D1 DATETIME = '2013-01-08...

  • RE: Create unique id based on data in table

    Based on your description, that's not really something a relational database does.

    What you need is a separate table of unique combinations of DOB, Source, and Organism. Then assign an...

  • RE: MERGE Statement with two WHEN MATCHED Statements

    That makes sense.

    Looked at a few more details.

    This part isn't correct T-SQL syntax:

    WHEN MATCHED and

    COALESCE('target.[Programabilty_NME] <> source.[Programabilty_NME]', '') <> '' and

    (target.[Programabilty_NME] <> source.[Programabilty_NME])

    THEN

    UPDATE

    SET Expiration_DTM = '2013-01-06 23:59:59.977'

    WHERE Expiration_DTM = '12/31/9999'

    INSERT...

Viewing 15 posts - 181 through 195 (of 14,952 total)