Take the 2-minute tour ×

I'm trying to script the changes to a SQL Server Compact Edition database running on windows mobile 6 and could really use:

EXECUTE sp_rename 'MyTable.SomeColumn', 'BrandNewName', 'COLUMN'

What other system stored procedures are available?

What are the differences to the non compact version?

Edit: There ARE system stored procedures in ce, sp_rename is an example although it only seems to work against tables not columns.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

I don't believe there are any stored procedures available in SqlCe. My solution has been to create a class that contains a SqlCeEngine and expose my own methods like RenameColumn, and do the work internally.

EDIT 1: Now, that's very interesting (the existence of sp_rename). Considering the documentation out there that states there are no stored procedures in SQL CE, I don't think it's really fair to downvote anyone for that assumption.

EDIT 2: I've come across this link from MSDN that indicates at least one other proc: sp_show_statistics. I'm assuming you're using SQL CE 3.5 SP1.

share|improve this answer
Again, you can't define your own stored procedures which is what ctacke's article says but the database runs off system stored procs internally. Which is what my question is about. –  TreeUK Feb 27 '09 at 17:00
That looks as close to a definitive list as I can get :) thanks –  TreeUK Feb 27 '09 at 17:11
There are not actually procs - you call them that way but they are mapped internal functions that are just exposed that way. There is no internal secret stored proc engine. –  Jason Short May 16 '09 at 5:38
add comment

SQL CE doesn't support stored procedures, so there are none at all.

share|improve this answer
User stored procs no, system stored procedures yes. –  TreeUK Feb 27 '09 at 16:50
Downvote away people. But I seriously doubt that the SQLCE team would have actually implemented a full SP engine and then exposed only 2 procedures and no ability to add user procs. I'm willing to bet that the two listed aren't SPs at all but instead are hard-coded into the query engine. –  ctacke Feb 27 '09 at 19:31
I'm having to script changes to a compact database deployed to more than 40 devices. I saw sp_rename was there so my question was to find other sprocs that might help the scripting. So I think your declaration of 'there are none' posting an article about user sprocs is what got you downvoted. –  TreeUK Mar 4 '09 at 11:08
I was already aware that user sprocs are not available, but that wasn't the question. Article is appreciated though, so +1 from me. –  TreeUK Mar 4 '09 at 11:10
These "system" sprocs don't exist. They are actually C functions that just get mapped to a sql function for some situations. There is no internal sproc engine. –  Jason Short May 16 '09 at 5:37
show 1 more comment

Your Answer


