SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 stored procedure error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bill_
Starting Member

37 Posts

Posted - 09/25/2013 :  10:23:24  Show Profile  Reply with Quote
Trying to write a stored procedure.

Clicked on parse from the query menu and got message "Command(s) executed successfully."

Then clicked on execute from the query menu and got message "The specified schema name [dbo] either doesn't exist or you do not have permission to use it."

How is this fixed and/or what specific permissions do I need ?

James K
Flowing Fount of Yak Knowledge

3326 Posts

Posted - 09/25/2013 :  10:47:20  Show Profile  Reply with Quote
Parsing does only a syntax check. If you had a statement like "exec dbo.ThisStoredProcedureDoesNotExist", and clicked on parse, it will parse with no errors. So successful parsing by itself doesn't tell you anything.

First thing to check is whether the stored procedure indeed exists in the database. In SSMS object explorer, expand the stored procedures node under the database name -> Programmability and make sure it is there. If it is there, then you need permission to execute it. You won't be able to grant yourself permission, so you will need to login using a higher priviledged login and do "grant execute on StoredProcName to YourUsername"
Go to Top of Page

bill_
Starting Member

37 Posts

Posted - 09/25/2013 :  11:22:57  Show Profile  Reply with Quote
Someone with a higher priveleged login did that and now the stored procedure is in the database. Thank you for that.

Still have a problem, when execute is clicked, output doesn't show.
Have tried print('test') and a working query between the begin-end but get "Command(s) executed successfully." and no results.

What could be missing or being done wrong ?

Edited by - bill_ on 09/25/2013 11:44:16
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3326 Posts

Posted - 09/25/2013 :  13:04:32  Show Profile  Reply with Quote
Is the stored procedure supposed to return any rows at all?

Does it require any parameters? Parameters can be created as optional, and if the code is set up to return no results when there are no parameters, this could happen.

Do you have visibility into the stored procedure code? If so, look through it to see what it is doing and why it is not returning any rows.

Is anyone else able to run the stored procedure and get return results?
Go to Top of Page

bill_
Starting Member

37 Posts

Posted - 09/25/2013 :  15:30:41  Show Profile  Reply with Quote
Thank you very much.
Got it to work.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000