Ajinkya Ban

Ajinkya Ban

  • NA
  • 32
  • 41.9k

how to write simple query

Mar 19 2013 6:15 AM
hi

this is my sp
UPDATE Con
SET Category1code =c1.Category1Name, Category2Code=c2.Category2Name
FROM Contacts Con 
    INNER JOIN Category1 As c1
        ON Con.Category1Code = c1.Category1Code
    Inner Join Category2 As c2
        ON Con.Category2Code = c2.Category2Code
        
just i want write above sp into simple query like

SqlConnection Con=new SqlConnection();
SqlCommand cmd=New SqlCommand("how to write above sp here",con);

please give me solution
thanx in advance.

Answers (8)