IT452 Unit 7 Programmable Objects
1. Create a variable for the region column, birthdate column and empid column.
2. Create and use a variable to pull the category name for categoryID 8. Write a separate query to return the output.
3. Write an IF ELSE element that checks for the current month and prints ‘This Month is November’ if it is November or prints ‘This Month is not November’ if the month is not November.
Prints This Month is November if you enter 11
4. Write a WHILE Loop that returns ProductName, CategoryID and UnitPrice and compares the CategoryID to 4. As long as it is less than 4 it should print the product name, categoryid and unitprice.
12 rows for Category 1
12 rows for Category 2
13 rows for Category 3
5. Write a script that performs the following tasks:
a. Define a variable to hold the maximum database ID value.
b. Set that variable equal to the maximum database ID value. To determine the maximum database ID value, use the database_id column of the sys.databases table in the master database.
c. Use PRINT to print the value of the variable. Result: [Note: PRINT writes to the Messages tab of the query window.]
[Note: Your result may vary.]
6. Create a cursor that updates only to and from the ProductName column of the Production.Products table and print that column out. Returns all of the productnames upon successful execution
7. Create a table variable called work table with the following structure. Insert the row of data listed and execute the batch.
Worktable
PK int Primary Key
Col1 int Not Null
Insert 1 row with the following data:
1, 101
Execute the batch
Returns 1 row
8. Create a global temporary table called GlobalTempWork with the following structure
GlobalTempWork
Test nvarchar primary key,
Col1 int
Insert 1 row with the following data
10
Execute the batch to return the 1 row
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more