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 ('AdminManageLogIn','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 ('AdminManageLogIn','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 2 13866
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******@dtnspeed.net> wrote in message
news:d1**************************@posting.google.c om... 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 ('AdminManageLogIn','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 ('AdminManageLogIn','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
"rockie12" <ro******@dtnspeed.net> wrote in message
news:d1**************************@posting.google.c om... 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 ('AdminManageLogIn','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 ('AdminManageLogIn','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 (AdminManageLogIn,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 (AdminManageLogIn,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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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:...
|
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....
|
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...
|
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"....
|
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...
|
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...
|
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...
|
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...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |