All Questions
683
questions
-1
votes
1
answer
85
views
INSERT INTO auto increment identity for a one-column table [duplicate]
I have a table Person.
Id, Name, Phone
-------------------
1, NULL, 123456789
This Person.Id is an auto increment identity. After a while, I found Name is useless for the current business and it ...
-4
votes
1
answer
116
views
Phone and email in one column, is there any disadvantage?
This is my Contact table
Id, PhoneOrEmail, DataType
---------------------------
10, 123456789 , 1(phone)
11, [email protected] , 2(email)
To avoid table explosion (too many tables), I'd like to store ...
0
votes
2
answers
98
views
At what layer i should determine if something does not exist [closed]
Suppose I have a Comment entity defined as follows:
public class comment
{
public int Id { get; set; }
public int TopicId { get; set; }
public string Text { get; set; }
...
0
votes
2
answers
65
views
How to check only the last time a value is added to the table in SQL Server
I am currently writing a code for a database that simulates the work of a library.
I have a table that describes the borrowing of books. The table has
entries like this:
user_id
book_name
...
0
votes
0
answers
108
views
How to normalize the null column? [duplicate]
I have object
{
totalPrice : 20,
totalCost : 15,
invoice:{ [ { price : 10, name : "microphone" }, { price : 10, name : "speaker" } ] },
order: { [ { price : 10, ...
-1
votes
1
answer
72
views
Integrate old / new data sources in SQL Server DB
Are there any best practices someone can share with me about integrating old and new data sources together on a SQL server?
To clarify, my company receives information from vendor A but we are ...
-1
votes
2
answers
225
views
Does prefixing system or general table names with "Sys" fine in Sql Server?
In Sql Server there's sys Schema. sys.Columns, sys.Tables.
I have a general tables which I need to rename to SysUsers, SysRoles, etc.
Is it fine to do that? I will not use Sys schema. I just will ...
0
votes
1
answer
76
views
How to enforce a 1:M relation in a M:M?
I am designing a database schema.
There are presently 2 tables:
Task (TaskID, TaskName)
Description (DescriptionID, Description)
A task can have multiple descriptions, but the same description ...
0
votes
1
answer
1k
views
Effects of adding columns to INCLUDE in an index
I have an index on EmpId. I wanted to include a few columns to the index.
Create Index IX_01_EmpId On empTable(EmpId) INCLUDE (name, dept, salary, joining_dt).
I know that included columns speed up ...
-1
votes
1
answer
56
views
Finding the count from 2 different tables
I have 3 tables - 2 Input and 1 Lookup
Tab1
Id
4
4
5
6
8
2
Tab2
ID
4
4
1
1
2
6
tab3
ID Name
1 One
2 two
3 three
4 four
5 five
6 six
7 seven
8 eight
I need a query that ...
0
votes
1
answer
107
views
SQL Server - multiuser authorization on single Database
Our SQL server has 2 SQL users as follows:
User A, which contain the following rules
DENY VIEW ANY DATABASE
having the authorization of only two databases A1 and A2 out of 10 databases
User B, ...
-1
votes
1
answer
42
views
Data Architecture Question - Storing Daily Snapshot of Employee Master Data
I'm trying to store daily snapshot of Employee data for FTE analysis project - analytics on how many FTE in various positions any given day.
I can call a REST API, which will give me data for all the ...
0
votes
0
answers
60
views
How to auto count Current Employees for department in CREATE TABLE statement?
The employee has a default department that company workers will associate with, also the system will track which department the worker is currently working in.
How to count CurrentEmployeesCount?
...
0
votes
1
answer
540
views
How to decompose the tables for optimal querying
Suppose I have three tables Actor, Movie, Producer with following attributes
Actor(Id,ActorName,Bio)
Producer(Id,ProducerName,Bio)
Movie(Id,Name,Description,ActorName,ProducerName)
There can be many ...
0
votes
1
answer
310
views
PWAIT_ALL_COMPONENTS_INITIALIZED and WAIT_XTP_HOST_WAIT high average ms per wait
I ran exec sp_BlitzFirst @SinceStartup = 1, @OutputType = 'Top10' and got the below output. Everything seems good except I dont know what PWAIT_ALL_COMPONENTS_INITIALIZED or WAIT_XTP_HOST_WAIT is and ...