Query related to length in CAST and Output clause

Salil Singh 60 Reputation points
2025-04-22T18:21:46.98+00:00

Hi Team,

Could you please reply to below queries -

  1. Using CAST, I need to convert BigInt and Datetime2 values to Varchar. How could I be sure on the length that I need to use (in CAST) to convert these values to Varchar.
  2. I am using Update statement with Output clause, in Output clause values, I am unable to use a user defined function as it is erroring out, could you let me know how to use a user defined function in Output clause (with Update).

Please let me know if more clarification is needed in any of above points.

Thanks,

Salil

SQL Server Transact-SQL
SQL Server Transact-SQL
SQL Server: A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.Transact-SQL: A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
181 questions
{count} votes

0 additional answers

Sort by: Most helpful

Your answer