• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to access hyphenated database in MSSQL

 
rb kl
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In MSSQL im not able to access the table from database which has the hyphenated name(example -database name is Temp-db).

& in MSSQL im not able to create the table with hyphenated name.


Thanks for your help in advance.

thanks,
rbkl
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hyphenated table names are possible in SQL Server, if a little ill-advised becuase they are awkward to work with. If you have created one you will need to use the [ ] escape characters to stop SQL Server interpreting the - as a minus symbol. e.g.:
 
rb kl
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.
Im able to create,insert,select the table by using your code.

But i already have the database name with hyphanated.i'm not able to access tables from that databse.


regards
rbkl
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic