Questions tagged [sql-server]

SQL Server is a relational database management system from Microsoft.

SQL Server

Microsoft's SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality. It originated from the Sybase SQL Server 4.x codebase and Transact-SQL dialect (T-SQL), but it has forked significantly since then.

SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality.

352 questions
173
votes
21 answers

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 everything I've learned. Stored procedures give…
user22453
  • 477
  • 3
  • 6
  • 8
140
votes
4 answers

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 a database connection each time I run a…
webnoob
  • 2,139
  • 3
  • 19
  • 20
40
votes
2 answers

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... vs FULL OUTER JOIN...ON... Reason being is I…
MCP_infiltrator
  • 745
  • 2
  • 6
  • 12
40
votes
3 answers

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. I tried the following query on a table which…
qinking126
  • 541
  • 1
  • 5
  • 6
37
votes
10 answers

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-guids/ I realise that these GUIDs are used to…
w0051977
  • 7,031
  • 6
  • 59
  • 87
35
votes
6 answers

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 workflows. I'm one of the lead developers on the…
ElderFuthark
  • 467
  • 2
  • 5
28
votes
2 answers

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 understanding or appreciation). We have started a new…
Andy Clark
  • 415
  • 6
  • 8
22
votes
6 answers

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 code? To be clear, I mean in conjunction with the…
Amy Barrett
  • 473
  • 2
  • 5
  • 12
19
votes
2 answers

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 Server You need to implement a form to search…
j0N45
  • 341
  • 1
  • 2
  • 5
18
votes
7 answers

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

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-tenancy and so in the future I will have about 500…
Phil Wright
  • 409
  • 1
  • 3
  • 6
15
votes
7 answers

When should I use the XML data type in SQL Server?

When should I use the XML data type in Microsoft SQL Server?
FarligOpptreden
  • 261
  • 1
  • 2
  • 5
14
votes
13 answers

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-complex queries, no? (I'm a WinForms dev just now…
James
  • 203
  • 1
  • 5
14
votes
5 answers

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 version my tables/functions/views/procs/triggers/etc.…
user44797
14
votes
2 answers

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 performance. It turns out that all this DDD domain…
John
  • 479
  • 2
  • 4
  • 9
12
votes
2 answers

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 to know all of the database connection strings for…
Benjewman
  • 313
  • 2
  • 9
1
2 3
23 24