Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)

  • RE: foreach loop in sql

    Thanks I will read this article and change the function that I am using.

  • RE: foreach loop in sql

    Jeff Moden (2/11/2015)


    nwtsqlserv (2/11/2015)


    I already have a spitter function mate...please have a read through my question again...thanks.

    Could you post the code for your splitter, please?

    CREATE FUNCTION [dbo].[StringSplitter]

    (

    @String varchar(5000),

    @Delimiter char(1)

    )

    RETURNS @RESULTS...

  • RE: foreach loop in sql

    I just wrote a new stored proc. The old stored proc had a LookUpId table to increment Id ..so it was updating the id by one and fetching that id...

  • RE: foreach loop in sql

    Hi I have one more question. I am using table valued parameter to pass the whole list to the stored proc. But now I want to insert this table valued...

  • RE: foreach loop in sql

    thanks

  • RE: foreach loop in sql

    yeah thats sound good. I will use table valued parameter.

    using cursor is it an old approach??

    something like this

    CREATE TABLE #result

    (

    Subject varchar(100)

    )

    Create Table #result2

    (

    Subject varchar(100)

    )

    insert...

  • RE: foreach loop in sql

    That is what my function does ..insert the comma separated string into a table ...for eg in ur case its MyTable..

    Now I want to insert each row of this Mytable...

  • RE: foreach loop in sql

    Why is it wrong can you explain?

    I think there is nothing wrong in sending a comma seperated list.

    My question is to insert each row of the table into another table....

  • RE: foreach loop in sql

    I already have a spitter function mate...please have a read through my question again...thanks.

  • RE: SQL script GROUPING

    thanks..

    is there a better way of doing it ..instead of using a subquery???

  • RE: group by query

    nice! looks neat

    Yeah you are this right I have to put this in production where there are more than 50 rows. Would it be nice to have a temp table...

  • RE: group by query

    Thanks for the reply...it work and I understand it..

    You say there can be other ways..can u hint like what ways?

  • RE: date

    resloved

Viewing 13 posts - 1 through 13 (of 13 total)