473,748 Members | 3,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error... Invalid object name 'data1'.

I have a db that has a table x in it called data1

I have a program that does to things, updates values in the data1
table and also inserts new rows into this table. The update existing
values works great. Then when the insert loop runs, I get this error
on the following line.

insert into data1 ('AdminManageLo gIn','Password' ) Values ('123','222')

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'data1'.

I am connected to the table x in the earlier step, I do the update
and all is fine then I change the sql statement to

insert into data1 ('AdminManageLo gIn','Password' ) Values ('123','222')

and it gives me this error.

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'data1'.

Thanks in advance for your assistance.
Dean-O
Jul 20 '05 #1
2 13907
If you are sure you are in the right database then I would look at WHO owns
data1. For your statement to work it either needs to be you ir dbo.
Anybody else and it will throw your error.

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know
"rockie12" <ro******@dtnsp eed.net> wrote in message
news:d1******** *************** ***@posting.goo gle.com...
I have a db that has a table x in it called data1

I have a program that does to things, updates values in the data1
table and also inserts new rows into this table. The update existing
values works great. Then when the insert loop runs, I get this error
on the following line.

insert into data1 ('AdminManageLo gIn','Password' ) Values ('123','222')

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'data1'.

I am connected to the table x in the earlier step, I do the update
and all is fine then I change the sql statement to

insert into data1 ('AdminManageLo gIn','Password' ) Values ('123','222')

and it gives me this error.

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'data1'.

Thanks in advance for your assistance.
Dean-O

Jul 20 '05 #2

"rockie12" <ro******@dtnsp eed.net> wrote in message
news:d1******** *************** ***@posting.goo gle.com...
I have a db that has a table x in it called data1

I have a program that does to things, updates values in the data1
table and also inserts new rows into this table. The update existing
values works great. Then when the insert loop runs, I get this error
on the following line.

insert into data1 ('AdminManageLo gIn','Password' ) Values ('123','222')

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'data1'.

I am connected to the table x in the earlier step, I do the update
and all is fine then I change the sql statement to

insert into data1 ('AdminManageLo gIn','Password' ) Values ('123','222')

and it gives me this error.

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'data1'.

Thanks in advance for your assistance.
Dean-O


First., you should remove the quotes around your column names:

insert into data1 (AdminManageLog In,Password) Values ('123','222')

You should also check the owner of the object - it's always good practice to
qualify the object name with its owner:

insert into dbo.data1 (AdminManageLog In,Password) Values ('123','222')

Finally, another possibility is that your database is case-sensitive and the
correct object name is Data1 (or whatever) not data1.

Simon
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
21008
by: FreeOperator | last post by:
Dear all, On Win2000 server with SP3, I am trying to access a SQL Server 7.0 database, "TestDB", from VB6 via a SQL Server ODBC system DSN using ADO 2.7. In SQL Server Enterprise Manager, there is a login named "Tester". In its property window, NO "Server Roles" was assigned but its "Database Access" was set to "TestDB". This login was also made as the user of "TestDB" with "public", "db_datareader" and "db_datawriter" selected as its...
1
2356
by: Frank Py | last post by:
I'm getting the following error when trying an example app: Invalid object name 'Products'. Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'Products'. Line 22: myCommand.Fill(ds) Help appreciated. Thanks - Frank <code>
2
2692
by: Jerry Nelson | last post by:
I get the following error: WGA_Update is a view not a Table Invalid object name 'WGA_Update'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Invalid object
2
2066
by: darrel | last post by:
I'm trying to delete a record in a table: Dim strConnect As String = System.Configuration.ConfigurationSettings.AppSettings("myConnectionString") Dim strChk = "DELETE FROM we_admin_users WHERE UserID='" & myUserID & "'" Dim objConnect As New System.Data.OleDb.OleDbConnection(strConnect) objConnect.Open() Dim objCommand As New System.Data.OleDb.OleDbCommand(strChk, objConnect) objCommand.ExecuteNonQuery()
3
7421
by: ianforgroupuse | last post by:
I'm running Vista Business edition on 2005 Virtual PC. Installed SQL Server 2005 Express latest download, with instance of MSSQLSERVER and service accounts running under "NT AUTHORITY\SYSTEM". Mixed mode authentication specified and sa password specified. Used server manager to create user login with sysadmin role. Login using windows authentication. Run my application and database is created and populated with default records.
2
3120
by: shadwise | last post by:
HI I'M NEWBIES in visual Basic with Sql Server i try to make a database with stored procedure and whan i run the program the give an error "Invalid object name 'Product'." i dont know how to fix it here is my code Dim sqlcon As New SqlClient.SqlConnection sqlcon.ConnectionString = "Data Source=WISEMAN\SQLEXPRESS;Initial Catalog=Product;Integrated Security=True;Pooling=False;uid=uid;pwd=pwd " Dim cmd As New...
1
3173
by: imranabdulaziz | last post by:
Dear All, I am using sql2005. i am writing stored procedure to save various master data . I recognize master by @type (input verible) and assign it to @mst veriable then based on @mst no I perform saving task . I created sp . now I am trying to execute then I am getting error “Invalid object name 'SizeMst'. “ I am running this query from its database. Stored perocedure is Alter procedure . @type int ,
4
3351
by: Curious | last post by:
I got an exception when executing the SQL statement in my code below. The error is "Invalid object name 'db_dynamic_trading.dbo.TrdRpt_broker_list'". I know for a fact that 'db_dynamic_trading.dbo.TrdRpt_broker_list' is valid, because I can run the same SQL statement in Management Studio and it works. Any advice on this? Is there anything wrong with my connection string (although there is no complaint about the connection string in my
8
23696
by: dougancil | last post by:
I have the following query: insert into msbtotal.dbo.newclients SELECT distinct tcms_members.dbo.memberdata2.* FROM tcms_members.dbo.memberdata2 left outer join msbtotal.dbo.memberdata on tcms_members.dbo.memberdata2.id = msbtotal.dbo.memberdata.id where msbtotal.dbo.memberdata.id is null and when I try to run this, I get the following error:
0
8987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9241
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8239
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.