1

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
user1342164
  • 1,434
  • 13
  • 44
  • 83

2 Answers2

2

If it's another database in the same environment:

select * into ForMSDB..tbl_SecurityNamespace
from Tfs_configuration
Daniel Marcus
  • 2,686
  • 1
  • 7
  • 13
1

This should be as

select * into ForMSDB..tbl_SecurityNamespace
from Tfs_configuration; 
Yogesh Sharma
  • 49,870
  • 5
  • 26
  • 52
  • 1
    I'm doubting this since the user specified "another database"... and ForMSDB sounds an awful lot like the name of another database... – Jacob H May 02 '18 at 18:40
  • thank you now the error is Invalid object name 'Tfs_configuration'. – user1342164 May 02 '18 at 18:41
  • 1
    Then you are missing that table or you are not pulling from the correct db - or its in another schema that you need to specify – Daniel Marcus May 02 '18 at 18:42