Professional Web Applications Themes

Invalid Object Name - Microsoft SQL / MS SQL Server

Trebor, If thats the requirement, then you may need to use dynamic sql.Something like this exec('UPDATE current_marks_'+section+' SET current_marks_'+section....) You can get more info.about dynamic sql from this site: http://www.algonet.se/~sommar/dynamic_sql.html -- Dinesh. SQL Server FAQ at http://www.tkdinesh.com "Trebor" <ca> wrote in message news:052101c34d91$b1216ba0$gbl... ...

  1. #1

    Default Re: Invalid Object Name

    Trebor,

    If thats the requirement, then you may need to use dynamic sql.Something
    like this

    exec('UPDATE current_marks_'+section+' SET current_marks_'+section....)

    You can get more info.about dynamic sql from this site:
    http://www.algonet.se/~sommar/dynamic_sql.html


    --
    Dinesh.
    SQL Server FAQ at
    http://www.tkdinesh.com

    "Trebor" <ca> wrote in message
    news:052101c34d91$b1216ba0$gbl... 


    Dinesh.T.K Guest

  2. #2

    Default Invalid Object Name

     
    If current_marks_section is temporary table then you must
    use -sign at the begening as current_marks_section.
    Otherwise, if it is not temporary table then dont use -
    sign.
    MAT Guest

  3. #3

    Default Re: Invalid Object Name

    After a careful read of that reference, I have decided to
    cancel my vacation and re-design the system I inherited.
    Thanks for pointing me in the right direction TK!
     
    dynamic sql.Something 
    current_marks_'+section....) 

    Trebor Guest

  4. #4

    Default Re: Invalid Object Name

    Trebor (ca) writes: 

    As being the author of the doent in question, I have to say that I am
    extremely pleased to hear that it made you reconsider the design. Too bad
    about the vacation, though.

    By the way, "current_marks_section" is actually a legal identifier:

    CREATE TABLE current_marks_section (a int NOT NULL)
    go
    INSERT current_marks_section (a) VALUES (4711)
    go
    SELECT * FROM current_marks_section

    --
    Erland Sommarskog, SQL Server MVP, se

    Books Online for SQL Server SP3 at
    http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
    Erland Guest

Similar Threads

  1. SQL invalid object name
    By jci714 in forum Coldfusion Database Access
    Replies: 18
    Last Post: January 1st, 02:53 PM
  2. Invalid object name
    By michaelmuller in forum Coldfusion Database Access
    Replies: 2
    Last Post: July 7th, 02:30 PM
  3. Invalid Object Name??
    By michaelmuller in forum Coldfusion Database Access
    Replies: 0
    Last Post: June 30th, 07:25 PM
  4. Invalid Object Name??
    By michaelmuller in forum Coldfusion Database Access
    Replies: 0
    Last Post: June 30th, 07:19 PM
  5. invalid object name after upsize
    By Dan in forum ASP Database
    Replies: 9
    Last Post: October 12th, 08:55 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139