SQL Server is a relational database management system from Microsoft.

learn more… | top users | synonyms (1)

4
votes
6answers
10k views

Better way of storing key-value pairs in the database?

I have a C#/SQL Server program that sometimes needs to store data. The data could be a response from a web service, a result of a database query, or any number of other things. There's no way of ...
2
votes
4answers
934 views

Write data to SQL Server directly from BizTalk or use external service?

An external source will be sending us XML data that BizTalk will pick up and transform into an internal schema. We need this data to be loaded into a SQL Server database as we're going to expose some ...
1
vote
1answer
35 views

How to model the database tables for calculating on peak and off peak usage data

I am using MS Sql Server and my system contains power usage data in one table as timestamp and values for KW(two columns). This data is collected at 1 hour interval. At the end of the month I need to ...
1
vote
0answers
24 views

Offsetting high usage in a multi-tenant database environment?

I'm writing a research essay over distributed cloud-based systems, and one of the topics that I'm trying to touch on is potential solutions to high database utilization in a single-database ...
2
votes
4answers
86 views

How does a query execution plan affect query execution?

I have read some articles on SQL Server query optimization. The point I get is SQL Server generates a query execution plan for each stored procedure when it's executed for the first time. Those ...
4
votes
1answer
52 views

sql server driver scripts seem awkward, is there a better way to batch sql scripts?

I've been writing 'driver' sql scripts (is that the correct name?) to run multiple sql 'sub' scripts in order, writing errors to log file etc. My Oracle version seems to be more or less ok, but my sql ...
2
votes
0answers
41 views

ODBC 3 Multiple Statements vs Multiple Connections

So right now I have a single thread to handle all the requests for the database. Let's say I have 400 requests per second for logins / logouts / other stuff, and 400 requests per second which are only ...
5
votes
3answers
168 views

Use of booleans in a database

I'm using Visual Studio 2013, .Net 4.5 and SQL Management Studio 2012. I have a table that tracks offices in my database. On the application side there are a some display rules regarding the layout ...
0
votes
1answer
66 views

Why storing a payroll in XML type field would be good or bad

