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

SQL Insert error

Status
Not open for further replies.
Joined
Nov 7, 2006
Messages
2
Location
CA
I'm using the following code in SQL:

create table #temp1 (c1 int)
insert into #temp1 values (1)
insert into #temp1 values (2)
insert into #temp1 values (3)
insert into #temp1 values (4)
insert into #temp1 values (5)
insert into #temp1 values (6)
insert into #temp1 values (7)

I had it previously working in a different application.

Now, I've put it in a new application and I'm getting "Invalid object name '#temp1'". I'm doing this in VBA, using an ADODB connection and a corresponding recordset to create an sql call for each line in the input file.

I'm not sure why this isn't working as it was before. Any input is greatly appreciated.
 
Note that it's the second line of code, the first insert statement, causing the error.
 
Start by removing the # from the table name - table names may not start with #

You may need to send the statements on at a time

Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting

Steam Engine enthusiasts:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top