web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Salesforce to SQL Serv...
Power Automate
Unanswered

Salesforce to SQL Server 2005 Datetime Error

(0) ShareShare
ReportReport
Posted on by 2

I am trying to updte a SQL Server table when a new record is inserted into Salesforce.  The flow works perfectly but the datetime values in Salesforce create a "Type datetime2 is not a defined system type" error.  I undersand this is because SQL Server 2005 does not support the datetime2 datatype.  To get around this I tried passing the datetime as a text field then using an After Insert trigger to update the datetime fields in the record from the text field.  However now I get a "the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause" error.

 

Two questions:

1) Anyone know how to get around the datetime2 issue in SQL Server 2005?

2) Is there a way to use the flow to update records in a table with a trigger enabled?

 

Grateful for any ideas.

 

Barry

Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    on at

    Hi BarryHicks,

     

    Please take a try to format the data time value with the formatDateTime function:

    "@formatDateTime(Datavalue,'yyyy-MM-dd hh:mm:ss')"

    Function reference:

    WorkFlow Definition Language

    Please post back if there are any syntax errors, with a screenshot, I will then take a further testing based on that.

    For the trigger errors, no, currnetly there is no workaround to deal with that part.

    Regards

     

  • BarryHicks Profile Picture
    2 on at

     Thanks for the quick response.  I added the formula @formatDateTime('2016-12-15','yyyy-MM-dd hh:mm:ss') to my SQL Server Insert Row date field and I get an error "We cannot convert the value \" @formatDateTime('201...\" to type DateTime."

     

    I can't figure out how to upload a screenshot. Do I need permission to upload images?

     

    Thanks again.

  • v-micsh-msft Profile Picture
    on at

    Hi @BarryHicks,

    Please see the following image:

    61.PNG

    Click the Photos, then it would allow you to select image to upload. From the error message, it seems the data didn't convert to the right format.

    Try to change the formula with the following:

    "@{formatDateTime('2016-12-15','yyyy-MM-dd hh:mm:ss')}"

    If this still not working, take use of the compose action, then in the inputs, type the formula below:

    "@formatDateTime('2016-12-15','yyyy-MM-dd hh:mm:ss')"

    After that, use the output from the compose to insert the corresponding rows in SQL server.

    Regards

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard