Forum Replies Created

Viewing 15 posts - 2,311 through 2,325 (of 2,452 total)

  • RE: Tricky pivot

    have a read of the following two articles..hopefully it will give you some ideas

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

    http://www.sqlservercentral.com/articles/Crosstab/65048/

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

  • RE: Migration........

    VM-723206 (7/26/2010)


    Try this.. The code below has Data as your table and PinCode, the column.

    declare @table table (LengthOfPincode int, AddZeros varchar(10))

    insert into @table values (1,'00000')

    insert into @table values (2,'0000')

    insert into...

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

  • RE: Select Query

    Raghavender (7/26/2010)


    Sorry...not null values its showing no values.

    SELECT instance_name, verified_name

    FROM dbo.Table1

    WHERE ...

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

  • RE: Is Data Integrity really important or not

    Interesting thoughts in Chapter 6

    http://www.red-gate.com/specials/Ebooks/Defensive_Database_Programming.pdf

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

  • RE: Display two columns from different statements

    MrCapuchino (7/24/2010)


    Thanks Everyone

    You are welcome....out of cuiriosity what did you decide to use?

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

  • RE: Display two columns from different statements

    Hi

    Not sure sure if this is what are you are trying to acheive...but this may give you a few ideas

    For future reference you will find you will get better...

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

  • RE: How to pivot this data ?

    sanujss (7/23/2010)


    I want the result to be shown like

    Priyan Zid...

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

  • RE: Average Inventory (Stock) Age

    Steve

    No probs...as Jeff says you must "obey all the rules"...good luck with your Boss on this one.

    fyi...I am still xref'ng against the vendors results to "prove" my results...cant go live...

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

  • RE: Format report data in the app or in SQL?

    Truth is, it doesn't really matter, especially in a smaller environment, so long as everyone who works on your system is on the same page. You really want to...

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

  • RE: building a date from getdate()

    https://www.sqlservercentral.com/blogs/lynnpettis/archive/2009/03/25/some-common-date-routines.aspx

    Good article by Lynn Pettis above that should get you started

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

  • RE: Average Inventory (Stock) Age

    IF OBJECT_ID('dbo.Stock_TransactionsEx') IS NOT NULL

    DROP TABLE [Stock_TransactionsEx]

    GO

    CREATE TABLE [Stock_TransactionsEx](

    [ProductID] [int] NOT NULL,

    [QuantityPurchased] [int] NOT...

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

  • RE: Average Inventory (Stock) Age

    LutzM (7/20/2010)


    But before giong all crazy make sure this code will produce exactly the same result like the vendors code. First of all, the results have to be correct. Performance...

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

  • RE: Average Inventory (Stock) Age

    Extraordinary..........:w00t:

    Running on SQL 2000...7 year old box with 4gb RAM

    100K products

    20M transaction lines

    sub 1 minute !!!!

    beats the hell out of the vendor's app (2½hrs)...but that sits on a different type...

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

  • RE: Average Inventory (Stock) Age

    Hi Lutz....think you may have cracked it....many thanks.

    Will need to run against production and see how well it performs on 100K products and 20M transactions....will post back.

    Graham

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

  • RE: Average Inventory (Stock) Age

    LutzM (7/19/2010)


    I think the solution I posted will not cover all scenarios (e.g. if the 2nd or 3rd ProductID will have a stock less than the amount received last).

    I'll 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 - 2,311 through 2,325 (of 2,452 total)