Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Store Procedure not store

Author  Topic 

atuljadhavnetafim
Starting Member

25 Posts

Posted - 2013-11-20 : 03:34:56
Dear Expert

My store Procedure is not save in Strore Procedure folder
at the time of saving it give me option to save in Project folder and file name default is SQLQuery6.sql when i save it
after saving
when i run my store procedure

exec [dbo].[SP_GetOrdersForCustomer] 'ALFKI'

i am getting below error please give advice

Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'dbo.SP_GetOrdersForCustomer'.





Atul Jadhav

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2013-11-20 : 04:04:28
are you executing it in the right database ?

did you execute the CREATE PROCEDURE to create it ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-20 : 04:11:57
you need to execute the create proc code and it will get created in database. then you'll be able to find it within programability-> stored procedure. you dont need to save actual file for that.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

atuljadhavnetafim
Starting Member

25 Posts

Posted - 2013-11-20 : 04:19:41
Dear Both

please see how i creating store procedure

go to datbase defaul folder in sql server managment studio
then go to my Data base i.e. Northwind
expand it and go to programability, the right click on Store procedure select new store procedure
and pasted my code and at the tive of saving i am facing option to save it
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-20 : 08:15:58
quote:
Originally posted by atuljadhavnetafim

Dear Both

please see how i creating store procedure

go to datbase defaul folder in sql server managment studio
then go to my Data base i.e. Northwind
expand it and go to programability, the right click on Store procedure select new store procedure
and pasted my code and at the tive of saving i am facing option to save it


you shouldnt save it
you should click execute button (!) on top and then it will get created.
You may save it anywhere afterwards if you want to keep a local copy.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

atuljadhavnetafim
Starting Member

25 Posts

Posted - 2013-11-21 : 00:30:51
i also tried this but not working

i have table of dealer wise sales report and dealer code is unique and column name is 'Dealer_Code'
now give me code to paste in store procedure,
if i want sales for dealer code '20606'
then i will try

Atul Jadhav
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-21 : 01:02:56
quote:
Originally posted by atuljadhavnetafim

i also tried this but not working

i have table of dealer wise sales report and dealer code is unique and column name is 'Dealer_Code'
now give me code to paste in store procedure,
if i want sales for dealer code '20606'
then i will try

Atul Jadhav


just add a where condition based on Dealer_Code field

ie like

...
WHERE Dealer_Code = '20606'


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

atuljadhavnetafim
Starting Member

25 Posts

Posted - 2013-11-22 : 04:22:03
hi

now its work fine in but get error like
error 3706 provider cannot be found

pl help
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-11-22 : 04:31:15
May be you are missing some dll related to database drivers.
http://www.mombu.com/microsoft/sql-server-ole-db/t-run-time-error-3706-provider-cannot-be-found-it-may-not-be-properly-installed-page2-972183.html
http://social.msdn.microsoft.com/Forums/en-US/b2078e40-51ad-4779-ae64-2e710f343823/run-time-error-3706-provider-cannot-be-found-it-may-not-be-properly-installed

--
Chandu
Go to Top of Page

atuljadhavnetafim
Starting Member

25 Posts

Posted - 2013-11-22 : 04:31:55
I am getting error at below line
please tell me where i am wrong,
what shd i mentioned at Provider , Data Source, and Initial Catelog and rest of all

con.Open "Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=Northwind;Integrated Security=SSPI;Trusted_Connection=Yes;"

this is my local excel file code, it is call to sql server to run store procedure and paste data in local excel file
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-11-22 : 04:37:45
try this...
con.Open "Data Source=localhost;Initial Catalog=Northwind;Integrated Security=SSPI;Trusted_Connection=Yes;"

--
Chandu
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-11-22 : 04:40:51
refer
http://support.microsoft.com/kb/816701

--
Chandu
Go to Top of Page

atuljadhavnetafim
Starting Member

25 Posts

Posted - 2013-11-22 : 04:46:07
now i getting below erro
Run time error 2147217887 (80040e21)
multiple step OLE DB operation generated error
check each ole db status value if available, no work was done

in same line error found

Atul Jadhav
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-22 : 06:50:39
quote:
Originally posted by atuljadhavnetafim

now i getting below erro
Run time error 2147217887 (80040e21)
multiple step OLE DB operation generated error
check each ole db status value if available, no work was done

in same line error found

Atul Jadhav


are you rying to call the procedure from somewhere?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -