Showing posts with label hyphen. Show all posts
Showing posts with label hyphen. Show all posts

Wednesday, March 21, 2012

Problem with Hyphen in server name?

Hi all, My sql server has a hyphen in its name, and I've noticed I can't use a fully qualified reference, server.database.owner.table. Is this a known bug?, what's the fix apart from renaming?

This is standard version, not a beta.

Hi Meltdown,

this is anugly things having a hyphen,or any other character in the server name, but putting brackets around that should solve the problem.

[server].database.owner.table

HTH, Jens Suessmeyer.

|||

Thanks for the reply Jens, unfortunately the brackets don't seem to solve it, I now get the following error when I run my code

Select [DYFLIN-SQL].DyflinSQLDB.dbo.tblGroups.GroupName From tblGroups;

Msg 4104, Level 16, State 1, Line 6

The multi-part identifier "DYFLIN-SQL.DyflinSQLDB.dbo.tblGroups.GroupName" could not be bound.

|||

Try with

set quoted_identifier off

Select "DYFLIN-SQL".DyflinSQLDB.dbo.tblGroups.GroupName From tblGroups;

GO

Cheers,

Sunny

|||Thanks for trying Sunny, that doesn't work, it returns the following error:

Msg 258, Level 15, State 1, Line 5

Cannot call methods on varchar

...although GroupName is of datatype nvarchar

|||

Could it be something like :

Select a.groupName from [DYFLIN-SQL].DyflinSqlDB.dbo.tblGroups as a ?

|||Thanks a lot Jp, you've cracked it, that works perfectly, much appreciated.|||You're welcome! ;)

Problem with Hyphen in Full Text Catalog Search

Hi All,

we have a problem with the Full Text Catalog Search.
We use the following SQL Statement for matching companies from a table:

select company, lastname, firstname, pkcustomers, fkcustomers,
location, title, fkFunktionen, TypeOfPosition
from customers
where (fkcustomers = 0 or fkcustomers is null)
and active = 1
and pkCustomers in (select [KEY] from CONTAINSTABLE(Customers, Company,
'"*SEARCHTERMS*"'))
order by company asc

The search so far is working perfect.
Now the problem: There are two companies in the table called "i-fabrik"
and "b-wise". Theres no way to find these two companies. I find out
that the search is successful if there are more than three letters in
front of the hyphen (for exampe iii-fabrik or bbb-wise). How can that
be? Why exactly 3 letters?

I hope somebody can help me.

Best regards
Markus Weberhttp://support.microsoft.com/defaul...b;en-us;Q200043

Simon