Update/Insert into SQL
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > Update/Insert into SQL




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Update/Insert into SQL  
Ronnie Swafford


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-26-05 10:54 PM

I know that the SQL adapter doesn't support both update and insert at the
same time.  Could someone direct me to an example that would overcome this
problem?  I have a very complex flat file which I convert and depending on
whether it is a PO or an Item, I put the data into one of two tables.  All
works perfectly, but to use this in the real world I need to either update o
r
insert in both tables so the data isnt repeated as a new record everytime
someone updates a PO.  I have a status field marked with N for New, U for
update or D for delete.  I'm assuming that I can call a stored procedure to
do this, but I'm not clear on how to write the SP to use the XML data from
Biztalk as the new data.  Any help would be appreciated!
--
Senior Developer
Furniture Brands Import Services





[ Post a follow-up to this message ]



    RE: Update/Insert into SQL  
Neal Walters


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-26-05 10:54 PM

Just write an SQL Stored Procedure to handle the problem.  It could check to
see if row exists, update if it exists, or add it if it doesn't exist.

When you run the SQL adapter from Visual Studio, it will build a schema
called something like SqlService.xsd.  You can rename it to something more
meaningful.  You can then map your data to this schema.  The SqlAdapter also
build a "dummy" orchestration which you can delete.

All the parms of the stored procedure will be exposed as attributes in the
schema.  If the stored procedure returns a table, the table and elements wil
l
also be in the schema.  The SQL adapter will ask for a Request and Response
root element name.  The Request root element name will wrap the stored
procedure parms, and the Response root element name will wrap any returned
data.

I don't know if you are using orchestration or not, but you would create a
Request/Response port (not sure if a Send-Only port would work).   I still
haven't figured out how to get the return-code from a Stored Proc back into
Biztalk.

Neal Walters
http://Biztalk-Training.com






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:32 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register