Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Dataset selection question

Dataset selection question

Scheduled Pinned Locked Moved C#
csharpquestiondatabaselinqhelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    minnie mouse
    wrote on last edited by
    #1

    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.:~:~

    L W 2 Replies Last reply
    0
    • M minnie mouse

      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.:~:~

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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:

      M 1 Reply Last reply
      0
      • L Lost User

        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:

        M Offline
        M Offline
        minnie mouse
        wrote on last edited by
        #3

        Thanks, I shall try and get back to you with a result

        1 Reply Last reply
        0
        • M minnie mouse

          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.:~:~

          W Offline
          W Offline
          wizardzz
          wrote on last edited by
          #4

          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

          M 1 Reply Last reply
          0
          • W wizardzz

            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

            M Offline
            M Offline
            minnie mouse
            wrote on last edited by
            #5

            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:

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups