Questions tagged as 'sql-server'

1
answer

Sales ranking report

I use this SQL command to do a sales ranking SQL: SELECT VENDEDOR,SUM(TOTAL) AS GERAL FROM VENDAS GROUP BY VENDEDOR ORDER BY SUM(TOTAL) DESC; Result: VENDEDOR | VALOR FULANO1 | 1000 FULANO2 | 800 FULANO3 | 700 FULANO4 | 100 I wo...
asked by 08.04.2015 / 20:09
1
answer

How to insert values into a relational table when inserting a row and get this ID?

I am building a program to insert excel file data into a database. My database has this structure: Tables (and fields): Schedule ( PK ), StartTime, EndTime, DayWeek, RoomId ( FK ), ClassId < FK ), TeacherId ( FK )) Rooms (RoomId ( PK...
asked by 29.03.2015 / 04:20
1
answer

Query doubt (grouping)

I have a table named ALUNO_LEGADO in the SQL Server DBMS as below: Assuming there are only 5 subjects ( 1,2,3,4,5 ) and the concepts are A = Aprovado and R = Reprovado , what condition do I use to search only t...
asked by 10.10.2015 / 20:09
2
answers

C # MVC5 - Insert Fields with 4 Decimal Digits

I'm doing an insert into the database (SQL Server 2008) of a field set to 'decimal (10,4)', of which I try to insert / edit, through my C # application MVC5, a field of my model type 'decimal'. The fact is that when I debug the code, even bef...
asked by 09.07.2015 / 22:08
3
answers

PHP and SQLServer Connection

I'm trying to make a connection to SQLServer and PHP But the page returns me the following error:   Warning: mssql_connect () [function.mssql-connect]: Unable to connect to server: 192.168.2.7 \ SRVDOC \ DOCSYSTEMSCAN in C: \ wamp \ www \ con...
asked by 22.06.2014 / 01:46
1
answer

User Defined Table Types between different databases

I created a User Defined Table Type in a DB1 database. If I try to declare a variable of this type in a BD2 database procedure it gives me the following error:    The type name 'BLABLA' contains more than the maximum number of prefixes...
asked by 25.08.2014 / 14:02
0
answers

Error for importing JDBC from sqlServer with Maven

In my web java application, I needed to add a connection to a sql server database, so I put it as maven dependency as described below: <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>...
asked by 06.08.2018 / 17:00
1
answer

Change varchar field yyyy-mm-dd hh: mm: ss to date dd / mm / yyyy in SQL Server

Dear, I'm extracting data from a satisfaction survey log, and I'm trying to create a column with the date format, so I can group the days and months into an Excel PivotTable. For more details, follow the field varchar with the date:...
asked by 29.08.2018 / 13:04
1
answer

sqlsrv_num_rows does not work

I have a site that is being done with PHP + SQL SERVER, and to log in I need the client code, and it puts there only that always says it is incorrect, being correct. It seems that sqlsrv_num_rows is not working, because I put the corre...
asked by 08.06.2018 / 13:28