Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345364

Summary: Cannot show table in MS-SQL if database has dash in name
Product: [Tools] Data Tools Reporter: Ren Junyan <Jun-Yan.Ren>
Component: EnablementAssignee: Project Inbox <dtp.enablement-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: future   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch for this bug none

Description Ren Junyan CLA 2011-05-11 01:41:45 EDT
Build Identifier: I20090611-1540

Create database inside MS-SQL server called "dash-test", create table under database. Connect to MS-SQL with sqlserver enablement. When selecting 'schemas', it shows error as below.
"Incorrect syntax near '-'."

Reproducible: Always
Comment 1 Brian Fitzpatrick CLA 2011-05-11 13:51:03 EDT
Ren, feel free to look at the MSSQL enablement code to see if you can find a way around this. I suspect that it's in the catalog loader that's grabbing tables with a custom SQL script. If you create a patch and verify that it works on your end we'll see if we can get it applied.
Comment 2 Ren Junyan CLA 2011-05-17 03:20:14 EDT
Created attachment 195813 [details]
patch for this bug

A database name with dash character cannot be used in query directly in MS-SQL. There some sqls contain catalog name in enablement, which has risk when the name has dash. Now we quotes the catalog name by '[]', so that the query could be executed well.