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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP/SQL Syntax

Status
Not open for further replies.

tekthis

MIS
Jun 9, 2004
77
US
hi...i am having trouble with the syntax in my sql statement...im trying to send date from one table to another...here is what i have...
----------------------------------------------------
<% @ Language="VBScript" %>
<% Option Explicit %>

<%
Dim connection
Dim name
Dim sSQL
Dim sConnString

sSQL = "Insert into users_tbl select name from (select name from tempusers_tbl tb where NOT EXISTS (select null from users_tbl where name = tb.name))"

Set connection = Server.CreateObject("ADODB.connection")

sConnString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath("users.mdb") & ";"

connection.Open sConnString

connection.execute(sSQL)

connection.Close
Set connection = Nothing
%>
----------------------------------------------------------
it would be much appriciated if someone can help...thanks for your time...
 
sSQL = "Insert users_tbl (name) select tempusers_tbl.name from tempusers_tbl left join users_tbl on tempusers_tbl.name = users_tbl.name where users_tbl.name is null"

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top