Forum Replies Created

Viewing 15 posts - 2,056 through 2,070 (of 2,462 total)

  • RE: Phone number question - detecting and replacing

    dwain.c (9/23/2013)


    matt6749 (9/23/2013)


    I respect your wish to have structured forum dialog, but it appears that, for this relatively simple question, helpful suggestions are possible without INSERT INTO and CREATE TABLE...

    "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: Tally OH! An Improved SQL 8K “CSV Splitter” Function

    Thanks Dwain!

    "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: Tally OH! An Improved SQL 8K “CSV Splitter” Function

    Solomon Rutzky (11/5/2013)


    Alan.B (11/5/2013)


    With your question about reasonableness, it's up to you. If performance wasn't an issue, why maintain two different functions? If it does matter, you can create a...

    "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: Tally OH! An Improved SQL 8K “CSV Splitter” Function

    Thanks!

    With your question about reasonableness, it's up to you. If performance wasn't an issue, why maintain two different functions? If it does matter, you can create a calculated column on...

    "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: Tally OH! An Improved SQL 8K “CSV Splitter” Function

    Forgive me if the code to do this has already been posted but I had a requirement for a greater-than-8k splitter. I made the following changes:

    1) Changed @pString to...

    "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: udf very slow?

    Jeff Moden (10/31/2013)


    Eric Mamet (10/31/2013)


    I know but I was hoping it would be fast...

    Just talked to my customer and I'll try using CLR!

    Yipee!!! 😀

    Heh... hate to throw a...

    "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: XML element contains foreign language

    No Problem:-)

    "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: udf very slow?

    I know but I was hoping it would be fast...

    Just talked to my customer and I'll try using CLR!

    Yipee!!!

    I don't know if a CLR is going to be the...

    "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: XML element contains foreign language

    I've run into this before. Take a look at this article: http://nerdwords.blogspot.com/2010/01/sql-server-error-conversion-of-xml.html

    "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: Running Count

    mickyT (10/29/2013)


    And so far Dwains Tally solution looks like the winner based on the IO stats:-D

    As far as speed is concerned, mine is still in the top 5!

    "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: Slow Query

    First, is the application executing a stored procedure or an Ad Hoc SQL Query? If it's Ad Hoc SQL you will want to put the query into a stored procedure....

    "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: Running Count

    There should be a way to do this without these self-joins but I can't figure it out. That said, this will do the trick:

    WITH distinct_ids AS

    (

    select DISTINCT t1.id, MAX(t2.rnk)...

    "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: Issue ,Getting Only One Child Node by sp_xml_preparedocument.

    harsimranjeetsinghwasson (10/24/2013)


    Not Able to get Assistant days now by open xml

    DECLARE @Payrollhandle int

    DECLARE @Payrolldoc VARCHAR(MAX)=

    ('<Payroll StartDate="2013-10-30" EndDate="2013-10-31">

    <Doctor ID="74962">

    <WorkDays>

    <Office ID="60101" Days="23"/>

    <Office ID="60102" Days="23"/>

    </WorkDays>

    <AsstDays>

    <Office ID="60101" Days="23"/>

    <Office ID="60102" Days="23"/>

    </AsstDays>

    </Doctor>

    </Payroll>')

    EXEC SP_xml_preparedocument @Payrollhandle OUTPUT,@Payrolldoc

    SELECT

    *...

    "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: Not able to get multiple rows

    XML questions don't always get much love around here. Here's what you are looking for:

    EXEC SP_xml_preparedocument @Payrollhandle OUTPUT,@Payrolldoc;

    SELECT A.*, B.AsstDaysOfficeID

    FROM

    OPENXML(@Payrollhandle,'Payroll/Doctor/WorkDays/Office',8)

    WITH

    (DoctorID INT '../../@ID',

    WorkDaysOfficeID VARCHAR(10) './@ID') AS A

    OUTER APPLY

    OPENXML(@Payrollhandle,'Payroll/Doctor/AssDays/Office',8)

    WITH...

    "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: Sql Server data replication

    Is it possible to setup replication/Mirroring to a database server which is not in our windows domain?

    Yes but it will be more work to secure.

    We have a database of...

    "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 - 2,056 through 2,070 (of 2,462 total)