sql - Copy a table to another database -


first of, i'm beginner in t-sql question might silly. sorry that.

i trying copy table database this

use datatable go      select *         datatable.humanresources.employee         adventureworks2012.humanresources.employee         1=0 

and error :

"msg 2760, level 16, state 1, line 2 specified schema name "humanresources" either not exist or  not have permission use it."  

do have permissions or can't reuse adventureworks schema or alter privileges somehow? help.

does datatable.humanresources.employeealready exist in new database same columns , types already?

it's worth checking user connecting sql has appropriate permissions on both databases, getting permission error.

your where 1=0 (which believe got here) create blank table columns other table.

the correct query need be

use adventureworks2012 go  select * humanresources.employee in datatable humanresources.employee 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -