Search Results

Search found 2 results on 1 pages for 'gillivilla'.

Page 1/1 | 1 

  • LINQ Equivalent query

    - by GilliVilla
    I have a List<string> List<string> students; students.Add("123Rob"); students.Add("234Schulz"); and a Dictionary<string,string> Dictionary<string, string> courses = new Dictionary<string, string>(); courses .Add("Rob", "Chemistry"); courses .Add("Bob", "Math"); courses .Add("Holly", "Physics"); courses .Add("Schulz", "Botany"); My objective now is to get a List with the values - {Chemistry,Botany} . In other words, I am trying to get the LINQ equivalent of select value from [courses] where [courses].key in ( select [courses].key from courses,students where [students].id LIKE '%courses.key%' ) How should the LINQ query be framed?

    Read the article

  • Stored procedure for generic MERGE

    - by GilliVilla
    I have a set of 10 tables in a database (DB1). And there are 10 tables in another database (DB2) with exact same schema on the same SQL Server 2008 R2 database server machine. The 10 tables in DB1 are frequently updated with data. I intend to write a stored procedure that would run once every day for synchronizing the 10 tables in DB1 with DB2. The stored procedure would make use of the MERGE statement. Now, my aim is to make this as generic and parametrized as possible. That is, accommodate for more tables down the line... and accommodate different source and target DB names. Definitely no hard coding is intended. This is my algorithm so far: Have the database names as parameters Have the first query within the stored procedure... result in giving the names of the 10 tables from a lookup table (this can be 10, 20 or whatever) Have a generic MERGE statement that does the sync for each of the above set of tables (based on primary key?) This is where I need more inputs on. What is the best way to achieve this stored procedure? SQL syntax would be helpful.

    Read the article

1