Move the Employees table from the dbo schema to the HumanRwsources schema.

Mike Eghtebas
Mike Eghtebas used Ask the Experts™
on
Task: Move the Employees table from the dbo schema to the HumanRwsources schema.
Solution I have: ALTER TABLE dbo.Employees ALTER SCHEMA HumanResources

The following 2 options are not correct:
1:
ALTER TABLE dbo.Employees TRANSFER HumanResources
Explanation why this option is not correct: " should not use ALTER TABLE. It only allows the structure of the table not the schema that contains the table."
Question A: Why we cannot use ALTER TABLE here but it is okay to use it in the first answer (correct on above)?

2:
ALTER SCHEMA HumanResources TRANSFER dbo.Employees
Question B: Why this answer is not correct? What the following code does anyway?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
SQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015
Commented:
2 is correct, or at least the same syntax as successful object schema transfers I've done in the past.

Still studying for the SQL 08 Development exam?

>Question B: Why the answer below is not correct?
Just for kicks and giggles, why don't you post the error message returned when you execute this and it throws the error.  The only answer off the top of my head is that the logged in user does not have privs to alter objects in both schemas.
Mike EghtebasDatabase and Application Developer

Author

Commented:
No. it is for 2012. I think 2008 is no longer offered.

On the error message, I am not actually running the code. This is a sample exam question I am investigating.
Jim HornSQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015

Commented:
Kinda hard to verify that an answer is correct if you're not coding it, and I highly recommend practicing these in SSMS instead of just trying to memorize answers, so I'll stick to my guns and say 2 is correct.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Mike EghtebasDatabase and Application Developer

Author

Commented:
With SQL Servers prior to 2012, I guess we had separate certifications for developers and db administrators. But now, with SQL Server 2012 there is just MCSA (db administrators). MCSA for 2012 includes three certifications listed below:

70-461: Querying Microsoft SQL Server 2012
70-462: Administering Microsoft SQL Server 2012 Databases
70-463: Implementing a Data Warehouse with Microsoft SQL Server 2012

I am studying for 70-461 now. And, this question is sore of out of place I thing and it belongs to 70-462.  So, when I study later 70-462, I will focus on these type of questions.

BTW, how do you rate these 3 sections in scale of 1-10 as far as difficulty is concerned for a starter?

Thanks,

Mike
Jim HornSQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015

Commented:
70-461 was pretty easy for me, as I've been doing T-SQL for sevenish years now, and the 2012 exam was the first one I've taken that wasn't heavily weighted towards what was new in that version.

70-462 I haven't looked at yet.

70-463 I studied a little and took a practice exam.  The SSIS and data warehousing parts were fine except when they asked about seldom-used components and script source/destination.  The MDM and DQS I bombed as I didn't have previous experience in them.
Jim HornSQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015

Commented:
Thanks for the grade.  Good luck with your project.  -Jim

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial