Forum Replies Created

Viewing 15 posts - 286 through 300 (of 1,192 total)

  • RE: Hpw to make SUM() return in BIGINT

    Edvard Korsbæk (10/23/2014)


    Gazareth (10/23/2014)


    SUM supports BIGINTs, so just cast the case statements into BIGINT, something like this:

    SELECT

    SUM(CAST(CASE WHEN A.posetive_negative = 1 AND (B.dutyrosternorm = 0 OR A.Timesum = 1)...

  • RE: Hpw to make SUM() return in BIGINT

    SUM supports BIGINTs, so just cast the case statements into BIGINT, something like this:

    SELECT

    SUM(CAST(CASE WHEN A.posetive_negative = 1 AND (B.dutyrosternorm = 0 OR A.Timesum = 1) AND A.Counterbalance_date BETWEEN...

  • RE: Are the posted questions getting worse?

    rodjkidd (10/22/2014)


    Talk of barbecues and England reminds me of a party I went to years ago, the barbecue was one guy flipping burgers while another held an umbrella over the...

  • RE: eliminating divide by zero error

    Hi Drew,

    I get where you're coming from, but those ISNULLs are to prevent incorrect results, as NULL + 5 + NULL = NULL. They won't prevent divide by zero errors.

    My...

  • RE: File Size from T-SQL

    Jeff Moden (10/20/2014)


    Gazareth (10/20/2014)


    Yep, just use a UNC path - \\servername\... instead of the local path.

    It's a bit more work to insert into a SQL table but thought you could...

  • RE: File Size from T-SQL

    Yep, just use a UNC path - \\servername\... instead of the local path.

    It's a bit more work to insert into a SQL table but thought you could do a speed...

  • RE: File Size from T-SQL

    In Powershell it should be something like this - just change 'c:\' to the top folder you want to query.

    Set-Location 'c:\'

    Get-ChildItem -Recurse | Where-Object {$_.PSIsContainer -eq $false} | Select-Object Name,...

  • RE: File Size from T-SQL

    spaghettidba (10/17/2014)


    If this is an import project, SSIS might be what you're looking for

    Seconded.

  • RE: Google shutting down SQL Error Searches?

    Haven't seen it myself, but plugging your search into google does give me the 'we're sorry...' page

    Played about with the search term & it's the nnnnnnnn..nnnnnnnnnn bit that google seems...

  • RE: Can't remotely connect to SQL Server 2008 R2?

    What error is showing on your colleague's machine when he tries to connect?

  • RE: File Size from T-SQL

    Not sure you can do this directly in T-SQL without using xp_cmdshell.

    I'd highly recommend investigating Powershell as a solution.

    Note if there's a lot of files it's likely to be slow...

  • RE: Using SMO to move tempdb

    Hi Jako,

    Your third line has a typo - $smo.datases instead of $smo.databases which probably doesn't help.

    Try calling the Alter method at the database level rather than the file level:

    $smo.databases["TempDB"].Alter()

    Remember you'll...

  • RE: Wanted to check good / alive SQL Servers through script.

    Talking to yourself again Gaz? 😉

    Gaz

  • RE: Are the posted questions getting worse?

    Congrats Grant!

  • RE: Are the posted questions getting worse?

    Luis Cazares (10/14/2014)


    In an unrelated topic, have you ever seen a code and want to vomit but after formatting it you just want to cry? I really can't understand how...

Viewing 15 posts - 286 through 300 (of 1,192 total)