Questions tagged as 'sql-server'

1
answer

Concatenate results

How to concatenate all results of a query in SQL Server in order to return all information in a variable? For example, considering a cliente table with the following composition: ╔═══╦════════════╗ ║ ║ Nome ║ ╠═══╬════...
asked by 11.05.2017 / 19:49
1
answer

How to calculate the average using conditions in SQL Server?

The question asks me to show the number of students with averages greater than 7, less than 7 or equal to 7 for some tables that I have here. Showing this way: How to create this column of Description ?     
asked by 01.09.2017 / 16:33
1
answer

Select with date greater than 20 years

How to make a select with request date greater than 20 years ? Select * from Pedidos Where dataPedido > ...     
asked by 02.06.2016 / 22:33
3
answers

SQL Server command to list active transactions

What command in SQL Server to list active transactions at the moment?     
asked by 05.09.2014 / 19:50
2
answers

Which SQL server command to list the user's transaction isolation level

Is there any command I can run on the sql server to list the user's transaction isolation level?     
asked by 05.09.2014 / 19:28
2
answers

How to save data in SQL database - Submit

I'm studying ASP.NET MVC, I'm using Identity to perform user control and etc. So, I created a page, where the user will enter with 4 information: Initial Mileage; Final Mileage; Amount of liters supplied; Amount in R $. So...
asked by 29.11.2016 / 17:12
2
answers

Cut the last character of a C # string [duplicate]

I'm creating an export from SQL to TXT. With this I add the ";" after building each column. But at the end of the last column you are adding the ";" also. How do I get this ";" the end of the last column of all lines? My% of...
asked by 13.04.2016 / 20:51
3
answers

Error in sql server

In sql how do I make a select with space and no spaces? That is, when I have a pass of the genre '123456' and '123456', the last one with space happens that if I do in the query and I have '123456' in the bd I should not show any field that h...
asked by 24.09.2015 / 19:02
1
answer

Insert with two different selects

My insert is not working. insert into t_cmo_oit1980 (id_oit, id_exm_rea) select max(id_oit) + 1 from t_cmo_oit1980, select id_exm_rea from t_cmo_Exame_Realizado where id_exm = 3936 and id_xfc = 39517; go I made a gambi a...
asked by 18.04.2017 / 21:46
2
answers

Compare items from different tables

I have two tables: Pessoa1 Pessoa2 +----+--------+ +----+--------+ | Id | Nome | | Id | Nome | +----+--------+ +----+--------+ | 1 | Maria | | 3 | Maria | | 2 | João...
asked by 08.09.2015 / 22:44