views:

2806

answers:

2

I know this is similar to this question, but I'm using SQL Server CE 3.5 with a WinForms project in C#. How can I determine whether a table exists? I know the IF keyword is not supported, though EXISTS is. Does information_schema exist in CE where I can query against it? Thanks.

+9  A: 

Yes, it does exist:

SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'TableName'
Mehrdad Afshari
A: 

Funny how I can never find these things on the MSDN site until I post here. Thanks, Mehrdad.

Michael Itzoe
You're welcome. This should be a comment though, not an answer. Using an answer to post comments will clutter up SO.
Mehrdad Afshari