Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [sql-server]

SQL Server is a relational database management system from Microsoft.

-2
votes
0answers
37 views

How Nosql on SQL Server performance for million data?

I am trying to develop software with a Sql server database. I am using it as a document store for JSON documents. The queries use the JSON_VALUE built-in function to extract data from the document. I ...
0
votes
1answer
57 views

Benefits of placing error logs in a database by itself

I am working on a project where logs of all kinds (e.g. errors, warnings, etc.) are stored in a database table, in the same transactional database used for the other business purposes. It is a MSSQL ...
2
votes
1answer
29 views

Indexes on a SQL Server fact table

If I have a SQL Server fact table with four dimensions (OrderDate, Customer, Product, Region), my understanding is that it's best to create a non-clustered index per foreign key (dim key column in the ...
0
votes
0answers
26 views

Source control Sql Server multiple shards with minimal differences

One of the database systems I work with (I'll call it database A) was essentially sharded into 3 schema-identical copies. This was easy to source control, and when a change was made to any of the ...
0
votes
0answers
12 views

Propagating MDS Data - SQL Service Broker or SignalR?

Hopefully, this is the right forum for this type of question.. We have a set of common entities which are 'shared' throughout the company - much like Master Data Services (MDS) data. Everyone has ...
0
votes
3answers
100 views

How can I interpret a SQL Check Constraint inside my C# .NET class libary?

I was given a more or less complex task. The goal is to interpret a SQL Check Constraint inside my C# .NET libary. In our case we have a simple UI that displays what is inside the database. We do not ...
-3
votes
1answer
34 views

Defer insert data into a database

I need to insert some records into a database at a time when it normally it's not being used, what are some approaches I can take? I have considered using the SQL Server Agent to run some stored ...
3
votes
1answer
111 views

Regulations about collecting data from software running at clients hardware (apps 'phoning home') [closed]

We develop an application which has now been installed on a few thousand customers sites. Unfortunately, we have no customer data collection built into the software. This is something we want to ...
3
votes
1answer
64 views

Using Active Directory ObjectSid as Primary Key in SQL Server for Data Access via ASP.NET MVC

I am designing an Intranet employee reward web app using ASP.NET MVC C#/MS SQL Server. This will only be accessed from within the network. Employees and managers will be able to give a reward to ...
1
vote
2answers
142 views

Single database call and iterate in memory vs multiple database calls and multiple smaller iterations

I'm designing a new application that is very basic however I expect it to grow and don't want to have to refactor down the line. My challenge is that in one method, I either need to retrieve thousands ...
2
votes
3answers
483 views

Logical separation of database content

Background I have an application which stores a lot of entities in a classical relational database (Microsoft SQL Server) and I use an ORM (Entity Framework) to query data from it. This database has ...
0
votes
3answers
230 views

C# algorithm that can read special logical expressions

I have a need to implement a special logical operations algorithm. The task has been assigned to store the logical conditions in a database and have C# code read the information and select the ...
-1
votes
2answers
160 views

SQL Coding Naming convention: Variable same name as Columns

Is there a coding naming convention principal for SQL variables? Can variables be named the same as column names, I heard in different companies, this may cause confusion. However in C# below, its a ...
4
votes
2answers
309 views

Need to email customers once per year - best way to record this

We need to email our customers once per year (yes it's opt-in etc). As I see it we have 2 ways to record the fact we contacted them (so we know not to contact them for another year). A log, or a '...
-3
votes
2answers
1k views

What is the difference between end of support and end of life?

SQL Server 2008 reaches its "end of support" date next year: 7/9/2019 But it reaches end of life much later: 7/31/2023 link What is the difference? Is this terminology common to Microsoft, or to ...
0
votes
1answer
77 views

Database design: where to store a “current” or “selected” flag in a parent-child hierarchy [duplicate]

Sorry, maybe it's a well known design principle, but because I don't know a name for this kind of relation, I was not able to find any existing answer. So, let's say we have a parent which may have ...
1
vote
1answer
245 views

Strategies for managing legacy data for a medium sized enterprise

I work for a mid market manufacturing company with around 1700 internal employees and about 7000 external users (employees of our customers). We grew through acquisition which means we have many ...
-1
votes
2answers
474 views

Nullable foreign keys and creating join tables

I'm not that experienced in sql modeling and i'm looking for input on this because it's important for me to get it right. I use mssql and entityframework core in an asp.net core web app. The app ...
1
vote
1answer
63 views

Table design with Microsoft SQL Server

I was hoping to get some advice from you folks on my table design methodologies (specifically in MS SQL if that matters). Let me start by showing a couple of example tables that I might have in a ...
-2
votes
1answer
85 views

Correct terminology for a table which provides “dynamic columns”

A common pattern in database design is to append dynamic columns to a table with a design like so: create table MasterTable ( Id int not null primary key , Name nvarchar(64) not null unique ...
3
votes
2answers
278 views

Is using spacing effectively equivalent to the long method code smell?

There's a common code smell involving long methods with the most common answer being that methods should be really small, less than 50 lines per say (or 20). I understand why this is because it ...
1
vote
1answer
92 views

Creating a web portal to access multiple databases (security and best practice?)

I am looking to create a website. There will be a portal, from which the user (and thier associated users) can create/access one or more databases. There will be many different databases in the ...
0
votes
1answer
47 views

Store nested object from .net to a SQL Server

I build an object in vb.net where I store data from JSON file that I get from a RESTApi. The object is nested and looks like this: Public Class FullData Public Property userID As ULong Public ...
0
votes
2answers
205 views

How to update MSSQL DB schema during deployment in HA enviroment without any downtime

I spend a lot of time trying to figure out what MSSQL provide to update MSSQL schema without loosing the sync, but I find it hard to find a solution. Does any of you faced the some problem ? I found ...
8
votes
2answers
2k views

How to safely run database migrations with multiple app instances?

We have an application that has a mix of both fast (< 1 second) and slow database migrations (> 30 seconds). Right now, we're running database migrations as a part of CI, but then our CI tool has ...
1
vote
0answers
61 views

Disaster Recovery Database Switchover options

Some info on the current setup: We're currently using database replication - transactional replication, to be specific - between 2 servers. For sake of this post, we are replicating from a PRIMARY to ...
2
votes
0answers
207 views

Replication between SQL server and Couchbase Lite

We have a main MS Sql server. This is the main data source that delivers and receives data to and from backend administration and (in development) mobile software. We need to make a connection to ...
0
votes
1answer
93 views

Querying Active Directory from SQL Server

We always used C# to query Active Directory, recently we need to add a patch to some code and it would be easier for us to query Active Directory straight from SQL DB as then we won't need to make ...
3
votes
3answers
151 views

SRP processing file line-by-line

I'm writing a class that read lines from a file, process them, store them in an accumulator and when it reaches a threshold bulk inserts in a SqlServer database. Like this: class ...
1
vote
0answers
972 views

Entity Framework naming conventions for the same table name across multiple schemas

The DbContext of my application's Entity Framework setup (which I will refer to as ApplicationContext, the name of our derived type) contains classes for all of the tables in our SQL Server database, ...
-1
votes
1answer
81 views

.NET Sort concurrent requests into a queue

I asked this at Stack Overflow but seeing as it wasn't so much a programming issue as a theory issue it wasn't well received. I have a program that issues a unique ascending code every time one is ...
31
votes
10answers
18k views

Using a GUID as a Primary Key

I generally use auto increment IDs as Primary Keys in databases. I am trying to learn the benefits of using GUIDs. I have read this article: https://betterexplained.com/articles/the-quick-guide-to-...
1
vote
3answers
233 views

Row level access in a monolith application and in microservices based application

I would like to get an advice on how to tackle such a problem. Currently we're using SQL Server as our database and the whole application is a fat, juicy monolith which we'd like to break down. There'...
0
votes
1answer
203 views

Round robin, balanced home/away, multiple locations with multi-team options

This is my first question on this forum, have tried to exhaust every possible research option I could think of or find. Actually this is the first time I've posted for help with this anywhere, so ...
2
votes
4answers
483 views

How to automate certains tasks in a web application?

I'm working on my final project for a course named Web Applications in ASP.NET. Basically, it's a web application for shopkeepers to manage their clients' money accounts in their stores. In order to ...
1
vote
2answers
967 views

Encrypt data in code or stored procedures?

I'm working on a Web App where the data is quite sensitive and is required to be encrypted before it is stored in the database. Now there are two ways through which I can achieve this: Encrypt data ...
1
vote
1answer
225 views

MS SSIS as good approach for two-way data synchronization

We have SQL Server databases in every retail store, and one database in main office. We want to collect data from all stores and load the main DB (for BI), but we also want to sync data from main DB ...
3
votes
4answers
504 views

Handling data latency when working with a read-only database?

Our Web API app is C#/MS-SQL and our DBAs want us to use two databases, one Writable, one Read-only. The database for writes will replicate to the read-only copy. This question may apply to other ...
1
vote
1answer
598 views

Event sourcing vs SQL Server Temporal Tables

With the creation of Temporal Tables in SQL Server 2016 (or similar technologies in other databases), would you consider Event Sourcing unnecessary? Both are audit techniques, very similar (one deals ...
2
votes
3answers
58 views

Verbose specification of exact Table or Implied

Consider the following two queries in SQL (Transact SQL): UPDATE [database_name].[dbo].[table_name] SET [database_name].[dbo].[table_name].[field_name] = @value WHERE [database_name].[dbo].[...
1
vote
1answer
3k views

Data Encryption in Data Layer with ASP.NET Core Entity Framework

I am currently designing a web application where the data needs to be stored encrypted. Planned technologies used: ASP.NET Core API ASP.NET Core Entity Framework MS SQL Server 2016 any Web Frontend ...
0
votes
1answer
3k views

Entity framework vs pure ado .net in calling stored procedure in an enterprise project

There is an enterprise project, which all the business implemented in databases and in the stored procedures, and web API is just like a light wrapper which get the request and deliver it to proper ...
3
votes
1answer
890 views

What is the best way to structure my web permissions tables?

I want to set up basic "permissions" for a website. It has a basic "roles" system where users are part of certain groups and get all the permissions allowed to that group. However, I need more than ...
4
votes
0answers
2k views

ElasticSearch vs SQL Server full text index for small datasets?

I've got a relatively high-traffic public-facing product-based website backed by SQL Server as the point of authority. It has some search capability on some of the columns of the Items table (year, ...
2
votes
8answers
3k views

How to make ability to order records in DB?

I need to make ability to reorder records, storing in DB (I use MS SQL, but seems it's no matter). I see possible 2 solutions: Add Order column. Then if we want to reorder 2 records, we need to ...
6
votes
4answers
778 views

Database structure to save 'tables'

I'm working on a project in which a user can create tables to save some data. What would be the best way to implememt this? Right now I'm doing it like this: Table 'tables' - contains stuff the user ...
3
votes
2answers
129 views

Pricing File Creator

Problem We have a number of different customers getting a number of different price files, each customer can then also have different styles of pricing files for example customers can have just two ...
4
votes
1answer
85 views

Need help with system migration plan

I need to rewrite old ASP.NET web forms VB application to new ASP.net mvc in c#. Problem is that most of the old application logic for data inserting retrieval is written in stored procedures, which ...
3
votes
2answers
66 views

Application with user-defined column-level permissions

I am redesigning an existing SQL Server-backed web application. This application is used for tracking subjects (names, addresses, phone numbers, etc...) and related data (assessment information, ...
3
votes
2answers
2k views

What is the preferred way to get data from database for data that frequently used?

Says, I have employee table, with {id, name, unit, etc..} what is the preferred ways to get this data if I frequently use this data, my first option is to query it from database when needed, something ...