how can i insert in udf

  • i have 1 udf which returns RETURNS TABLE

    how can i add into it

  • Are you asking how you add more columns to the resultset table of the function or are you asking how you get the resultset to include more rows or some other interpretation?

  • ALTER FUNCTION udf... ??

    can you post your UDF code and DDL (Create table scripts) and sample data (INSERT Statements) so we can see what gets passed to the udf what comes out currently and what you want to change?

    right now we have a generic question and my MindReadAPI is still vapor ware.


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • function is already created, i need to add more rows ,if i do insert into ,it wont get insert.

    do i need to have update ,if so how can i update udf

  • a udf is a user defined function. by deffinition to change or update a FUNCTION you have to update or change the code for the function. im starting to wonder why i keep responding.


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • i dont need to change field, i have filed

    CREATE FUNCTION item1(@Data [varbinary](max))

    RETURNS TABLE (

    item2 varchar,

    item3 int)

    now i need to add more rows in item3, and i need to implement in another sp.

  • hbtkp (4/13/2012)


    i dont need to change field, i have filed

    CREATE FUNCTION item1(@Data [varbinary](max))

    RETURNS TABLE (

    item2 varchar,

    item3 int)

    now i need to add more rows in item3, and i need to implement in another sp.

    Duplicate post all replies here http://www.sqlservercentral.com/Forums/Topic1282601-392-1.aspx


    For faster help in answering any problems Please read How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.

    For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]

    Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
    Jeff Moden's Cross tab and Pivots Part 1[/url]
    Jeff Moden's Cross tab and Pivots Part 2[/url]

  • Here is how all of the threads that you have started sound.

    There were two crocodiles flying. One to the south but another one was blue.

    Question: How many seats in our local theater?

    The Right Answer: I don't need a fridge as I do not smoke.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Rows are inserted into a table.

    If I substitute the word TABLE for the word FUNCTION, your questions begin to make some (not completely) sense.

    Converting oxygen into carbon dioxide, since 1955.
  • hbtkp (4/13/2012)


    i dont need to change field, i have filed

    CREATE FUNCTION item1(@Data [varbinary](max))

    RETURNS TABLE (

    item2 varchar,

    item3 int)

    now i need to add more rows in item3, and i need to implement in another sp.

    You can't add more rows into your function.

    After your Returns table statement, you should have more code designating what is actually getting returned into that "inline" table.

    read up on this

    http://msdn.microsoft.com/en-us/library/ms191165.aspx

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • thanks.

    i will give you feedback when i will get back to this position

  • Okay, i'll bite. Please post the code for your function.

  • Lynn Pettis (4/13/2012)


    Okay, i'll bite. Please post the code for your function.

    All of the code plz:-D

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • i havent reach this point,untill i get how to see what dates r missing

  • capn.hector (4/13/2012)


    Duplicate post all replies here http://www.sqlservercentral.com/Forums/Topic1282601-392-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 1 through 15 (of 85 total)

You must be logged in to reply to this topic. Login to reply