Forum Replies Created

Viewing 15 posts - 751 through 765 (of 2,452 total)

  • RE: Split single column into multiple sql

    Nallya (5/5/2016)


    Its for single record I have 10 million records in table.

    and space betwwen two values is not fixed .

    somewhre its 3 to 10

    please see this article that shows how...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: How toGet column name with changing value in SQL-server

    saroj9958 (5/4/2016)


    can I have any Idea for this.

    Saroj

    yes, I am sure you can.

    but before this can be easily delivered......can you please provide sample table scripts/insert data/expected results....examples and links...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: To find the difference between two datetimes

    wwwnlc111 (5/4/2016)


    Hi,

    I need to show SQL job execution for last 30 days at what time, this mean I have Date and time.

    Now question how I can take Time (hh:mm) for...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Script to calculate Fiscal Year from Date

    DECLARE @calendardate datetime

    SET @calendardate = '20160901'

    SELECT fiscal_year = CASE

    ...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Gaps and islands sql : Condense upstream data

    sunil.mvs (5/2/2016)


    Tons of Thanks to you , in fixing and finding solution . But I am not sure , how it works on production data . As of now...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Gaps and islands sql : Condense upstream data

    to the OP

    you have marked my code as correct but havent posted any comments?

    would be interested to know how you are getting on. ??

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: out of my depth... server with BSOD!

    jasona.work (5/1/2016)


    First up, Phil has it right. Get backups of *ALL* the databases on the server and test restore them. It doesn't have to be to a "server,"...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: out of my depth... server with BSOD!

    Phil Parkin (4/30/2016)


    First things first: protect the data. Get him to get backups and to restore them on another server to verify them.

    Then ensure that regular backups are in place.

    Then...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Gaps and islands sql : Condense upstream data

    Jacob Wilkins (4/29/2016)


    J Livingston SQL (4/29/2016)


    Jacob...dont seem to get the results expected from your code in comparison to mine.....have I misread your code:

    You didn't misread it, but the sample data...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Gaps and islands sql : Condense upstream data

    Jacob...dont seem to get the results expected from your code in comparison to mine.....have I misread your code:

    -- create some test data

    USE tempdb

    GO

    IF OBJECT_ID('tempdb..tempdata', 'U') IS NOT NULL

    ...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Gaps and islands sql : Condense upstream data

    my test script......responses appreciated !

    -- create some test data

    USE tempdb

    GO

    IF OBJECT_ID('tempdb..tempdata', 'U') IS NOT NULL

    DROP TABLE tempdb..tempdata ;

    WITH ctetrans as (

    SELECT TOP 5000000

    BusName = CHAR(Abs(Checksum(Newid()))...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Gaps and islands sql : Condense upstream data

    Jacob Wilkins (4/29/2016)


    J Livingston SQL (4/29/2016)


    Hi Jacob.....

    on a larger data set I am getting

    A TOP or FETCH clause contains an invalid value.

    any ideas please?

    Ah, most likely you have a NULL...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Gaps and islands sql : Condense upstream data

    Hi Jacob.....

    on a larger data set I am getting

    A TOP or FETCH clause contains an invalid value.

    any ideas please?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Gaps and islands sql : Condense upstream data

    maybe.....

    CREATE table #temp (SysKey int identity(1,1) ,BusName varchar(9) ,BusType varchar(6) ,StartDateKey Datetime ,EndDatekey Datetime)

    Insert into #temp (BusName,BusType,StartDateKey,EndDatekey)

    Select 'A' ,'AC', '20130401', '20130402' union ALL

    Select 'A' ,'AC', '20130403' ,'20130404' union ALL

    Select 'A'...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Does T-SQL have a means of iterating over the columns of a table?

    Rod at work (4/28/2016)


    Jeff, your reply was very interesting. I'm saving that for when I have a discussion with my boss about this. I am especially interested in the statistics...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 15 posts - 751 through 765 (of 2,452 total)