NealWalters
NealWalters

Reputation: 18167

Can BizTalk WCF-SQL Insert support "NEXT VALUE FOR" (Sequence)

I'm working for a client that is using a sequence in MS-SQL instead of an identity field.

I have to insert a row into a table, and the client's BizTalk in general prefers to do native commands (just an Insert for example), instead of calling a stored procedure. Further, the BizTalk developers (such as me) cannot write the stored procedure, some other teams has to do it.

I used "add generated items", and generated an insert schema for this table. I will be using a map to populate the value of all the fields, but it doesn't seem like I could pass a string like "NEXT VALUE FOR DB1.TED_SEQNUM_ODA" for the value of this column.

And actually same question for functions. Can I pass getDate(), in case that is not the default value for a date/time?

So for example, my insert in SQL is like this:

INSERT INTO DB1.Table1 
    (
    TED_ID,
    TED_FIRST_NAME,
    TED_LAST_NAME,
    TED_INSERT_DATETIME
    )
VALUES
    ( 
      NEXT VALUE FOR DB1.TED_SEQNUM_ODA
    , 'John'    
    , 'Doe'
    , getDate()
    )

Upvotes: 0

Views: 51

Answers (0)

Related Questions