We have a PAYROLL issues by the client to make it dynamic i.e. to make the whole process computerized. It includes: Employees Allowances (Scale wise, which could change yearly or monthly or ...
-4
votes
1answer
64 views

Migrating MYSQL functions and stored procedures to SQL Server

The company i'm working for is selling HRIS management software. It was built using ASP and mysql. But one of our client's demand is for it to be based on MS SQL Server. our team is made up mostly of ...
6
votes
3answers
2k views

Is the Entity Framework appropriate when all you do is insert records in bulk?

My department develops software to migrate databases for our customers from their old CRM software to ours. In this process we could be inserting up do millions of rows, processed one at a time as we ...
0
votes
0answers
34 views

Authenticate to a SQL Server with Active Directory credentials from a UWP app

I've been tasked to design an application and a database to store information our company's electricians have measured on-site. We need to save in our database who exactly did which measurement. ...
7
votes
5answers
9k views

Should I store images in my database or file system in this application? [duplicate]

I'm using ASP.NET MVC 4 and SQL Server 2012. I have no problem going for either of these solutions but I want to know which one would fit better in the particular application I'm creating now. I'm ...
4
votes
2answers
101 views

Why are triggers seen as a last resort to solve multiple paths in cascading deletes?

There is a problem using ON DELETE CASCADE on foreign keys in a SQL database if there are multiple paths from the root foreign key to the leaf. The way around this seems to be to replace the ON DELETE ...
49
votes
2answers
44k views

Creating database connections - Do it once or for each query?

At the moment I create a database connection when my web page is first loaded. I then process the page and run any queries against that conection. Is this the best way to do it or should I be creating ...
2
votes
2answers
70 views

can a single SQL Server connection be shared among tasks executed in parallel

Can a single SQL Server connection be shared among tasks executing in parallel? Each task would dequeue an item from a ParallelQueue, instantiate a SqlClient command, and insert a row into the table. ...
2
votes
1answer
42 views

Questions about developing for azure

We currently have a .Net MVC web app with a SQL server back-end database and two web services that perform periodically some computing tasks in the database. I am thinking of packaging this app for ...
0
votes
1answer
365 views

Best way to get push notifications to server from ms sql database

I partially found solution to my question but I'm not really satisfied with the result. My application consists of ASP.NET MVC + MS SQL Server. The case is as follows: External app saves data ...
4
votes
1answer
76 views

How can we rollback a database synchronized over multiple systems?

On a mobile device, a set of operations has been saved in the local DB with a wrong date (because the system date was set in the future). Then the device regularly doing synchronisation with a server ...
2
votes
3answers
207 views

Updating particular properties of EF objects every X amount of days in MVC

I'm building an MVC ASP.NET IMDb-like website which presents various information about movies to users, relying on 3rd party APIs to (initially) fetch movie info. The IDs representing each movie on ...
9
votes
5answers
7k views

Foreign key restrictions -> yes or no? [closed]

I would like to hear some "real life experience" suggestions if foreign key restrictions are good or bad thing to enforce in DB. I would kindly ask students/beginners to refrain from jumping and ...
0
votes
1answer
120 views

Create an item in two different table with auto-increment C# SQL [closed]

First of all, let me apologize because I know my question will be very confusing since my English is pretty bad. I am working on a project for a company, mainly create a system to take care for ...
0
votes
2answers
1k views

A CLR SQL Server Stored Procedure calling an ASP.NET Web API

We are developing a big system with SQL Server database, ASP.NET Web API 2.2 services and another external services. We need to load more data on a table while we process the current data on it. To ...
3
votes
1answer
184 views

.NET DataSource binding for legacy SQL Server DB with undefined relationships

I'm designing a utility that will load data into a legacy SQL Server Database. I've been trying to mock up a simple WinForms utility with C# using the DataSource connectors (Tried a straight ORM ...
2
votes
1answer
46 views

Adding a complex check constraint

I am working on a table that has a compound primary key that includes a date. Faculty PersonId StartDate EndDate Title .... ------------------------------------------------- I will add a ...
3
votes
2answers
168 views

One wide table or multiple themed tables?

I'm trying to design a database for a simple text based game where the player characters have a large number of statistics that I want to track. Currently I have a few groups of related statistics, ...
0
votes
1answer
69 views

SQL Table With A Call To Action?

This is all done in Microsoft Access 2007 and SQL Server. We are creating a way for our users to quickly make notes on a customer. These quick-notes will contain tags that will prompt the user for ...
3
votes
2answers
79 views

Stored Procedure performance

I'm working on upgrading an application written by a former developer at my work and I've been converting all the SQL queries in the code into Stored Procedures. I'm doing this with the idea that it ...
1
vote
1answer
52 views

MS SQL Server Cell level Encryption options

Recently, i got the task of doing some research into the data encryption at the cell level. I tried using the Symmetric key (by passphrase) & second option i took is Symmetric key (by ...
2
votes
3answers
366 views

What strategy to follow while matching sql server datatypes in C# Code First approach while using Entity Framework

While matching SQL Server datatypes with C# Code First Approach in Entity Framework, what are specific points that we should keep in mind so that our C# datatype should match exactly our SQL Server ...
1
vote
1answer
281 views

Multi-tenant database design

My boss is currently working on a database design for a multi-tenant capable ERP/CRM system, which will have a Sql Server backend. Some key points of the design: A server instance will host a ...
2
votes
1answer
366 views

How to backup data and images in this project? [closed]

I have MS C# and MS SQL 2008 database project. It can capture employees' records with pictures of more than 1000 records. Presently, I'm able to capture say 150 records on PC1 using my installed C# ...
8
votes
4answers
32k views

Best practice to query data from MS SQL Server in C Sharp?

What is the best way to query data from a MS SQL Server in C Sharp? I know that it is not good practice to have an SQL query in the code. Is the best way to create a stored procedure and call it ...
0
votes
3answers
321 views

Why does databases use text? [closed]

This might be a little dumb question but why do we save text in the db instead of something smaller? Couldn't there be some other way to store data in the db like in a compressed form, and then have ...
0
votes
1answer
146 views

Optional text qualifier in CSV file as input to SSIS package

I receive several CSV files each quarter to process through an SSIS package, and the formatting is inconsistent. This quarter, I encountered what I term optional text qualifiers--text qualifer of ...
1
vote
1answer
15 views

Syncing graph of data to other database (like data)

Switching to new system and need to keep old data going for some time. So, we need to update old database with data when new system being updated. It's a transactional data, like orders/shipments. ...
-1
votes
1answer
349 views

Connect to MS SQL database from client side [closed]

I had a software that was written on VB .Net and used Crystal Report to print out reports. It was a pain to maintain in my case, so I want to move the report to webpage version. I did some ...
1
vote
1answer
111 views

Is it a good practice to write distinct queries in a single stored procedure based on input parameters

I am going through the stored procedures written throughout our project and see that multiple distinct queries are written inside a single stored procedure and are called by passing different values ...
1
vote
2answers
174 views

Caching query results vs Querying each time (finding a middle ground)

This is kind of an expansion on a previously asked question Some background info: Querying Over 5,000 items from SQL database that eventually get sorted into a list depending on who the user ...
1
vote
3answers
205 views

Using auto-increment clustered key and guid primary key together

My boss is the db administrator in a new software project and he came up with that design where every table will have both a auto-increment clustered key and a guid primary key (or possibly composite ...
3
votes
4answers
2k views

Database is performing slow, even all the tables are having normalization

An interviewer asked me this question: Tables are created with appropriate normalization rules, However the database is performing slow. [Ie.: The select, insert statements are taking time to do ...
1
vote
1answer
104 views

Knowing when a SQL table is done updating before Querying

I am using a self hosted windows service WEB API as the layer between my Windows 8 App and a SQL Server Database because Windows 8 apps can't directly connect to SQL server like win forms or pretty ...
1
vote
1answer
115 views

SQL - Designing a Threshold value table

I need to design an SQL table to be used for "threshold" or special values, which in general would have the following properties: - key - value - comparer (less than and greater than as a start, ...
4
votes
2answers
1k views

How deeply programmer should know about internals of database engine? [closed]

I am learning SQL Server 2012 along with C#. In the past, I took database class in college, and have good grasp on SQL language and can write queries. However, looking at SQL Server documentation (or ...
2
votes
2answers
262 views

Will using multiple recordsets in one database request be more efficient?

I am redeveloping an old ecommerce website which is currently written in C# ASP.NET 2.0. Because this is a reasonably high volume website and has suffered performance issues I want to develop in the ...
1
vote
2answers
741 views

.NET Why should I use DAL over direct database access

Yesterday on one of SO chats I've been told I should never connect to database directly from the application and rather use DAL. I've been told that: 1. Using something in the middle should improve ...
12
votes
7answers
1k views

500 databases or 1 database with 500 tables or just 1 table with all the records? [duplicate]

I currently have an application that is used by a single end customer. For ease of discussion assume the application only needs a single database table for all records. I now need to support ...
2
votes
2answers
268 views

Implementing “Trending Items” using linear regression in SQL Server

I'm building an MVC .NET website where people can rate and review movies (similar to IMDb). I'm using SQL Server for the back-end. I'll be implementing a feature where the homepage displays trending ...
8
votes
2answers
10k views

Can SQL Server and Mongo be used together?

We have a large news-oriented site that has high web traffic. The architecture is your often seen DB - Repo Layer - Services Layer - Asp.Net MVC. The problem that we've been seeing is around read ...
7
votes
3answers
710 views

Enterprise software: Where should the code go? [duplicate]

I recently went for an interview with a software company that claims to write enterprise level software. During the interview, the interviewer remarked that its better to use the database simply to ...