Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Temp Tables and Such 1

Status
Not open for further replies.

TonyRosen

Programmer
Jul 28, 2003
108
US
I need to create a temp table, however, I also need to check if it exists first ...

For Example ...

If #this_table exists, just update the thing ...

Else, create #this_table, and then update it.

I know this is easy, but I just can't think it through for some reason ... it's giving me fits.
 
Why not do a count, if not.eof then it exists.
ie;

Code:
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Your ConnectionString"

strSql = "SELECT COUNT(*) As 'count' FROM SysObjects WHERE name = 'Tablename'"

if rs("count") > 0 Then
The table exists
else
The table doesn't exist
end if
 
That worked awesomely ... it appears .... thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top