Forum Replies Created

Viewing 15 posts - 1,486 through 1,500 (of 2,462 total)

  • RE: How to remove special characters like ~,? from column value in a string

    This is a job for patexclude8K.

    CREATE FUNCTION dbo.PatExclude8K

    (

    @String VARCHAR(8000),

    @Pattern VARCHAR(50)

    )

    /*******************************************************************************

    Purpose:

    Given a string (@String) and a pattern (@Pattern) of characters to remove,

    ...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Cursors for SQl server

    As others said, more details: good, cursor for this: bad.

    It sounds like you can accomplish what you are trying to do with two update statements.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Create SSRS reports on my Workstation

    For a great tutorial try the Stairway to SQL Server Reporting Services[/url] right here on SSC.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Parameter Problem

    Using this DDL and sample data:

    USE tempdb

    GO

    CREATE TABLE dbo.[ACTION]

    (

    actionid int not null,

    actionvalue varchar(100) not null

    );

    CREATE TABLE dbo.ACTIONRESULT

    (

    resultid int primary key,

    actionid int not...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Usage of CTE - Trick with Dates

    Thomas Schutte (5/15/2015)


    In this case I would use a simple tally table:

    DECLARE @source TABLE (SegNo int, Date_Field smalldatetime, Month_Count int, Payment decimal(10,2))

    DECLARE @tally TABLE (N int)

    INSERT INTO @tally(N)

    SELECT ROW_NUMBER() OVER...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: PatExclude8K

    Thank you for the kind words Iwas

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Are the posted questions getting worse?

    GilaMonster (5/14/2015)


    Question for the people here...

    Over the years I've been very careful to keep my blog completely non-commercial, no adverts, no plugs for my company, nothing. Partially because when I...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: ghostscript to auto print a generated Reportservices Report

    Please don't cross-post.

    Original Post here: http://www.sqlservercentral.com/Forums/Topic1685618-3077-1.aspx

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Ghostscript to auto print reporting services report

    I'm curious - how is that script supposed to know what Report it's supposed to print?

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Need Help to sort alpha numeric values

    ORDER BY <column name>

    Add DESC at the end if you want to sort in descending order

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Import XML only gives Null results

    That's correct, XML is case sensitive.

    It's worth noting that you can improve you performance by adding a reference to the text node like so:

    SELECT CBAADO = x.data.value('(cbaado/text())[1]','varchar(3)'),

    ...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Column Store vs Row Store Indexes

    I just finished this article and learned a few things. Well done.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Day wise and date range calculation with looping or dynamic data

    See the link in my signature line for best practices on getting help then post DDL and sample data.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Need help with tuning a join query

    Prem-321257 (5/13/2015)


    Thanks for the tips!

    I changed the outer join to inner join and then using >= and <= operator instead of between. The execution time is now less then...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Change Query to only show 3 years of older dates

    I don't know which column is your datecol but something like this:

    WHERE <datecolumn> <= DATEADD(YEAR,-3,getdate())

    We would also have to determine exactly what you mean by "three years old" e.g. leap...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

Viewing 15 posts - 1,486 through 1,500 (of 2,462 total)