Forum Replies Created

Viewing 15 posts - 91 through 105 (of 252 total)

  • RE: Are the posted questions getting worse?

    Whew, busy times at work lately. I've been out of The Thread for a good bit :-).

    Anyone else from The Thread planning to attend this week's SQL Saturday in...

  • RE: SQL query to fill RAM?

    If all you're looking for is to gobble up some memory...

    SELECT NEWID()

    FROM sys.columns A

    CROSS JOIN sys.columns B

    CROSS JOIN sys.columns C

    That should chomp up a good amount. Just ran it...

  • RE: Odd Results from an Indexed JOIN Column

    Oh, yep, that's part of what's confusing me currently :-P. That query's part of a stored procedure, and it uses dynamic SQL; however, @StartDate and @EndDate are input parameters...

  • RE: Odd Results from an Indexed JOIN Column

    Haha, actually, this may be the result of an entirely different problem altogether :-P.

    It seems that, for whatever reason, I can't get the procedure containing this query to have a...

  • RE: Odd Results from an Indexed JOIN Column

    Thank you for the response, Ed!

    Some of the answers to your questions are in my original post, but it's quite messy, so no fault of yours! Here's the bits...

  • RE: What is wrong with this syntax? Query will work, but CTE will not "compile"

    Eirikur Eiriksson (4/8/2014)


    hisakimatama (4/8/2014)


    EDIT: Doh, forgot the closing parenthesis.

    The parenthesis where the problem, a CTE does not require the columnar declaration.

    😎

    Aha, so it doesn't :-). I've always declared...

  • RE: What is wrong with this syntax? Query will work, but CTE will not "compile"

    Hrm. Seems like your CTE declaration is missing a few pieces; I believe it should be like so:

    with UnloadDates(ShipmentId,StartTime,EndTime) as(

    select DISTINCT ShipmentID,

    (select Min(starttime)

    from tblInvoice I

    where I.ShipmentID = O.shipmentID

    and DataSent...

  • RE: Finding Gaps in Dates

    Whew. Managed to get some testing done, and Luis's solution certainly worked out. Played around with the code and verified results for a month's worth of data, then...

  • RE: Finding Gaps in Dates

    Aha! Did a quick test on my home instance, and that seems to do it. I'll investigate more when I'm back at work tomorrow and have more data...

  • RE: Finding Gaps in Dates

    Nope, scheduling doesn't matter; if a gap in time exists anywhere, it needs to be reported. If a session starts as the first session of the day, and it...

  • RE: How to repair .mdf file?

    Sushant Yadav (3/21/2014)


    1)

    USE master

    GO

    SELECT NAME,STATE_DESC FROM SYS.DATABASES

    WHERE STATE_DESC='SUSPECT'

    GO

    2)

    USE master

    GO

    ALTER DATABASE database_name SET EMERGENCY

    GO

    3)

    DBCC CHECKDB (database_name)

    GO

    4)

    ALTER DATABASE database_name SET SINGLE_USER WITH ROLLBACK IMMEDIATE

    5)

    DBCC CHECKDB (database_name, REPAIR_ALLOW_DATA_LOSS)

    Please...

  • RE: Privacy and Data

    Data security certainly isn't something that's enforced very well, even by the agencies created to do so :-D. The company I work for handles some sensitive data that's required...

  • RE: Copying data and deleting duplicates

    l.danks (3/14/2014)


    hisakimatama (3/13/2014)


    I'll have a shot at the UPDATE part of this:

    This will generate a test version of your table, for a proof-of-concept test, and make the UPDATE by generating...

  • RE: Copying data and deleting duplicates

    I'll have a shot at the UPDATE part of this:

    CREATE TABLE #Test(ID int,Comments1 varchar(2000),Comments2 varchar(2000),Stamp TimeStamp)

    INSERT INTO #Test(ID,Comments1,Comments2)

    SELECT 123456789, NULL, 'and here too'

    UNION ALL

    SELECT 123456789,'les was here',NULL;

    WITH CTE(ID,Comment) AS(

    SELECT ID,Comments1

    FROM...

  • RE: SQL Coding Horrors

    Haha, yep. The others in my office made a similar remark; "The software is consistent. It's consistently inconsistent!". Which is true; some of the SQL in it...

Viewing 15 posts - 91 through 105 (of 252 total)