I am allowing users to assign values in a table to field names in a table
for
EAV table transpostion
Does anyone know where I can find a list of ascii valeus or characters that sql server does not like in fieldnames.
IE (ticks, #, :, -,)
I need to allow the user to define fieldnames for values which then I will alter existing tables with that FieldName that they assign.
I know this is a nightmare but it is the contraint I am working under.Not sure... but I recently learnt that .NET doesn't like column names starting with a numeric character so worth bearing in mind if that is your FE.|||I am not sure such a list exists, as technically SQL Server will accept anything between brackets, so long as the name is unique within the table.
create table test1
([(ticks, #, :, -,)] int, -- Given example
[~`!@.#$%^&*()_+] int) -- Top row of the keyboard.
select *
from test1|||I would be tempted to accept alpha numerics only myself just to be sure (but I am a bit of pessimist with these sorts of things). There is also the "reserved words" issue.
Actually - I imagine square brackets would need to be escaped (?).|||Sounds like dynamic creation to me...I run herd over anything getting created in oneof my databases|||Looks like only the close bracket needs to be escaped with an extra close bracket.
drop table test1
create table test1
([create table test2 (oops int not null)] int,
[]][] int)
select *
from test1
Personally, I would fight this kind of system in my shop tooth and nail, but that was not the original question.|||Looks like only the close bracket needs to be escaped with an extra close bracket.
drop table test1
create table test1
([create table test2 (oops int not null)] int,
[]][] int)
select *
from test1
Personally, I would fight this kind of system in my shop tooth and nail, but that was not the original question.
I'm old school myself, try and avoid special chars of any type, except _ in database object nams.|||I thank you all for your input.
I have fought tooth and nail My boss has said to come up with a solution. Mangers can be so OBTUSE
I have determined that the business can add alpha numeric with _
starting alpha ending alpha numeric.
Users will create these in a table that will define relationship then a process will auto generate a change control that will be added to physical structure of the database by the DBA team.
No dynamic running of an alter statment.|||Horrible.
You should rename this thread "List of managers that make SQL blow."|||I awlways wanted a list that would make my girlfr...umm never mind|||OMG Bret, if you're having trouble when she's a girlfriend...
then you are doomed after marriage...then you can get her one of those custom-lettered necklaces that say "abandon all hope, ye who..." ;)
(sorry, couldn't resist)|||Yes Brett. Listen to the advice of Mr. Romance.|||Yes Brett, listen to the advice from Mr Charm about listening to the advice from Mr Romance ;)|||Ouch! :shocked:|||i'm not sure how any of this is relavant to sql server??|||That's because you aren't familiar with the hidden intricacies of the database engines. It's actually pretty sexy in there.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment