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

Questions tagged [sql-server]

SQL Server is a relational database management system from Microsoft.

-3
votes
1answer
32 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
108 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
0answers
40 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
122 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
262 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
215 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
155 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
305 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
764 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
64 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
244 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
344 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
62 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
78 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
273 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
81 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
45 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
193 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 ...
7
votes
2answers
1k 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
58 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
177 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
88 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
149 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
846 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
15k 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
185 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
188 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
415 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
888 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
204 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
442 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
521 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
2k 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
792 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
754 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
127 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
82 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
65 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
1k 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 ...
0
votes
3answers
869 views

Querying data with SQL vs. C# [duplicate]

I'm trying to decide who is right in the following argument: How to effectively process data in MSSQL? Which one is faster? Opinion 1: Data requests (this is especially true for complex ones) should ...
1
vote
1answer
96 views

Sql server to PHP (api vs library)

Our agency is currently using and maintaining the CMS we have developed in .net MVC on SQL server. Since the cms is highly optimized and uses various cache tables to run very fast even with thousand ...
0
votes
1answer
635 views

ASP.NET MVC App connection with SQL-Server on which protocol? [closed]

I have a ASP.NET MVC application and connects to the SQL Server running on a different server. I wish to know which is the default protocol used between the MVC app and SQL-server to exchange the data....
3
votes
0answers
176 views

How to set up a sql database to cater for user records, group records and default records?

Outline I have an application that loads data from a database. I'm not talking about client data here though, I'm talking about application configuration. The database will therefore come with some ...
0
votes
1answer
60 views

What is the best way to store author of change and display changes of every column in temporal table in SQL Server?

I would like to store history of changes in table and also remember author of change. I created temporal table. This table contains ChangeAuthorId column which value I update every time when table is ...
2
votes
2answers
104 views

Building a Model using MVC 5 optimally that is Database friendly?

I'm using MVC 5 Core on my Web API and I wanted to know what is the most optimal way of storing an Array into a database? Should I store Arrays, does it matter, or should I parse the array and input ...