Questions tagged as 'sql-server'

1
answer

Get result of a query, converting field DateHora to local time zone

I have a table in the sql server database that has the following DataHora field where I have data included in this format: DataHora 2015-04-20 17:43:04.000 This time is not in the format of our time zone. I need to make a query that...
asked by 22.04.2015 / 15:52
2
answers

Retrieve last inserted ID DataSnap / SqlServer [duplicate]

I am using SqlServer with my Delphi XE10 DataSnap application, but when I do an insert I would like the server to return the id that was just inserted in the sqlserver's autoincrement field so that I could display or update the client screen ....
asked by 02.08.2016 / 23:47
4
answers

SQL - Sorting Random Lines

Given the table as an example: I want to sort, between the lines with the same order number, a single line, that is, one of order 1, one of order 2 and one of order 3, randomly. I need a generic solution, which applies to a table with...
asked by 27.07.2017 / 15:53
2
answers

Is an application possible on different computers running CRUD simultaneously?

I am creating an application in C # using the VisualStudio 2015 enterprise next to SQL Server 2016 to save the data, but I am almost finishing the project and still do not know if it will really work! p> I need to install this application on...
asked by 10.11.2016 / 17:44
3
answers

How to route rows to columns?

Already answered by Motta, thanks for your patience. How can I transpose rows to columns in SQLServer, so that something like this: Keepthisformat?     
asked by 29.07.2016 / 22:26
2
answers

View with double SELECT from the same table

I need to mount a VIEW with three fields, but one depends on the other to be calculated (two of them are from the same table in different lines I need to "link" them), how do I add those fields in one place? The select's are as follows: SELECT...
asked by 23.04.2018 / 18:08
1
answer

DELETE in SQL does not execute

I'm trying to delete rows from a SQL Express database, but unfortunately I can not do it. The query is one of those same basic ones, but once I run it I get the ' executing query' message in SQL Server Management Studio indefinitely, but it neve...
asked by 25.09.2017 / 12:18
1
answer

Generate bank script with structure and data

Backup is no way to do, because it depends on the permission of France and so on. So the solution we found here was to try to generate a script that copies not only the structure of the tables, this I already do and did, but type an INSERT loadi...
asked by 27.04.2017 / 23:09
1
answer

SQL History Query

I'm in need of a help with SQL. I need to do a query that returns me a history of the current date up to 7 days back. Could someone please help me?     
asked by 18.09.2014 / 14:26
3
answers

SQL - Calculate percentage in same select

I'm using SQL Server and I have the following query. I need to add the Percentage column. I need to calculate the percentage of Passed over Total but I do not know how to get the values of that same select to enter in the calcula...
asked by 15.03.2018 / 16:33