Forum Replies Created

Viewing 15 posts - 481 through 495 (of 2,452 total)

  • RE: sql server 2014 Analytical data

    This article may get you on your way

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    Hint :

    SELECT ID,

    Value,

    ROW_NUMBER() OVER (PARTITION BY ID ORDER BY Value) rn

    FROM <yourtablename>

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

  • RE: find date range inside date range

    losstww (7/29/2016)


    I have a driver table that contains daily driving records for each day. There are two drivers per tractor, and I want to return all records where one...

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

  • RE: find date range inside date range

    first off please read this

    https://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/

    then post back with the necessary script that allows us to easily set on our own systems.

    suggest that you also post some more sample...

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

  • RE: SQL Server 2016 Justification

    One of the arguments was way faster.

    what were your other arguments?

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

  • RE: Tracing data movement through backend SQL stored procedures and functions

    further to the good ideas by Kevin....I am wondering if your requirement of "data movement" translates to audit tables that record changes made to the SQL data, by whom and...

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

  • RE: sql query

    maybe a start ?

    SET DATEFIRST 1 -- WEEK IS MONDAY THRO SUNDAY

    DECLARE @input INT= 201552;

    DECLARE @wk INT= RIGHT(@input, 2);

    DECLARE @yr INT= LEFT(@input, 4);

    DECLARE @fdow DATE =

    (SELECT CONVERT( DATE,...

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

  • RE: How to calculate YTD from Given From date ?

    raghuldrag (7/26/2016)


    Hi Friends,

    Without setting a financial year start and end date I wanna get the output

    i.e

    the user takes a report from '01-jun-2010' and '30-jun-2010' (only input from...

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

  • RE: Flattening Nested Views

    drew.allen (7/26/2016)


    just be easier to do it manually.

    Drew

    agree

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

  • RE: How can I find where the table is ? Which database ?

    qucik google threw up this

    https://social.technet.microsoft.com/wiki/contents/articles/17958.find-a-table-on-a-sql-server-across-all-databases.aspx

    any good for you?

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

  • RE: Flattening Nested Views

    jmann84 (7/26/2016)


    Hi All,

    I am in clean up mode from a previous DBA who loved to nest views when he was building scripting.

    I can peel these apart by hand, but some...

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

  • RE: T-SQL formatting tool

    well you could always do it online at http://poorsql.com/...maybe a few more key strokes ( cut and paste ) but if its important what the heck 🙂

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

  • RE: T-SQL formatting tool

    DBA From The Cold (7/26/2016)


    Downloaded and installed first the express dbforge version and then the full trial but unfortunately it doesn't work for backup/restore statements either.

    Ah well...

    can you post some...

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

  • RE: Complex join and sorting the parent and child data

    ChrisM@Work (7/26/2016)


    J Livingston SQL (7/26/2016)


    cant fathom your sort order...please explain

    cant see how "Order data based on latest year first and then City code and then Subcitycode " delivers what you...

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

  • RE: Complex join and sorting the parent and child data

    cant fathom your sort order...please explain

    cant see how "Order data based on latest year first and then City code and then Subcitycode " delivers what you have posted?

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

  • RE: Complex join and sorting the parent and child data

    is it as simple as this ....??

    SELECT * FROM (

    SELECT * FROM #City

    UNION ALL

    SELECT * FROM #Subcity) x

    ORDER BY Years DESC, Citycode, subcitycode

    edit....just rechecked my results.....aint what you have...

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

Viewing 15 posts - 481 through 495 (of 2,452 total)