Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock 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.
Nov 7, 2006
2
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.
 
Replies continue below

Recommended for you

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