Microsoft's SQL Server is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It originated from the Sybase SQL Server codebase, which is why both products use the extension of SQL called Transact-SQL (T-SQL).
2
votes
0answers
26 views
EF6-Lambda Expressions deep big-tree query
I am looking to improve the following query.
We are using EF6 (CodeFirst) and C# Lambda Expressions, and Repository/Unit of Work patterns. Also, we needed to restrict the query in a way that we ...
1
vote
0answers
14 views
EF query for calculating monthly trends
My application has a fairly important query that is used in a lot of places. Unfortunately it takes about 14 seconds to run, so I'd like to find a way of possibly improving it.
The application ...
9
votes
2answers
177 views
Find records with duplicate serial number
I was tasked today with cleaning up data from a SSRS report put together by a DB programmer. The original report was to find duplicate serial number sales within a user-defined period of time. I was ...
2
votes
1answer
37 views
7
votes
1answer
93 views
Fluent Nhibernate, is the mapping correct?
I'm very new to NHibernate and DB. I have three tables which are connected with many to many relationship.
Here are the tables creation Script:
...
2
votes
0answers
40 views
Insert an SQL Server Table rows into a Bigquery table in one bloc
I want to insert all rows of an SQL server Table into a Bigquery Table having the same schema.
The streaming insert row by row is very slow: to insert 1000 rows ...
2
votes
2answers
72 views
5
votes
1answer
458 views
Can I populate this table faster?
I have the following SQL query which takes ~3 seconds to run, maybe ~4. This populates a consultants table with their expected payments for the month.
Unfortunately, the page only loads when this ...
1
vote
1answer
119 views
Stored Procedure calculating employee earnings
I have following stored procedure in a C# win forms application which calculates employee earnings based on attendance as follows.
Note that a shift is 12 hours and employees mark attendance for in ...
1
vote
0answers
51 views
Insert all SQL Server table rows in a Google BigQuery Table
I am coding in Coldfusion. I want to know the best way (best performance and reaction time) to insert all rows of an SQL table into a Google Bigquery Table.
Actually I am looping over a query result ...
1
vote
2answers
57 views
Text file searching using SQL
I have the need to search a directory containing 1000+ files on remote servers where I only have access to SQL Server Management Studio and Explorer. I have written the below SQL statement which does ...
6
votes
1answer
98 views
7
votes
2answers
238 views
VB.Net Database Access Class
I've recently been asked to make some emergency changes to a legacy application written in VB.Net. I come from a C# background so am not overly familiar with this language, though there are enough ...
4
votes
1answer
40 views
SEDE query to find users with exactly one post in a particular tag
I'm doing some research for a meta post on Gardening.SE (where I'm a pro tempore moderator). I'm using the Stack Exchange Data Explorer (SEDE) to find information about first time users who post ...
3
votes
2answers
42 views
Calculating percentage of 3 test forms
Please help me to simplify the script below. It has a lot of variables and a lot of values are getting assigned to them. Can I make it simpler?
It has to calculate the percentage of 3 test forms: ...
10
votes
1answer
144 views
Password Manager UI: Populating DataGridView is Painfully Slow
I'm designing a small account/password manager using C# and SQL Server CE. LINQ to SQL is my ORM of choice.
Here's the data model representing how the SQL Server CE database is set up:
And here's ...
7
votes
2answers
207 views
Creating ADODB Parameters on the fly
I have put together a small wrapper class to simplify creating parameterized ADODB queries with VB6/VBA. At this point I'm keeping things simple, so it's only supporting input parameters and from what ...
2
votes
1answer
44 views
The use of database “sets” rather than “functions”
I've currently got a MSSQL stored procedure that uses multiple SQL functions to achieve a number of returns. Now I've been told about using sets rather than functions as it creates " bad code smell of ...
0
votes
1answer
59 views
How can I modify this query for performance?
This is the stored procedure I'm using to list some places in my website. How can I optimize it to perform well? Which functions in query is taking much time for its execution?
...
6
votes
2answers
87 views
Inefficient query actually more efficient?
I have two queries; one runs significantly faster than the other, but the faster one is the one that I would have bet money on to be less efficient. These are both being executed through a front end ...
10
votes
2answers
194 views
Another way to run reports on a SpiceWorks SQLite database using a linked server in SSMS?
I created a linked server in SSMS so that I could run reports on a SpiceWorks SQLite database. there are a few quirks in the whole system.
These simple queries are becoming some of the most ...
6
votes
1answer
47 views
Aggregating Conditional Sums
I have recently forked/rewritten a SEDE query (here) that aims at figuring out where a site stands in terms of avid users and distribution of reputation scores, compared to a specific target (number ...
5
votes
1answer
238 views
Fastest image upload into SQL database
Hello I am trying to upload an image (screenshot from desktop) to SQL database as fast as possible. I would like to optimize my current procedure in terms of speed:
...
3
votes
1answer
219 views
Populate Drop Down List from SQL Database
I am populating a drop down list from my SQL database. List should be able to be displayed with active only, inactive only or both at the same time.
OfficeRepository.cs:
...
5
votes
2answers
165 views
Do I have any SQL leaks?
This is a Windows service that will run on about 600 machines. It is used to track the job server that a user is connected to (pushed through some kind of load balancer, not my area). I store this ...
0
votes
1answer
24 views
What datatype should I use to complete this task [closed]
I want to be able to allow a user to not put the leading ZERO on any decimal number in a textbox in C# ( like .1 ). I then want to convert this to a decimal or float or any datatype that will ...
3
votes
1answer
43 views
Best way to get two columns from a table
Basically I have taken over a project and found a table that has the following video and video title fields in it (why they didn't create a separate linked table is beyond me):
...
5
votes
3answers
335 views
2
votes
2answers
105 views
Returns Office Details from Database
I am building an Administration web site for the Office details in my database. Right now, I am just trying to display the office details.
...
0
votes
1answer
30 views
4
votes
3answers
83 views
3
votes
2answers
208 views
Using SQL with encryption
This is my first project I am doing in VB.NET, and also my first real programming project. There is sensitive data, so I am utilizing Microsoft's Encryption/Decryption class (...
13
votes
1answer
159 views
Calculating Lost Reputation
A discussion arose not long ago on the 2nd Monitor about how much reputation has been lost due to the reputation caps. There are a number of queries on the SEDE which try to address this:
A Users ...
2
votes
0answers
96 views
Am I getting the right information about installed SQL Server Instances?
I'm building an installer package for our software using Inno Setup. As a part of this, I'm also building a few different DLL's in Delphi XE2 to accommodate for some of the common tasks required by ...
4
votes
1answer
369 views
Code First Entity Framework
Is the following good design for doing entity framework code first? What am I missing for a production system? I haven't included all my code, just a snapshot...
My application, doesn't update the ...
8
votes
2answers
220 views
Should a year and month be stored as separate fields or as a date?
We have a table with calculated data that groups sales by product, year and month, to provide fast querying for statistics.
My colleague argues that the year and month should be two separate fields, ...
-5
votes
1answer
194 views
Can this stored procedure be cleaned up or made even more efficient?
I have this stored procedure that I'd like improved. I have changed the DB name and the procedure name. I am working on SQL Server 2000.
...
7
votes
1answer
102 views
Can you replace a REPLACE statement, or 9?
I would really like something to replace all of these REPLACE Statements.
...
11
votes
3answers
150 views
SEDE Top Sponsors
I wanted to see the site's top sponsors - users that have paid bounties on questions that they didn't own.
I started off with a bounty-related existing query, selected the details into a subquery, ...
8
votes
2answers
56 views
SE Data Explorer Query: Average score for questions and answers, by tag
Being curious to see which tags on this site get the most attention, I developed a Stack Exchange Data Explorer query:
...
1
vote
0answers
165 views
node.js Syslog server recording to ms-sql database
This 43 line program is designed to listen for Syslog messages on port 514 and record the messages to an MS SQL Server database table.
I would appreciate feedback from experienced node.js developers.
...
3
votes
1answer
95 views
Small query - removing XML tags
I have some code that I wrote almost a year ago exactly (1/9/2013) and I would like to know if I wrote it well or if it can be improved. I don't have any fun input or output, as these are not set ...
5
votes
1answer
82 views
SQL Join code check and peer review
I am still fairly green when it comes to SQL joins. The below code works but I want to check that I am doing it the best way before I copy and paste errors into other work in the future.
The idea of ...
3
votes
3answers
138 views
How to make my code faster and easier?
This is my .cs part code where I am calling storeprocedure in LINQ to SQL:
...
2
votes
1answer
128 views
4
votes
3answers
471 views
Speed up application and avoid SQL Timeouts
The code works just fine, but recently performace has taken a hit and it has SQL Timeouts far too often. I have it set up so I can run 50 different version of the application two for each different ...
2
votes
2answers
77 views
Can this be made to run faster?
This is a stored procedure that takes 5-30+ minutes to run depending on the parameter they select.
It also has a nasty side effect of clogging down our SQL Server.
...
3
votes
1answer
103 views
Query too slow - Optimization
I am having an issue with the following query returning results a bit too slow and I suspect I am missing something basic. My initial guess is the 'CASE' statement is taking too long to process its ...
2
votes
2answers
193 views
Injecting data into XML using a dll
This is a template for one of our data injection tokens.
When I first looked at the template, it was worse than it is now. I would like some input on this because I think that it can be cleaned up ...
1
vote
1answer
67 views
My date range generator SQL code - any limitations [closed]
I made some code to generate date ranges in SQL server 2005 and above. I am not sure if there will be any problems in this. Can you find any bugs or limitations in my code ?
...