Search code examples
sqlsql-serverstored-proceduressql-server-ce

Tool for automatic translation of stored procedures to plain SQL for MS-SQL CE


Given I have an application using an MS-SQL database with stored procedures and I would now also like to support the MS-SQL CE version which does not support stored procedures. What I was just thinking of was I could intercept the queries and replace calls to stored procedures with plain SQL. Is there a tool which does provide this functionality? Is there a library which can automatically translate the definition of a stored procedure to a plain SQL query?

Is such an approach possible? What are possible drawbacks? Are there any tools that would help here?


Solution

  • As SQL Server Compact only can execute a single statement per call to ExecuteReader/ExecuteNonQuery, you will have to spilt your logic between code and SQL calls for SQL CE. There are no tools to help you do this.