Questions tagged as 'sql-server'

1
answer

Is it possible to do an UPDATE with data from another table?

I know that it is possible to execute a INSERT with data from another table: INSERT INTO Tabela (Col01, Col02, Col03) SELECT Col01, Col02, Col03 FROM Outra_tabela WHERE Condicao = 'qualquer coisa' But I would like to do t...
asked by 08.12.2016 / 22:03
7
answers

Best data type to work with money?

I'm developing a project for commercial automation, using PAF-ECF and everything else. What would be the best data type to work with SQL Server and C # for money issues? Especially in relation to rounding and truncations. I imagine the bes...
asked by 13.02.2014 / 23:33
5
answers

MySQL Limit Equivalent in SQL Server

Does anyone know how to relate the differences between MySQL and SQL Server, including using LIMIT n,n ? Or if they have a link that lists the differences would be cool. Example SELECT * FROM tabela LIMIT 50, 100 What would be the...
asked by 26.03.2014 / 17:01
1
answer

What is the difference between ISNULL and COALESCE in a search?

I'm not sure how to use ISNULL and COALESCE . Currently when I create a query in SQL Server, I have doubts about ISNULL and COALESCE , I did some research and I was able to discover the difference of both. Only tha...
asked by 25.03.2015 / 15:56
4
answers

Why are NULL values not selected?

When doing a select, I noticed that data with NULL field is not retrieved using the <> operator. Why does this happen? NULL is equal to char N ? Notice that in the query below only the first row is r...
asked by 17.09.2015 / 19:55
1
answer

How to document codes in SQL?

When I write code in R, the correct way to document is in the code itself, in the form of comments started with a special mark #' . #' Add together two numbers. #' #' @param x A number. #' @param y A number. #' @return The sum of \code{...
asked by 19.12.2016 / 13:10
3
answers

Why "= NULL" does not work? [duplicate]

In%%, when fetching all records with a given field with value SQL Server , if I do the following no records are returned: SELECT * FROM clientes cli WHERE cli.cpf = NULL However, if you use the following syntax: SELECT * FROM...
asked by 17.05.2017 / 16:25
3
answers

What is ROW_NUMBER?

What is ROW_NUMBER used in sql server ? How and where should we use it? Do you have a simple use example?     
asked by 29.08.2017 / 18:53
2
answers

When to use SET and SELECT?

I know that as in practically all issues related to "one or the other" there should be situations where it is best to use SET or SELECT , in a procedure (for example). At work we have the habit of always using SELECT , ev...
asked by 29.09.2017 / 19:32
1
answer

How to use a specific index in a query in SQL Server?

I have a non-normalized table in SQL Server installed on my PC which is fed monthly by Integration Services (SSIS) from a report into an Excel worksheet. That is, I am keeping track of a certain report. This table has several key fields. Depe...
asked by 17.12.2013 / 13:24