Question

I created a table using SQL Server CE like this:

SqlCeCommand createTableCmd = new SqlCeCommand();
createTableCmd.CommandText = "Create table docEntry (id nvarchar (70) not null PRIMARY KEY, "
                + "parent nvarchar(70), "
                + "lmt bigint not null, "
                + "fileName nvarchar(70) not null)";

Table name is docEntry, and the column width I need to find out is fileName column.

The purpose is to detect if the column width is 70, if yes, I need to expand it to other size, else leave it.

I tried

SELECT COL_LENGTH(docEntry, fileName)

it caused exception:

SqlCeException was caught:
The column name is not valid. [ Node name (if any) = ,Column name = docEntry ]

I don't know why...

Anyone knows?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top