user1342164
user1342164

Reputation: 1454

SQL Select INTO Query

I am trying to running the following command to copy a table to another database and it is saying incorrect syntax near "tbl_SecurityNamespace". Any ideas? TIA

select * into ForMSDB  tbl_SecurityNamespace
from Tfs_configuration  
go

Upvotes: 1

Views: 48

Answers (2)

Yogesh Sharma
Yogesh Sharma

Reputation: 50163

This should be as

select * into ForMSDB..tbl_SecurityNamespace
from Tfs_configuration; 

Upvotes: 1

Daniel Marcus
Daniel Marcus

Reputation: 2686

If it's another database in the same environment:

select * into ForMSDB..tbl_SecurityNamespace
from Tfs_configuration

Upvotes: 2

Related Questions