Author |
Message
|
praj1740 |
Posted: Thu May 16, 2013 1:42 am Post subject: connecting broker to a database on sql server 2008 |
|
|
 Apprentice
Joined: 05 Feb 2013 Posts: 29 Location: INDIA
|
Hi everyone i created a database named sample under dbo schema, and added a system DSN for that database and i have run the mqsisetbdparms command with specific user id.In the Esql code im trying to insert data into table.When im debugging the flow it is throwing the exception .
[Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name 'dbo.employeedetails'.
I tried to resolve the error but cant find why exactly it is not identifying the table.
Can anyone help me resolving this.Thank you |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu May 16, 2013 2:04 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Perhaps you don't need the 'dbo'?
Perhaps the user you are connecting to the DB with has no rights on this table?
Why not try connecting to the DB with SQL Studio using that user and seeing if the command you are trying to use actually works?
etc etc etc etc _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
praj1740 |
Posted: Thu May 16, 2013 2:16 am Post subject: |
|
|
 Apprentice
Joined: 05 Feb 2013 Posts: 29 Location: INDIA
|
hi smdavies i executed the command in the database and i has inserted the values in the table and the user has all necessary permissions.Is the anything wrong with my mqsisetbdparms in it i specified the user name as my system user name instead of schema name dbo |
|
Back to top |
|
 |
mapa |
Posted: Thu May 16, 2013 2:21 am Post subject: |
|
|
 Master
Joined: 09 Aug 2001 Posts: 257 Location: Malmö, Sweden
|
To verify your datasoure use mqsicvp
As in:
Code: |
mqsicvp <broker> -n <DSN>
|
I think as hinted by previous answer that you don't have the name/syntax right...
Please post the ESQL for the insert (and put it in code-tags).
I have inserts that look like (trying to translate it to your example)
Code: |
Database.sample.dbo.employeedetails |
|
|
Back to top |
|
 |
praj1740 |
Posted: Thu May 16, 2013 2:28 am Post subject: |
|
|
 Apprentice
Joined: 05 Feb 2013 Posts: 29 Location: INDIA
|
I verified with mqsicvp and the connection is successfully established
Code: |
INSERT INTO Database.dbo.employeedetails(employeeno,empname ) VALUES (144,'ravi' ); |
.
This is my insert statement |
|
Back to top |
|
 |
dogorsy |
Posted: Thu May 16, 2013 3:15 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
you need to look in the database and see which is the default schema name for the user you used in the mqsisetdbparms. if not dbo, then either remove the .dbo from you esql or change the database userid to use dbo as schema |
|
Back to top |
|
 |
praj1740 |
Posted: Thu May 16, 2013 7:25 pm Post subject: |
|
|
 Apprentice
Joined: 05 Feb 2013 Posts: 29 Location: INDIA
|
I have checked in the database and the default schema is dbo.Even i have removed the dbo in the insert statement and still it is not identifying the table object |
|
Back to top |
|
 |
dogorsy |
Posted: Thu May 16, 2013 9:28 pm Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
what system are you trying to connect from ?
if from windows, review your odbc definition, make sure that is pointing to your database ( sample ) and not the default.
if from a unix, please post your odbc definition, as I suspect you are pointing to the wrong data source and that is why the table cannot be found |
|
Back to top |
|
 |
praj1740 |
Posted: Fri May 17, 2013 1:40 am Post subject: |
|
|
 Apprentice
Joined: 05 Feb 2013 Posts: 29 Location: INDIA
|
I just checked the odbc definition in the system dsn and it is pointing to a default database.I am new to this configuration and made a mistake.Thanks all for your help. |
|
Back to top |
|
 |
new2z |
Posted: Fri May 17, 2013 12:12 pm Post subject: |
|
|
Novice
Joined: 16 May 2013 Posts: 15
|
Quote: |
[Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name 'dbo.employeedetails' |
This is happening because your broker user is trying to call the table from its own schema.
If your broker user is brkrusr, then your broker may be looking at something like Database.brkrusr.employeedetails
The easiest way is to try to recreate your tables with brkrusr, and try again |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri May 17, 2013 12:24 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
new2z wrote: |
The easiest way is to try to recreate your tables with brkrusr, and try again |
What about authorizing the user you are logging onto the DB with to access these tables? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
praj1740 |
Posted: Fri May 17, 2013 6:32 pm Post subject: |
|
|
 Apprentice
Joined: 05 Feb 2013 Posts: 29 Location: INDIA
|
Hi new2z now it is working earlier i made a mistake in the odbc definition thats points to a default database and i modified it to sample database and now its working fine.Thank you |
|
Back to top |
|
 |
|