Dataset selection question
-
Hello folks, I have a C# application which contains an interesting function using a SQL command, essentially it goes like this INSERT INTO Table C (Name)SELECT DISTINCT Name from [Table A]WHERE Name NOT IN (SELECT DISTINCT Name FROM Table B This runs on 2005 express SQL and works fine, what this does is effectively pull values from one table column which are not already in another table with the same column and then insert them into a third table.It is a long story. I need a way to accomplish this in an applicaton being written using SQL CE 3.5 which does not support sub queries on nText data. LINQ is out of the question as well due to SQL CE. Any ideas ? All help greatly appreciated, not sure which way to go with this hence posting in C# forum.:~:~
-
Hello folks, I have a C# application which contains an interesting function using a SQL command, essentially it goes like this INSERT INTO Table C (Name)SELECT DISTINCT Name from [Table A]WHERE Name NOT IN (SELECT DISTINCT Name FROM Table B This runs on 2005 express SQL and works fine, what this does is effectively pull values from one table column which are not already in another table with the same column and then insert them into a third table.It is a long story. I need a way to accomplish this in an applicaton being written using SQL CE 3.5 which does not support sub queries on nText data. LINQ is out of the question as well due to SQL CE. Any ideas ? All help greatly appreciated, not sure which way to go with this hence posting in C# forum.:~:~
Might help to switch to
NVARCHAR
, as that's the type that's used to store queryable texts.NTEXT
is a large text, more used in full-text searches and less in queries (as they often contain more data, and querying blobs tends to be slow)I are Troll :suss:
-
Might help to switch to
NVARCHAR
, as that's the type that's used to store queryable texts.NTEXT
is a large text, more used in full-text searches and less in queries (as they often contain more data, and querying blobs tends to be slow)I are Troll :suss:
Thanks, I shall try and get back to you with a result
-
Hello folks, I have a C# application which contains an interesting function using a SQL command, essentially it goes like this INSERT INTO Table C (Name)SELECT DISTINCT Name from [Table A]WHERE Name NOT IN (SELECT DISTINCT Name FROM Table B This runs on 2005 express SQL and works fine, what this does is effectively pull values from one table column which are not already in another table with the same column and then insert them into a third table.It is a long story. I need a way to accomplish this in an applicaton being written using SQL CE 3.5 which does not support sub queries on nText data. LINQ is out of the question as well due to SQL CE. Any ideas ? All help greatly appreciated, not sure which way to go with this hence posting in C# forum.:~:~
So, you can perform each query on it's own, and process the data in your application? Or are you trying to figure out why it doesn't work?
Craigslist Troll: litaly@comcast.net "I have a theory that the truth is never told during the nine-to-five hours. " — Hunter S. Thompson
-
So, you can perform each query on it's own, and process the data in your application? Or are you trying to figure out why it doesn't work?
Craigslist Troll: litaly@comcast.net "I have a theory that the truth is never told during the nine-to-five hours. " — Hunter S. Thompson
This query does work when run as a sql command against a 2005 express database, changing to nvarchar has removed the error due to the type incompatability, thanks. However when I ran the command from the app it had legal syntax but no affect ? So i pasted it into the sql pane and intllisense altered the statement to this
INSERT INTO Table_C (Name) SELECT DISTINCT Name FROM Table_A WHERE (Name NOT IN (SELECT DISTINCT Name FROM Table_B AS Table_B_1))
This SQL command now works, i will have to do some homework on why that change is required for SQL CE 3.5 and not in SQL 2005 express :confused: