how can i check if a table already exists and more

Results 1 to 2 of 2

Thread: how can i check if a table already exists and more

  1. #1
    Join Date
    Dec 1969

    Default how can i check if a table already exists and more

    How can i check if a table already exists?<BR><BR>Thats because i use a temp. table to show results to a user. (by ASP, in SQL-server 7)<BR>Normally this isn&#039t a problem, because i drop the table after showing the results.<BR>But when a error occures, ASP don&#039t drop the table.<BR><BR>So -&#062; how can i check this? (By SQL-code or VB-code???)<BR><BR>Second question:<BR><BR>How can i add two attributes from a table / recordset?<BR><BR>example:<BR><BR>set view = db.execute("select * from tablename;")<BR><BR>counter=counter+view("attribut e")<BR><BR>End example:<BR><BR>When i use this code, i get a error back from the IIS-server. TYPE MISMATCH<BR><BR><BR>Thanx<BR><BR>Pieter <BR> <BR> <BR>

  2. #2 Guest

    Default RE: how can i check if a table already exists and

    To the first question:<BR><BR>Not a good idea to create temp table just to display a result on internet page. If one user request the page and the temp table is created, then another user requests it, you either won&#039t be able to create it due to locking, or you may destroy the temp table before the first user has used it. <BR><BR>You would be best to either do a SQL query to return the result, or if it is complicated put the results into ASP variables, do whatever calculations/manipulations and display the answers. Run multiple queries if you can&#039t achieve what you want through table joins.<BR><BR>Question 2: I presume you have a table field called "attribute", and in your code you are using the value of that field to increment your counter. It looks like Attribute may be text or other non-numeric type, and you can&#039t add it to a numeric.

Posting Permissions

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