insert into table

  • Hi,

    is it possible to write insert into table statment in the body of a function?

    How to insert values into a table?

    Thanks, Jelena

  • It's not possible to insert into a table in the body of a function unless it's a table variable local to the function. You would need to use a stored procedure to do that.

    Cheers,

    mia

    Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.


    Cheers,
    mia

    Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.

  • I tried that but I can't execute stored procedure inside a function?

    How to solve that?

    THanks, Jelena

  • What are you trying to do?

    Frank

    http://www.insidesql.de

    http://www.familienzirkus.de

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Can't you replace the function entirely with a stored procedure? What is it that you are trying to do?

    Cheers,

    mia

    Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.


    Cheers,
    mia

    Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.

  • It's not problem to write stored procedure but later I need rto select some values from....(function)

  • ???

    Frank

    http://www.insidesql.de

    http://www.familienzirkus.de

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Not sure what you mean. What's the purpose of the stored procedure? To insert values or retrieve them?? Can you post some code to demonstrate more clearly what you're trying to do?

    Cheers,

    mia

    Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.


    Cheers,
    mia

    Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.

Viewing 8 posts - 1 through 7 (of 7 total)

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