Which Transact-SQL statement should you run?

Posted by: Pdfprep Category: 70-461 Tags: , ,

You use Microsoft SQL Server to develop a database application. Your application sends data to a VARCHAR (50) variable named @var. You need to write a Transact-SQL statement that will return information on a successful or

unsuccessful cast to an integer in a table.

Which Transact-SQL statement should you run?

A . Option A
B . Option B
C . Option C
D . Option D

Answer: B

Explanation:

TRY_PARSE returns the result of an expression, translated to the requested data type, or null if the cast fails in SQL Server. Use TRY_PARSE only for converting from string to date/time and number types.

References: https://docs.microsoft.com/en-us/sql/t-sql/functions/try-parse-transact-sql?view=sql­server-2017

Leave a Reply

Your email address will not be published.