Forum Replies Created

Viewing 15 posts - 7,456 through 7,470 (of 8,753 total)

  • RE: Counting how many times a value appears in a column and assigning an incremental number to each one.<!-- 864 -->

    Ed Wagner (8/20/2014)


    Eirikur Eiriksson (8/20/2014)


    Quick question, what SQL Server Version are you on (SELECT @@VERSION)?

    😎

    SQL 2008 SP3 64-bit Standard Edition running on Windows Server 2008 Enterprise.

    Then Lynn's solution is your...

  • RE: Counting how many times a value appears in a column and assigning an incremental number to each one.<!-- 864 -->

    Quick question, what SQL Server Version are you on (SELECT @@VERSION)?

    😎

  • RE: Page Compression

    er.mayankshukla (8/20/2014)


    Hello Experts,

    I had done a page compression on an archive Table on my Dev Server.

    And it significantly reduced the size of the table.

    I have a non clustered index and...

  • RE: Need to Parse a column.

    Quick solution, more a POC than anything else.

    😎

    USE tempdb;

    GO

    DECLARE @TSTR NVARCHAR(200) = N'<TV<MR1#4.0#true#2.0#USD>VT>,<TV<MR2#3.0#true#1.5#USD>VT>,<TV<MR3#0.0#true#0.0#USD>VT>,<TV<MR4#0.375#true#0.19#USD>VT>';

    DECLARE @SQL_STR NVARCHAR(MAX) = N''

    SELECT @SQL_STR = N'select [Model Code],[Persentage],[isAbs],[AppliedValue],[Currency] from (values '

    + REPLACE(REPLACE(REPLACE(@TSTR,N'<TV<',N'('''),N'>VT>',N''')'),N'#',N''',''') + N') as X([Model...

  • RE: SSIS Expression Help

    Quick thought, as this is straight forward in T-SQL, why not do this in the source query?

    😎

    USE tempdb;

    GO

    DECLARE @TESTDATA TABLE

    (

    ID INT...

  • RE: Varying calculation for fixed number of fields

    This is straight forward using the ROW_NUMBER function and setting the order by descending order of the PERIOD. Here is an example that should get you passed this hurdle.

    😎

    USE tempdb;

    GO

    --PERIOD...

  • RE: Slowness in 2012 iwth W authenication

    Quick thougt, sounds more like a network/name resolution issue unless the server is very busy. Try this when you know that the server is less busy, look into the tcp/ip...

  • RE: Adding unique int key using max

    CELKO (8/19/2014)


    would you care to share a definition of the difference of the two?

    You'll be sorry; this is the short version 😀

    Thank you for this and not at all sorry...

  • RE: Adding unique int key using max

    CELKO (8/19/2014)


    First learn that a row is not a record; this is a fundamental concept.

    Next, look at CREATE SEQUENCE.

    Hey Joe,

    would you care to share a definition of the...

  • RE: Are the posted questions getting worse?

    Alvin Ramard (8/19/2014)


    Ed Wagner (8/19/2014)


    SQLRNNR (8/19/2014)


    Luis Cazares (8/19/2014)


    Lynn Pettis (8/19/2014)


    How about this one, starting monthly salary of $4,927 for a Senior Database Developer. That's 2/3 what I made at...

  • RE: Convert decimal(8,0) value to a time value

    John Mitchell-245523 (8/19/2014)


    Eirikur Eiriksson (8/19/2014)


    Quick suggestion, skip the string manipulation, use math and then format to taste.

    😎

    Normally, I'd agree you. On this occasion, however, the string manipulation appears to...

  • RE: XMLQuery on NVARCHAR MAX column using filter

    Using Tavis's data sample, here is a slightly more efficient query

    😎

    DECLARE @ID INT = 2;

    -- Set up table variable

    DECLARE @test_XMLQuery1 TABLE (

    ID INT PRIMARY KEY,

    MSG NVARCHAR(MAX) NOT NULL);

    -- Insert some...

  • RE: Convert decimal(8,0) value to a time value

    sgmunson (8/19/2014)


    The question is, what's the meaning of the last 4 characters. Yes, you could throw them away, but if they hold meaning, that's not usually a good...

  • RE: Convert decimal(8,0) value to a time value

    Quick suggestion, skip the string manipulation, use math and then format to taste.

    😎

    DECLARE @TIMEDECIMAL decimal(8,0) = 12310476;

    SELECT

    CONVERT(VARCHAR(5),DATEADD(MINUTE,(FLOOR((@TIMEDECIMAL / 10000) / 100) * 60)

    ...

  • RE: Are the posted questions getting worse?

    Luis Cazares (8/18/2014)


    Help! I was asked by my DBA to optimize the following query because it has a high cost.

    DELETE MySchema.Facttable

    WHERE datecol = @Date;

    It's part of...

Viewing 15 posts - 7,456 through 7,470 (of 8,753 total)