Share via

Does SQL server CDC (Change Data Capture) have some limitation with UDDT or Table-valued parameters

Banti Gurbani 25 Reputation points
2023-06-17T04:51:31.5366667+00:00

I have configured CDC on my SQL server DB and after enabling it, my application code started breaking in some scenarios. After troubleshooting, it is found that existing stored procedure with Table-Valued parameter is failing. I want to know

  1. if there is anything is any limitation with Table-valued parameter or UDDT
  2. Anything to be considered/handled seperately in the code/stored procedure to fix this issue
SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


1 answer

Sort by: Most helpful
  1. Erland Sommarskog 134.7K Reputation points MVP Volunteer Moderator
    2023-06-19T21:02:20.99+00:00

    Thanks for the information. I don't have a solution right now, but I have some ideas for troubleshooting.

    If you are on SQL 2016 or SQL 2017, make sure that you have the more recent Service and Cumulative Update (please share the output of SELECT @@version) and then run

    DBCC TRACEON(460, -1)
    

    This will change the error message String or binary would be truncated so that is relates which table and column the error relates to, and you also see the truncated part of the data.

    The other recommendation is that you set up a extended-event session which captures the event error_reported. Then you create a view over this event session that gives you information on where the error occurred. You can also run a stored procedure that gives you the full call stack. You find everything you need to know about this in this article on my web site: https://www.sommarskog.se/Short%20Stories/trace-exceptions.html

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.