-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Reserved SQL Server keywords and table names (worked in 7.0)
PostPosted: Wed Jun 08, 2005 6:33 pm 
Hi All,

In 7.0 mappings, I had table names marked as such : [Table_Name], this allowed me to use reserved keywords as table names, eg. [User] (which I dont think is uncommon).

With 8.4 I have had to remove the square brakets and am getting the expected SqlException: Incorrect syntax near the keyword 'User'.

Is there anything else I can use in 8.4 (apart from []) to mark a literal as a table name.

Thanks


Top
  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 6:41 pm 
My Error, 7.0 Allowed the use of [] on both table names and column names.

8.4 still allows it on table names. But not on column names. Luckily I dont have any conflicting column names.

Thanks

Guido


Top
  
 
 Post subject:
PostPosted: Wed Jun 08, 2005 9:15 pm 
Regular
Regular

Joined: Mon May 16, 2005 1:35 am
Posts: 67
Use back-ticks for your table and column names that are protected SQL keywords. So, table="`User`" or column="`From`".


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 28, 2005 6:05 pm 
I ran into this problem today, I have a table called "Group".

Using table="[Group]" in the mapping file seems to work.


Top
  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 10:20 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
As baggins said, you should use back-ticks as they are "localized" depending on the database you use ([] aren't).

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.