Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Jan 2005
    Location
    Green Bay
    Posts
    201

    Unanswered: List of values that make SQL Blow

    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.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    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.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    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.

    Code:
    create table test1
    ([(ticks, #, :, -,)] int,  -- Given example
     [~`!@#$%^&*()_+] int) -- Top row of the keyboard.
    
    select *
    from test1

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    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 (???).
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Sounds like dynamic creation to me....I run herd over anything getting created in oneof my databases
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  6. #6
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    Looks like only the close bracket needs to be escaped with an extra close bracket.
    Code:
    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.

  7. #7
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    Quote Originally Posted by MCrowley
    Looks like only the close bracket needs to be escaped with an extra close bracket.
    Code:
    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.

  8. #8
    Join Date
    Jan 2005
    Location
    Green Bay
    Posts
    201
    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.

  9. #9
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Horrible.

    You should rename this thread "List of managers that make SQL blow."
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  10. #10
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    I awlways wanted a list that would make my girlfr....umm never mind
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  11. #11
    Join Date
    Feb 2004
    Location
    Burbank & Santa Cruz de la Sierra
    Posts
    3,716
    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)
    aka "Paul"
    Non est ei similis.

    I just read "100 Things To Do Before You Die". I was surprised that "Yell for help!!" wasn't one of them

  12. #12
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Yes Brett. Listen to the advice of Mr. Romance.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  13. #13
    Join Date
    Jan 2006
    Location
    Los Angeles, CA
    Posts
    63
    Yes Brett, listen to the advice from Mr Charm about listening to the advice from Mr Romance

  14. #14
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Ouch!
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  15. #15
    Join Date
    Jun 2004
    Location
    Philly
    Posts
    51
    i'm not sure how any of this is relavant to sql server??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •