I have a stored proc which just updates a table and I am executing it through C# code as well as through SSMS. Whenever i execute it, I get the following error:
Login failed for user domain\username
I have given full permissions to the SP and have also recreated the SP, but still I get the error. Strange thing is, all other procedures are working fine from both C# code and SSMS. I have also provided sysadmin access to my ID - still no luck.
While executing from VS (C# code), the connection opens but getting the same exception (SQLException).
Can anyone please tell me how to resolve this error?
Thanks Gregg for your suggestion. I have fixed this error. The problem was with the underlying tables the procedure was using and I have dropped and created those tables. Bingo.- it worked.
Looks strange but this is how I fixed.
Related
When i try to execute CREATE DATABASE query from .net code,
"CREATE DATABASE TESTDB_RE ON (NAME=TESTDB_RE_dat, FILENAME='D:\Test.mdf', SIZE=4MB, FILEGROWTH=4MB) COLLATE Latin1_General_CS_AS;"
I am getting error
"Detail=[9022],Msg=[The log can not be initialized because the log files are not fully formatted. Database 'TESTDB' cannot be opened due
to inaccessible files or insufficient permission" error.
I checked microsoft documentation for 9022 error but not getting sufficient information for the cause of 9022 error.
Any help would be higly appreciated. Thanks.
I am recently started working on Microsoft Sync framework 2.1 based project, which already developed, requirement is simple to sync db(server to client and client to server), but i am getting very frequent error stating blah_blah_selectchanges already exist(procedure), once i will delete all mentioned procedure it will work fine.. then again when i am trying with another machine this error comes again.. Now i am not getting a idea how to overcome with this error... I did some research and found additional tables(under sync db) created by the provisioning process: Products_Tracking, schema_info, scope_config, and scope_info. There are also other database objects such as triggers and stored procedures created by the provisioning process. I have one doubt if additional table/Procedure/Triggers is already exist on sync schema why it is creating again..
check how you're provisioning. Are you checking if the scope exists already? if there are existing scopes for the table and you want to add a new scope, you should specify SetCreateProceduresForAdditionalScopeDefault.
I have two databases; one is in local server;
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
"CORE 11.1.0.7.0 Production"
TNS for 64-bit Windows: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
The other one is a VM :
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
"CORE 11.2.0.4.0 Production"
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
Everything else about these servers are identical.
I am DBA for both of the servers. All the tables and stored procedures and are working fine in both databases but one stored procedure is not working when Asp.net tries to connect to it.
When I run my Asp.net app that is connecting to the VM database I get the following error telling me that stored procedure must be declared :
Message: Sys.WebForms.PageRequestManagerServerErrorException: ORA-06550: line 1, column 7:
PLS-00201: identifier 'GETINFO' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
I open my SQL Developer and debug the procedure on the VM database and I get the desired values.
It is only happening in .Net app if I try to get that particular stored procedure. Everything else, being all the other stored procedures, are working fine.
What I have done to fix the issue;
Changed the name of the procedure (didnt work)
Checked the schema to make sure all the tables and stored procedures belongs to correct user (they do belong to correct user)
I granted access to user even though stored procedure created by that user.
I dropped and recreated stored procedure
I used Myuser.storedprocedure name notation it didnt work
What I don't understand is that exact same code is working on local network, and also that I can debug the stored procedure via Oracle SQL Developer.
I can share the stored product here but it is really, really long.
How can I fix this?
You are getting this error because of insufficient permission to execute the stored procedure. Try to grant permissions at the user level (user level means through which credentials you are connecting to the database. Check in your config file).
I got the same issue. I created a stored procedure in Oracle DB. I executed, it compiled successfully. But, it was getting issue at runtime. After granting permissions at user level for the stored procedure then the issue resolved completely.
Run-time Exception ORA-06550: line 1, column 7:
PLS-00201: identifier 'Package.StoredProcedure' must be declared
ORA-06550: line 1, column 7: PL/SQL: Statement ignored
Check your connection string and make sure that you are calling correct database and/or schema name from C# application.
If all the other stored procedures are working fine and this specific one not working fine when you debug on oracle sql developer; it must be connection issue. If it debugs and work on both databases under DBA account there should be no permissions issues as well.
I think if you focus on connection as mmmmmpie said in his comment, you should find the issue.
I got this error when a stored procedure was changed in the database.
The script used for update the changes started with:
PROCEDURE myProcedure
By adding the following lines:
CREATE OR REPLACE myProcedure
Solved this error. In my case, maybe this error didn't show at first because it was a new stored procedure.
i got this issue when i was working with oracle and Asp.net MVC.
I was used store procedure.let me give you a in brief
we have two databases in oracle
eg. Reportdatabase, Productiondatabase
I was created store procedure on Reportdatabase and
also we have 2 connection in my web application eg: connection1, connection2
by mistakenly I was called connection2 Productiondatabase but query was
prepared on connection1 database so that some tables are not getting to Store procedure that's why I was getting this error
I'm having a problem:
I have a db connection where I run stored procedures on. This same connection is used to create said stored procedures earlier on.
When I attempt to call a given stored procedure, later on, I get the following message:
Could not find stored procedure
'dbo.yaf_prov_upgrade'.
The problem is it actually does exist on the database. And there's also the fact that it shows up on the SQL Server Profiler.
RPC:Completed exec
[dbo].[yaf_prov_upgrade]
#PreviousVersion=46,#NewVersion=46 .Net
SqlClient Data
Provider Nico Matrix\Nico
I was wondering what could be the causes a particular query would throw such an exception even when it exists, it's called, and the call reaches the database.
It can't be a problem with the connection because it already executed other stored procedures. It can't be a problem with the procedure because it does exist, in fact the very same application, the very same web page, created it and put it there.
Update: forgot to mention I'm used integrated security, and I did run the SP on the database with the same user the application connects with, and I had no problem running it.
So what can it be?
Your RPC completed only means that the batch submitted to SQL Server was correct and completed. It doesn't mean the stored procedure ran and executed OK.
It will be (don't argue, check) one of:
wrong permissions
wrong database context
wrong server
stored proc is in a different database
To ensure that things are the same
SELECT
##SERVERNAME,
SUSER_SNAME(),
DB_NAME(),
USER_NAME(),
OBJECT_ID('dbo.yaf_prov_upgrade')
The OBJECT_ID will be NULL if the stored proc doesn't exist in that database or you don't have permissions.
I suspect it might be a permissions issue, check up if the user name your program is executing under has execute rights to the stored proc.
I'm no expert by far on ms-sql, but I do know it keeps SPs in a global cache. Is it possible the local connection only gets the global list of SPs upon connection? Maybe reinit the connection or re-select the cache?
I'm guessing Visual Studio is bugging out on me. I changed the stored procedure the a TableAdapter query uses and now the users keep getting the following error.
Procedure or function 'usp_GetEventNotificationSubscribers' expects parameter '#FacilityCode', which was not supplied.
Nowhere in the application is 'usp_GetEventNotificationSubscribers' written.
I can't reproduce the error on my local machine. When I run it locally or step through it in debug mode everything works fine. It even works for me in production. But I keep getting them auto-emailed to me whenever it happens, which is about 3 a day.
Is the proc being referenced from another proc in the database? If this is so, you won't find the string in your application source code.
try this:
SELECT * FROM SYS.Comments
WHERE text LIKE '%GetEventNotificationSubscribers%'
Is the stored procedure different (e.g. with different parameters) at the production site? It might be that the proc was updated/altered there and locally at your dev environment you're working with a different procedure. This error seems to suggest that the proc in the sqlserver db at the production site has more parameters than the one at your development database.
A few users where still using the test version of the site. I denied access to everyone on the test virtual directory and the error ceased.
Thanks Noel