I’ve been creating a database for class and I’m having trouble seeing my tables. I have a total of 12 tables I have created, 3 via CREATE TABLE statements and the rest using the SQL Server Management Studio, I’m trying to enter an INSERT INTO statement but it’s not recognizing the tabl…
Tag: sql-server
Bulk insert using EntityFramework Extended
According to this, bulk insert in Entity can be made using the following code: I used SQL Profiler to verify how many insert queries were executed and I saw there was an insert for each element of the list. Why? Answer AddRange Add range doesn’t perform a BulkInsert, it simply DetectChanges once after a…
TSQL find number of correspondences
I have the following table: Test Data: I need to find out how many times correspondence has been between each pair. For example, Anthony has contacted John 5 times, John has contacted Anthony 5 times. So total correspondence between John and Anthony has been 10 times. Similarly, David has contacted John total…
Create SQL Server table from user-defined class [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last month. Improve this question I am creating a mini-ORM to learn reflection better in C#. Also I want…
Select the latest message thread values from a table using sql
This is my table Id | ReceiverId | SenderId | Text ———–+—————+————–+———– 1 | 5 | 1 | text 2 | 5 | …
How does a recursive correlated expression speed up distinct queries?
I found this post about speeding up distinct queries: Super-fast DISTINCT using a recursive CTE: — 15ms CPU The recursive CTE is 100 times more efficient 🙂 This kind of speedup would be extremely valuable for my current project, but I am not sure in which cases this approach is beneficial. To be honest:…
How to update Sql table from excel directly?
I have an sql database and I am able to connect with excel spreadsheet. But when I update the table from excel directly it’s not updating the database and once I click refresh all the entered data is …
SQL Query Where Date = Today Minus 7 Days
I have a SQL table of hits to my website called ExternalHits. I track the URL as URLx and the date the page was accessed as Datex. I run this query every week to get the count of total hits from the week before, and every week I have to manually change the “between” dates. Is there some way I
Calculating percentages based on a few columns in a subgroup
I have a table (let’s call it Table A) like this: ID Device Clicks 1 A 10 1 B 10 2 A 1 2 C 19 I would …
SQL Server datasets [closed]
I would like to know if there are any SQL Server ready datasets which one can use. I know there’s AdventureWorks (which i’m already using), but i would like to know if there are more. I also open for …