Skip to content

Tag: sql-server

SQL multi save without using loop/ cursor

I have a requirement where from a string of int[] I need to insert all the values of this array into DB. I have tried this solution and it works fine. To achieve this I have converted the int[] to XML in C#, and in SP used this XML variable to fill a table variable and looped over this table

Get last rows before certain value [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question In my table, I have a field RAZ (bit) whose value is 0 except at 5am, 1pm and 9pm when it&#8…

Join repeats rows too many times

List the employees (first and last name in same column), that work in retail or food and drink. Include the building they work in and shop type. This is what I have. Whenever I run it everything repeats so there’s over a hundred rows now. Can anybody help me? EDIT I’ve tried various joins for this…

Combining different SQL requests but they all have same WHERE

I have lots of requests, but they always have the same WHERE, I done request to copy a character by typing his name from a table, so it copy the data from other tables (sometimes need to delete and copy, sometimes only update), but if I want to copy someone’s character, I have to type the names 7 times …