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).
6
votes
2answers
82 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
34 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 ...
4
votes
0answers
51 views
Manually Populate DataGridView With Accounts/Credentials
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
76 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
40 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
56 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?
...
5
votes
1answer
57 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
125 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
42 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
138 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
81 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
132 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
39 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
321 views
2
votes
2answers
99 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
28 views
4
votes
3answers
76 views
3
votes
2answers
167 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
145 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
64 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
217 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
178 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
130 views
Stored Procedure logically or coding
I have this SP that I'd like improved. I've changed variable names for some reason. I am working on SQL Server 2000.
...
7
votes
1answer
100 views
Can you replace a REPLACE statement, or 9?
I would really like something to replace all of these REPLACE Statements.
...
10
votes
3answers
129 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
49 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
129 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
67 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 ...
4
votes
1answer
71 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
129 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
95 views
4
votes
3answers
305 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
72 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
94 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
153 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
59 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 ?
...
3
votes
2answers
100 views
SQL query clustered with repeated function calls
I have the following SQL query that computes for every date the week it falls in (a week begins on Sunday and ends on Saturday):
...
1
vote
1answer
46 views
Checking Synchronization issue in SQL?
I have the following SQL. I want to make that the SP should work under load. Means it should not have any synchronization issues.
...
1
vote
2answers
104 views
Review single step approach, rather than multiple temp tables
Overall the intent is to consolidate individual sales transactions to total debits/credits summing up the totals by year and month--retaining a running balance from start to end. This code uses ...
2
votes
2answers
44 views
SQL Server 2012: How do I eliminate multiple statements in this code to a more efficient, single statement?
This code completes under a second, however its seems like I've taken the "Mr. Bean" way around getting there.
The goal is to get the average number of orders processed in a single day based on how ...
2
votes
1answer
182 views
DAL Efficiency Help
I am attempting my first try at some c#. So far I love it, (not more than vb tho ;)) however, I am wondering if I can make these classes a bit more efficient.
Please note ###Test is my attempts at ...
4
votes
1answer
261 views
Exporting PDF From Database back to PDF Format
Answer to Exporting PDF's from SQL Server DB and writing a Map to a Text File
this was a Question that I asked in StackOverflow and then answered it when I was finished with the project.
I would ...
2
votes
1answer
113 views
3
votes
3answers
106 views
Code conversion from Access to T-SQL
I have an Access database that I'm converting to SQL Server 2008. One of the queries in the database uses the LAST function. The table has a AutoNumber ID so true order is simple.
...
1
vote
1answer
69 views
Metadata query performance optimization
SQL Server 2008 R2 + .NET 4.5:
I have the following metadata table:
...
1
vote
1answer
140 views
SQL with several joins
Is this query acceptable in terms of performance (I get the correct data) or can it be optimized?
...
1
vote
2answers
49 views
Store Procedure Timing out sometimes?
Can someone please review my this Store Procedure which is timing out?
...
3
votes
0answers
293 views
Compare Oracle Table with Sql Server Table and Update/Insert
Below is the current code wish used to update/insert records from Oracle view to Sql server table using Dapper. there is not field to check last record updated date in the oracle view so I have added ...
1
vote
2answers
304 views
My simple CMS system - security and code obscurity?
I'm working on a simple CMS with the intent of making it as secure as possible (a personal challenge) and the code as clean as possible. I think I've a long way to go so I would appreciate any input, ...