You use Microsoft SQL Server 2012 to develop a database application.
Your application sends data to an NVARCHAR(MAX) variable named @var.
You need to write a Transact-SQL statement that will find out the success of a cast to a decimal (36,9).
Which code segment should you use?
You are a database developer at an independent software vendor. You create stored procedures that contain proprietary code.
You need to protect the code from being viewed by your customers.
Which stored procedure option should you use?
You develop a Microsoft SQL Server 2012 database.
You need to create and call a stored procedure that meets the following requirements:
* Accepts a single input parameter for CustomerID.
* Returns a single integer to the calling application.
Which Transact-SQL statement or statements should you use? (Each correct answer presents part of the solution. Choose all that apply.)
Answer : A, E
You have a database named SALES that stored the sales data and the salespeople for your company.
You need to create a function that is passed a ProductID and then returns a list of SalesOrderID values for orders that must be associated to a salesperson in the future. The function must be able to return multiple SalesOrderID values.
Part of the correct Transact-SQL has been provided in the answer area below. Enter the code in the answer area that resolves the problem and meets the stated goals or requirements. You can add code within the code that has been provided as well as below it.
Use the Check Syntax button to verify your work. Any syntax or spelling errors will be reported by line and character position.
Answer : A
References:https://msdn.microsoft.com/en-us/library/ms188795.aspx
You administer a Microsoft SQL Server database that includes a table named Products. The Products table has columns named ProductId, ProductName, and CreatedDateTime.
The table contains a unique constraint on the combination of ProductName and CreatedDateTime.
You need to modify the Products table to meet the following requirements:
* Remove all duplicates of the Products table based on the ProductName column.
* Retain only the oldest Products row.
Which Transact-SQL query should you run?
You administer a Microsoft Azure SQL Database instance.
You are writing a new stored procedure that uses explicit transactions.
You need to ensure that no other process can affect the objects being used by the stored procedure while it is running.
Which Transact-SQL statement should you run?
Answer : A
SERIALIZABLE specifies the following:
Statements cannot read data that has been modified but not yet committed by other transactions.
No other transactions can modify data that has been read by the current transaction until the current transaction completes.
Other transactions cannot insert new rows with key values that would fall in the range of keys read by any statements in the current transaction until the current transaction completes.
References:
https://docs.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql
Your application contains a stored procedure for each country. Each stored procedure accepts an employee identification number through the @EmpID parameter.
You plan to build a single process for each employee that will execute the stored procedure based on the country of residence.
Which approach should you use?
Answer : D