Questions tagged [sql-server]
SQL Server is a relational database management system from Microsoft.
360 questions
173
votes
21
answers
164k
views
Stored Procedures a bad practice at one of worlds largest IT software consulting firms?
I'm working at a project in one of the world's top 3 IT consulting firms, and was told by a DBA that company best practice's state stored procedures are not a "best practice". This is so contrary to ...
144
votes
4
answers
205k
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 ...
42
votes
3
answers
173k
views
Why do we need to put N before strings in Microsoft SQL Server?
I'm learning T-SQL. From the examples I've seen, to insert text in a varchar() cell, I can write just the string to insert, but for nvarchar() cells, every example prefix the strings with the letter N....
39
votes
2
answers
88k
views
JOIN vs. INNER JOIN and FULL OUTER JOIN
I know there is a difference between INNER JOIN and FULL OUTER JOIN, I can see it, but, what is the difference between the two following: JOIN ... ON... and INNER JOIN...ON... and still yet JOIN...ON.....
38
votes
10
answers
52k
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-...
35
votes
6
answers
10k
views
SQL as a means of avoiding "releases"
The system I'm working on started as a small training project within the company I work for but quickly caught interest from management as a means to help to standardize the existing excel-heavy ...
28
votes
2
answers
5k
views
NoSQL within SQL Server
This question is not about the difference between SQL and NoSQL. I am looking for some rationale for something that really does not make sense to me at the moment (maybe because of my lack of ...
22
votes
6
answers
21k
views
When should I use stored procedures?
If I have all my business logic in code and make use of Entity Framework, in what situations (if any) would I be better moving some business logic to a stored procedure, instead of keeping it all in ...
20
votes
2
answers
23k
views
Best method to implement a filtered search
I would like to ask you, your opinion when it comes to implement a filtered search form. Let's imagine the following case:
1 Big table with lots of columns
It might be important to say that this SQL ...
18
votes
7
answers
12k
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 multi-...
15
votes
7
answers
22k
views
When should I use the XML data type in SQL Server?
When should I use the XML data type in Microsoft SQL Server?
14
votes
13
answers
2k
views
Do SQL Devs create SQL queries using SQL Query Designers?
I was just curious if SQL Devs write their code freehand or do they make use of the visual query designer to generate queries? In the majority of the cases, the query designer can create most of non-...
14
votes
2
answers
21k
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 ...
14
votes
5
answers
7k
views
Version Control with SQL Server
I'm starting a new project and using SVN (with Tortoise) as my Version Control System. I was wondering if it was possible to also maintain a SQL Server Database using the same system.
I'd want to ...
13
votes
2
answers
9k
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 ...