You store your business information in several SQL Server databases. To assist employees in creating ad hoc queries in Query Editor, you create the following procedure:

You store your business information in several SQL Server databases. To assist employees in creating ad hoc queries in Query Editor, you create the following procedure:

USE Sales
GO
CREATE PROC Assist
@column nvchar(1000),
@table nvchar(1000),
@search1 nvchar(1000) = “,
@group nvchar(1000) = “,
@search2 nvchar(1000) = “,
@order nvchar(1000) = “ AS
IF @search1 <> “ SET @search1 =’WHERE’ + @search1
IF @group <> “ SET @group = ‘GROUP BY’ + @group
IF @search2 <> “SET @search2 = ‘HAVING’ + @search2
IF @order <> “SET @order = ‘ORDER BY’ + @order
EXEC (‘SELECT’ + @column + ‘FROM’ + @table + @search1 + @group + @search2 + @order)

Which of the following actions can be performed by using the Assist procedure?



B – Any database on the local SQL Server can be queried.
C – Multiple columns can be returned in the result set.
E – The result set can be ordered in either ascending or descending order.
F – Aggregate functions can be used in the select list.
I – Tables can be joined.
J- Invalid queries can be created

(This procedure, Assist, lets users pass parameters to create their own custom queries. Nothing prevents them from passing bad values.)