Insert A List OF Data To sql

  • I write bellow query For Insert Data but I want my Store Procedure take A List OF Data and insert it.how can i change That?

    create procedure AtashSooziFloorInsert

    @AtashSooziID int,@FloorID int

    as

    begin

    insert AtashSooziFloor (AtashSooziID,FloorID)

    values(@AtashSooziID,@FloorID)

    end

  • To assist those who desire to assist you, could you supply a short sample of the "list of data" that you need to insert.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • SELECT 'EXECUTE AtashSooziFloorInsert ' + CAST(AtashSoozId as varchar(100))+ '

    CASTFloorID as varchar(100)) FROM ImportedTable

    then you can execute this list of sql

    or you write a cursor and then execute all sql

  • Sounds like a table valued parameter is your friend here.



    Clear Sky SQL
    My Blog[/url]

  • tnx Dave Ballantyne

Viewing 5 posts - 1 through 4 (of 4 total)

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