Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Stored Procedure in SqlCE

I have just installed Sql Server Compact Edition. To my surprise, we can't use stored procedure in sql server CE. Do I have any alternative of Stored Procedure in Sql Server CE. I am strongly obsessed with stored procedure, I can'nt think of an application without stored procedures.

Please help, Thanks in advance.

Edit: Can I use Managed Stored Procedures.

like image 627
Vaibhav Jain Avatar asked Jan 16 '10 19:01

Vaibhav Jain


People also ask

How stored procedure works in SQL?

SQL Stored Procedures for SQL ServerA stored procedure is a prepared SQL code that you can save, so the code can be reused over and over again. So if you have an SQL query that you write over and over again, save it as a stored procedure, and then just call it to execute it.

How do you use stored procedure?

Expand the database that you want, expand Programmability, and then expand Stored Procedures. Right-click the user-defined stored procedure that you want and select Execute Stored Procedure. In the Execute Procedure dialog box, specify a value for each parameter and whether it should pass a null value.

How do I create a stored procedure in SQL?

Using SQL Server Management StudioRight-click Stored Procedures, and then click New Stored Procedure. On the Query menu, click Specify Values for Template Parameters. In the Specify Values for Template Parameters dialog box, enter the following values for the parameters shown. Returns employee data.

How do you execute a stored procedure in a query?

To execute a stored procedure from the query window, we can use EXEC statements. Executing parameter less stored procedure is very simple, use EXEC with stored procedure name. Notice that the database dropdown must have the database selected in which the stored procedure exists.


1 Answers

SqlCe is a local database for use by an application. There is no need for stored procedures since the database is just a local data store, and the business logic is in the application. It is not an engine. If you need an engine then use SqlExpress or its big brother. See Steve Lasker's Comparing SQL Server Express and Compact Editions Whitepaper at http://download.microsoft.com/download/A/4/7/A47B7B0E-976D-4F49-B15D-F02ADE638EBE/Compact_Express_Comparison.doc. It explains everything you need to know.

No, you cannot use managed stored procedures. SqlCe is in-process.

Also, you might find Data Storage Architecture with SQL Server 2005 Compact Edition at http://msdn.microsoft.com/en-us/library/bb380177(SQL.90).aspx helpful.

like image 95
AMissico Avatar answered Oct 16 '22 20:10

AMissico