Questions tagged as 'sql-server'

1
answer

Select does not return broken value

I have the following command: SELECT CAST(450/4 AS DECIMAL(15,2)) Return : 112 where the right one would be 112.5 Why this? NOTE: My SCRIPT is in a procedure, but roughly my problem is in this select     
asked by 17.03.2018 / 21:42
2
answers

How to do a dynamic update to all database tables for a specific column

How can I make a dynamic update to all database tables for a specific column common to all my tables? I'm thinking of using the catalog table to raise the database objects but how can I build the dynamic update for each table that the select...
asked by 12.02.2018 / 05:38
1
answer

How to total the number of records per Category using a VIEW SQL SERVER

Good evening. I'm not finding a way to, using or just calling a VIEW, count how many teachers there are in a given category, whose output should be the category and the quantity. The VIEW I made is as follows: CREATE VIEW VMostraProfessor A...
asked by 01.04.2018 / 02:51
1
answer

What is the difference between Table and Matrix and List in Report View?

So far in my reports I have been using tables and binding my datasets to those. But today I had to use a List to create a card (I'm still trying to understand how it works). When to use Table, Matrix and List and their differences?...
asked by 16.02.2018 / 12:27
1
answer

Difference between days and minutes on Sql Server?

I have two columns of type datetime . I have tried in many ways to get the difference between them, but the number of days always goes incorrect. Example: Data1: 2018-01-17 17:00:00 Data2: 2018-01-18 10:00:00 Resultado obtido: 01 17...
asked by 18.01.2018 / 01:37
2
answers

Convert Varchar to Time in SQL with data longer than 24 hours

I am developing a query in SQL and in case I need to convert a field of hours that is in varchar to time and then make a media of this field (I will use Datediff together). The problem is that CONVERT only does the conversion to data until 23:59...
asked by 05.01.2018 / 03:14
1
answer

Google Charts with SQL Server

Hello, I'm trying to develop some graphics in an ASP.NET MVC 5 web application, regarding the development of the report, quiet, leaving with information fixed. But how can I integrate the graph with the information into a database table? I am usi...
asked by 06.12.2017 / 20:32
1
answer

Is it possible to compare schema between different banks in SQL Server?

I have several different BDs, and I need to compare their Schemas, but doing this manually can go unnoticed. For context I will use database of lesser proportion than I work. Image here . As you can see in the image, I have two databases, th...
asked by 07.12.2017 / 15:03
1
answer

Example Query Count

Someone would have an example of how to do a COUNT in a query, separating the data by EstadoId (as an example). In my case I have several data in my bank, registered by several states, I need a query that counts. How many dat...
asked by 14.12.2017 / 14:55
2
answers

T SQL Merge Two Lines in One

I have an id in common (103307) and would like to join two rows in one. From image 1 and leave as image 2. Is it possible?     
asked by 22.12.2017 / 21:38