how can i insert in udf

  • hbtkp (4/17/2012)


    ok. i already posted my formula for cumulative.

    Really? Would you please provide the link to the post with this formula? Unfortunately, I can't seem to find it any where. All I can find is your sample data.

    i hv another prov

    Really? For seem reason, I am not surprised. Too bad you keep refusing to provide us with any information that would even let use remotely help you. Again, I have to ask you I really do want an answer; Have you read the article we keep telling you to read or do you just enjoy ignoring our pleas for more information from you in our effort to really help you?

    i have delcare variable

    declare @abd datetime

    now i need to get 1 date from function

    like

    select @abd = fromdate from item2(@rdfd)

    fromdate hace same value in all filed

    so i just want 1 value

    can i use like this

    select @abd =distinct fromdate from item2(@rdfd)

    i cannot use where ,this is udf

    Really, you expect nonsense code to really work? I am assuming (however incorrectly) that item2 is a table valued function.

    select top 1 @abd = fromdate from dbo.item2(@rdfd);

    Hopefully the piece of code provided above will help you.

  • hbtkp (4/17/2012)


    ok. i already posted my formula for cumulative.

    i hv another prov

    i have delcare variable

    declare @abd datetime

    now i need to get 1 date from function

    like

    select @abd = fromdate from item2(@rdfd)

    fromdate hace same value in all filed

    so i just want 1 value

    can i use like this

    select @abd =distinct fromdate from item2(@rdfd)

    i cannot use where ,this is udf

    I would like to recommend the following book. Just click on the hyperlink.

  • Lynn Pettis (4/17/2012)


    hbtkp (4/17/2012)


    ok. i already posted my formula for cumulative.

    i hv another prov

    i have delcare variable

    declare @abd datetime

    now i need to get 1 date from function

    like

    select @abd = fromdate from item2(@rdfd)

    fromdate hace same value in all filed

    so i just want 1 value

    can i use like this

    select @abd =distinct fromdate from item2(@rdfd)

    i cannot use where ,this is udf

    I would like to recommend the following book. Just click on the hyperlink.

    i read that when i was just starting in SQL server and it helped me allot. decent intro and can point you in the right direction.


    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]

  • ok. i will go through book.

    right now i need 1 solution

    i have created 1 sp, and in that i am calling another sp.

    now

    this sp returns 1 float value

    that i need to combine with some formula.

    can i implement this logic in udf.can i call sp inside udf

  • hbtkp (4/17/2012)


    ok. i will go through book.

    right now i need 1 solution

    i have created 1 sp, and in that i am calling another sp.

    now

    this sp returns 1 float value

    that i need to combine with some formula.

    can i implement this logic in udf.can i call sp inside udf

    This is the thread of endless random questions. None of them ever get resolved and you come back with the next completely useless description of a problem. I know there is a language barrier but seriously???

    Have you ever heard of google? It is this new concept called a search engine. You really should try it sometime. It will return links to useful sites for people when they have questions. Here is one such example of a return. http://msdn.microsoft.com/en-us/library/ms186755.aspx

    If you want to know about the limitations of sql server functions, you can use that same google tool. Type in "sql server function limitations". The first link that pops up is: http://blog.sqlauthority.com/2007/05/29/sql-server-user-defined-functions-udf-limitations/[/url]

    _______________________________________________________________

    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/

  • hbtkp (4/17/2012)


    ok. i will go through book.

    right now i need 1 solution

    i have created 1 sp, and in that i am calling another sp.

    now

    this sp returns 1 float value

    that i need to combine with some formula.

    can i implement this logic in udf.can i call sp inside udf

    You still haven't even answered my question, have you read the article you have been told over a million times to read?

    We can't give you ANY answers if you continue to REFUSE to provide us with the information we need to truely help you.

    HELP US HELP YOU, read the article Forum Etiquette: How to post data/code on a forum to get the best help[/url]. Follow the instructions provided in that article and give us the DDL for your table(s), sample data for the tables, expected results, and the code you are having problems with.

    As it goes right now, you aren't going to get any answers that will actually HELP YOU until you start helping us to do so.

    Do you have any problems understanding anything that I have just said?

  • hbtkp (4/17/2012)


    ok. i will go through book.

    right now i need 1 solution

    i have created 1 sp, and in that i am calling another sp.

    now

    this sp returns 1 float value

    that i need to combine with some formula.

    can i implement this logic in udf.can i call sp inside udf

    Wait, I can answer one question from above. No, you can't call a stored procedure inside of a user-defined function.

  • Lynn Pettis (4/17/2012)


    hbtkp (4/17/2012)


    ok. i will go through book.

    right now i need 1 solution

    i have created 1 sp, and in that i am calling another sp.

    now

    this sp returns 1 float value

    that i need to combine with some formula.

    can i implement this logic in udf.can i call sp inside udf

    Wait, I can answer one question from above. No, you can't call a stored procedure inside of a user-defined function.

    Of course, if you knew how to use Books Online, you could have answered that question yourself.

  • OK ,IF I CANNOT HEN how can i store my logic which include execute sp and returns 1 value

    i need to call this value in case statement

  • hbtkp (4/17/2012)


    OK ,IF I CANNOT HEN how can i store my logic which include execute sp and returns 1 value

    i need to call this value in case statement

    Hi and welcome to my global "Plonk list". Glad you have enjoyed wasting other people's valuable time. I hope your ability to communicate with people in person is better than your online skills or you are going to have a REALLY short career.

    _______________________________________________________________

    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/

  • hbtkp (4/17/2012)


    OK ,IF I CANNOT HEN how can i store my logic which include execute sp and returns 1 value

    i need to call this value in case statement

    Once more with feeling! If you can't do the following we are done! We can't help you if you can't help yourself. Bottom line, you decide if really want any help or would rather suffer through having to tell your boss you are totally incapable of meeting your job requirements. We would be more than willing to help you learn, but you have continued to show you really have no desire to do so, but would rather we some how pull miracles out of our ******* and solve your problems for you with absolutely no effort on your part.

    HELP US HELP YOU, read the article Forum Etiquette: How to post data/code on a forum to get the best help[/url]. Follow the instructions provided in that article and give us the DDL for your table(s), sample data for the tables, expected results, and the code you are having problems with.

  • Sean Lange (4/17/2012)


    hbtkp (4/17/2012)


    OK ,IF I CANNOT HEN how can i store my logic which include execute sp and returns 1 value

    i need to call this value in case statement

    Hi and welcome to my global "Plonk list". Glad you have enjoyed wasting other people's valuable time. I hope your ability to communicate with people in person is better than your online skills or you are going to have a REALLY short career.

    what is your plonk list and how can i avoid getting on it??


    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]

  • capn.hector (4/17/2012)


    Sean Lange (4/17/2012)


    hbtkp (4/17/2012)


    OK ,IF I CANNOT HEN how can i store my logic which include execute sp and returns 1 value

    i need to call this value in case statement

    Hi and welcome to my global "Plonk list". Glad you have enjoyed wasting other people's valuable time. I hope your ability to communicate with people in person is better than your online skills or you are going to have a REALLY short career.

    what is your plonk list and how can i avoid getting on it??

    Well I just started it, there is as of now 1 member. I will refer to that list before attempting to volunteer my time to help someone. If there name is on the list, no help from me. I have wasted enough time on this.

    How do you avoid it? I don't think you have anything to worry about cap'n. Just don't post questions like the ones posted here.

    _______________________________________________________________

    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/

  • Sean Lange (4/17/2012)


    capn.hector (4/17/2012)


    Sean Lange (4/17/2012)


    hbtkp (4/17/2012)


    OK ,IF I CANNOT HEN how can i store my logic which include execute sp and returns 1 value

    i need to call this value in case statement

    Hi and welcome to my global "Plonk list". Glad you have enjoyed wasting other people's valuable time. I hope your ability to communicate with people in person is better than your online skills or you are going to have a REALLY short career.

    what is your plonk list and how can i avoid getting on it??

    Well I just started it, there is as of now 1 member. I will refer to that list before attempting to volunteer my time to help someone. If there name is on the list, no help from me. I have wasted enough time on this.

    How do you avoid it? I don't think you have anything to worry about cap'n. Just don't post questions like the ones posted here.

    I don't think I could post questions like this if I tried. I think I'd give myself a brain hemorrhage.

  • ok ,i m giving sample date this time

    this TIME I AM GIVIng SAMPLE DATA plz help

    MemberID index

    -9 0

    NULL null

    -9 0

    NULL null

    NULL nul

    i need to go each of the value who has -9 and 0 ,using loop

Viewing 15 posts - 61 through 75 (of 85 total)

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