Forum Replies Created

Viewing 15 posts - 6,586 through 6,600 (of 8,761 total)

  • RE: How to show last purchased rate in all months of output? New

    serg-52 (11/14/2014)


    VSP (11/13/2014)


    Eirikur Eiriksson (11/12/2014)


    Koen Verbeeck (11/12/2014)


    David Burrows (11/12/2014)


    However max(rate) over( partition by product) will not work if the rate varies +/- and the latest value by date is needed

    In...

  • RE: Error creating temp table based on IF logic

    You are right on this, Luis's approach is better as it doesn't switch session contexts, just wanted to make the point that there are always alternatives.;-)

    😎

  • RE: Error creating temp table based on IF logic

    How about this

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    DECLARE @PrVers NVARCHAR(128)

    , @PrVersNum DECIMAL(10,2)

    , @StageTable NVARCHAR(1024) = N''

    SET @PrVers = CAST(SERVERPROPERTY('ProductVersion') AS NVARCHAR(128));

    SELECT @PrVersNum = SUBSTRING(@PrVers, 1,CHARINDEX('.', @PrVers) + 1 )

    PRINT @PrVers

    PRINT @PrVersNum...

  • RE: Error creating temp table based on IF logic

    Quick suggestion, not as elegant as Luis's but should work

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    DECLARE @PrVers NVARCHAR(128)

    , @PrVersNum DECIMAL(10,2)

    , @StageTable NVARCHAR(1024) = N''

    SET @PrVers = CAST(SERVERPROPERTY('ProductVersion') AS NVARCHAR(128));

    SELECT @PrVersNum = SUBSTRING(@PrVers,...

  • RE: Correlated Subquery - very slow performance when transitioned from SQL Server 2008 to SQL Server 2012

    Hi and welcome to the forum. Just a quick note, in order to provide a sound advice on your query, some additional information is needed. Could you please provide the...

  • RE: Sorting out capitalisation

    Just for quick fun, here is an alternative approach, should be easy to turn it into an iTVF (SQL Server 2012 and later)

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    DECLARE @CAP_TEXT VARCHAR(50) = 'UPPER...

  • RE: Query Performance

    Quick thought, in order to provide meaningful answer to your question, some more information is required. Could you post DDL, sample data and preferably the actual execution plans for both...

  • RE: SQL, MS Query and MS Excel

    Quick question, can you provide the actual query and the table structure?

    😎

  • RE: Please help - Date Overlapping

    Quick solution for educational and entertainment purposes (read "spanner in the works") using slight modification of Jack Corbett's data preparation.

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

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

    CREATE...

  • RE: How to show last purchased rate in all months of output? New

    Koen Verbeeck (11/12/2014)


    Eirikur Eiriksson (11/12/2014)


    Koen Verbeeck (11/12/2014)


    Eirikur Eiriksson (11/12/2014)


    Koen Verbeeck (11/12/2014)


    David Burrows (11/12/2014)


    However max(rate) over( partition by product) will not work if the rate varies +/- and the latest value...

  • RE: How to show last purchased rate in all months of output? New

    Koen Verbeeck (11/12/2014)


    Eirikur Eiriksson (11/12/2014)


    Koen Verbeeck (11/12/2014)


    David Burrows (11/12/2014)


    However max(rate) over( partition by product) will not work if the rate varies +/- and the latest value by date is needed

    In...

  • RE: Using ":" in and attribute name in an xml file

    imran 60091 (11/12/2014)


    Hi, Im running on SQL Server 2008 R2.

    Just tried this on SQL Server 2014 and it throws an error:

    Msg 9456, Level 16, State 1, Line 1

    XML parsing: line...

  • RE: How to show last purchased rate in all months of output? New

    Koen Verbeeck (11/12/2014)


    David Burrows (11/12/2014)


    However max(rate) over( partition by product) will not work if the rate varies +/- and the latest value by date is needed

    In that case an ORDER...

  • RE: How to show last purchased rate in all months of output? New

    Quick suggestion, use the row_number function

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON

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

    create table dbo.test

    (

    product varchar(50),

    QTY int,

    ...

  • RE: Read dynamic columns from an excel into SSIS

    duggal.priyanka06 (11/11/2014)


    Hi

    I have an excel file which has dynamic columns

    i.e. Col1, Col2, Col3 this week. next week i will have a new Col4 in the sheet. This will keep...

Viewing 15 posts - 6,586 through 6,600 (of 8,761 total)