Forum Replies Created

Viewing 15 posts - 736 through 750 (of 2,462 total)

  • RE: how to count number of student

    For this you would use GROUP BY.

    "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: Merge Replication

    I can't see why 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: single xml to multiple rows

    squvi.87 (5/9/2016)


    Hi There,

    I require to convert single xml into multiple rows, as explained below

    Thanks in advance

    In the future try to include the actual XML (or table data) instead of 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: Talking baseball

    calvo (5/9/2016)


    Alan.B (5/5/2016)


    And 2003 with the infamous "Bartman ball". Being a Cubs fan is as painful as it gets but it will be worth it if they even get 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: Error converting data type nvarchar to numeric.

    The way I troubleshoot this kind of thing is to run each section of the query individually until I get the error that is being returned when I run 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 Data

    drew.allen (5/9/2016)


    This is not valid xml, because there is no single root element. In fact, you have text that is not contained in an element at all.

    Drew

    It's not 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 Data

    This should do the trick. This solution uses delimitedsplit8K which is referenced in my signature. Note my comments.

    USE tempdb

    GO

    -- ingest the text as varchar(8000) or varchar(max) is you might receive...

    "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: Database source control tool recommendation

    TFS perhaps.

    "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: Service not starting on a desktop instance

    Try resetting the password and try again or check the username spelling.A bad username or password or the only reasons Ice ever seen that error. You could also try 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: Substring for column

    jollyegeorge (5/6/2016)


    I get error for 'Invalid object name 'dbo.DelimitedSplit8K'

    Yes it does, all the summary line has these bold values.

    DelimitedSplit8K is not built in, you need to create it. For...

    "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: Report Runs in Studio but not on SSRS

    SilverBack (4/22/2016)


    I can get my code to return results like I want in SQL Studio however in SSRS

    I can not get results they just come back blank. Any ideas by...

    "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: SSIS package failure

    ffarouqi (5/5/2016)


    Alan.B (5/4/2016)


    A couple things here.

    First, the message is pretty clear. The SSIS package is failing because the login for SA, inside at least one of your SSIS connection...

    "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: Full Text Search

    There's the old joke, "guy goes to the doctor and says, 'Doc, it hurts when I do this...' so the doctor says, 'don't do that'."

    I digress, can you post 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: SQL stmt

    Here's a fun solution that uses all three T-SQL set operators.

    DECLARE @table1 TABLE (col1 char(3) unique);

    DECLARE @table2 TABLE (col1 char(3) unique);

    INSERT @table1 VALUES ('a 1'), ('b 2'), ('c 4');

    INSERT @table2...

    "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: Identify matching numbers pairs and sequence in a values and give them a name

    This solution assumes that your sequences are always going to be 6 characters long...

    Taking Luis' brilliant solution and turning it into a scalar UDF like this:

    CREATE FUNCTION dbo.SeqRank (@number CHAR(6))

    RETURNS...

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