Forum Replies Created

Viewing 15 posts - 3,571 through 3,585 (of 8,761 total)

  • RE: Sorting by a NVARCHAR nullable column

    Piling on

    ๐Ÿ˜Ž

    IF OBJECT_ID(N'dbo.TBL_SAMPLE_ACTIVITY_DATA') IS NOT NULL DROP TABLE dbo.TBL_SAMPLE_ACTIVITY_DATA;

    CREATE TABLE dbo.TBL_SAMPLE_ACTIVITY_DATA

    (

    Workid INT IDENTITY(1,1) NOT NULL

    ...

  • RE: Are the posted questions getting worse?

    jasona.work (5/19/2016)


    yb751 (5/19/2016)


    jasona.work (5/19/2016)


    Brandie Tarvin (5/19/2016)


    Greg Edwards-268690 (5/19/2016)


    Brandie Tarvin (5/19/2016)


    GilaMonster (5/19/2016)


    Lynn Pettis (5/18/2016)


    Found this on my Facebook newsfeed: https://www.packtpub.com/packt/offers/data-week-2016.

    Oooh. Am very tempted to grab both the R and the Data...

  • RE: Are the posted questions getting worse?

    Brandie Tarvin (5/19/2016)


    GilaMonster (5/19/2016)


    Lynn Pettis (5/18/2016)


    Found this on my Facebook newsfeed: https://www.packtpub.com/packt/offers/data-week-2016.

    Oooh. Am very tempted to grab both the R and the Data bundles.

    The free book yesterday (Machine Learning with...

  • RE: Select with NOLOCK is trying to get a shared lock

    GilaMonster (5/18/2016)


    Eirikur Eiriksson (5/18/2016)


    Nolock ignores the locks of others but still takes shared locks.

    No it doesn't.

    Thanks again Gail for the correction :Whistling:

    ๐Ÿ˜Ž

  • RE: Select with NOLOCK is trying to get a shared lock

    Avalin (5/18/2016)


    I have a select-query using the WITH(NOLOCK) hint to ignore locks. The problem is that when the query is executed it get timed out because it's waiting for a...

  • RE: Go in SP

    Piling on

    ๐Ÿ˜Ž

    -- this works

    USE TEEST;

    go

    select object_id as GO

    from sys.objects so

    -- this doesn't

    USE TEEST;

    go

    select object_id as

    GO

    from sys.objects so

    The latter returns

    Msg 102, Level 15, State 1, Line 10

    Incorrect syntax near 'as'.

    Msg...

  • RE: Go in SP

    dallas13 (5/17/2016)


    We never use GO at the end of SP in sql 2005 and we never had any issues from application.

    Now we migrated to sql 2014 and we are getting...

  • RE: Divide two function columns

    SELECT

    *

    ,(A)SUM(J.JourneyDistanceMiles)

    ,(B)SUM(J.JourneyTotalFuelUsed)*0.219969157

    ,(A)SUM(J.JourneyDistanceMiles) / NULLIF(((B)SUM(J.JourneyTotalFuelUsed)*0.219969157),0) as [MPG]

    FROM tablename;

    ๐Ÿ˜Ž

  • RE: Divide two function columns

    If the divisor is zero then obviously the division is invalid, next thing for you is to check your data

    ๐Ÿ˜Ž

  • RE: Divide two function columns

    Then force NULL output if the divisor is 0

    ๐Ÿ˜Ž

    SELECT

    *

    ,(A)SUM(J.JourneyDistanceMiles)

    ,(B)SUM(J.JourneyTotalFuelUsed)*0.219969157

    ,(A)SUM(J.JourneyDistanceMiles) / NULLIF(((B)SUM(J.JourneyTotalFuelUsed)*0.219969157),0) as [(NEW COLUMN) A/B AS...

  • RE: Divide two function columns

    How about this?

    ๐Ÿ˜Ž

    SELECT

    *

    ,(A)SUM(J.JourneyDistanceMiles)

    ,(B)SUM(J.JourneyTotalFuelUsed)*0.219969157

    ,(A)SUM(J.JourneyDistanceMiles) / ((B)SUM(J.JourneyTotalFuelUsed)*0.219969157) as [(NEW COLUMN) A/B AS MPG]

    FROM tablename

  • RE: Are the posted questions getting worse?

    Lowell (5/16/2016)


    Complete non-sequitur here guys, but I'm rather pleased with myself.

    I just got my MCSA after taking 70-463 Implementing a Data Warehouse in SQL Server 2012/2014.

    I had set a mental...

  • RE: Are the posted questions getting worse?

    GilaMonster (5/16/2016)


    jasona.work (5/16/2016)


    Somedays, I envy you folks living in places that don't have "weather" like what we've had these past couple weeks...

    Last weekend, we had the windows of the house...

  • RE: Tally OH! An Improved SQL 8K โ€œCSV Splitterโ€ Function

    Solomon Rutzky (5/15/2016)


    You should check the default Collation for the Database that was current when you ran that test. I suspect that it is using a Windows Collation (i.e. non-SQL_),...

  • RE: Tally OH! An Improved SQL 8K โ€œCSV Splitterโ€ Function

    Piling on on the CHAR(0), here are some of my favorites:

    ๐Ÿ˜Ž

    SET NOCOUNT ON;

    DECLARE @STR_WITH_ZERO_CHAR VARCHAR(20) = '123456789' + CHAR(0) + '1234567890';

    -- CHARINDEX will not return the position of the CHAR(0)

    SELECT...

Viewing 15 posts - 3,571 through 3,585 (of 8,761 total)