Questions tagged as 'sql-server'

2
answers

Calculate Difference between 2 dates (have time in them)

Hello, I would like to do the following calculated. Initial date = September 11, 2017 at 11:35 Final Date = September 11, 2017 at 12:35 p.m. It should appear to me 01:10. Another example: Initial date = September 11, 2017 at 11:35...
asked by 11.09.2017 / 21:30
2
answers

Make a select to a table that simulates a tree

I have a table that simulates a tree. For example: DECLARE @t TABLE(id int,parentId int,name varchar(max)); insert @t select 1, 0 ,'Category1' insert @t select 2, 0, 'Category2' insert @t select 3, 1, 'Category3' insert...
asked by 25.04.2014 / 18:43
1
answer

Connect to SQL Server on remote server

I need to connect to a SQL Server service on a remote server via SQLConnection, C #. Initially, it was giving the server could not be found, but I solved this by modifying the system32 hosts file, enabling exception on the server firewall and en...
asked by 02.02.2016 / 14:57
3
answers

Calculate the average between 3 dates directly in sqlserver database?

What is the most efficient way to calculate the average of dates in the same column by sqlserver bank? I need to get the date of the last 3 sales of a customer, and return in days to know if that customer buys, for example, every 30 days, 60 in...
asked by 13.08.2015 / 21:33
1
answer

OUTER APPLY does not work as INNER JOIN

I know the OUTER APPLY command is analogous to INNER JOIN, but I'm confused by a situation where this does not happen. The following query extracted from Training Kit 70-461: SELECT c.custid FROM Sales.MyCustomers AS C CROSS APPLY (SELECT...
asked by 11.11.2014 / 21:22
1
answer

How to communicate a local application with a web page opened in the browser?

I have a commercial web application that runs basic operations of a restaurant. In short, a waiter accesses the 'orders' page and requests a new 'product'. These products are categorized by departments, and each department has a printer (thermal...
asked by 29.10.2014 / 17:14
1
answer

How to know the permissions of a role in SQL Server

I'm doing the administration of some databases that were created before my arrival. In most of them a role called dp_role_analista was created, and some users are in that role. How do I know what permissions this role is granting to...
asked by 24.10.2014 / 17:05
1
answer

Comparing Columns in SQL Server

Good afternoon! I wonder if you can help me. I have the following case, we have a client that has the version of our system VERY outdated, with this is missing several columns in SQL tables. I was wondering if there is any way I can see all t...
asked by 12.07.2016 / 17:03
1
answer

Trigger without replicating data - SQL Server 2012

I have a trigger in the FRM_46 table that would be to replicate the data right after the insert or update for the FRM_31 table, however, it is not replicating, I already analyzed and did the tests, but I could not verify where the error is . A...
asked by 13.11.2017 / 19:28
1
answer

Failure of Class Factory Recovery - Console Application

I have a'Console Application 'that connects to SQL . On other machines the application is working normally, but has one that has the Windows Server Enterprise SP2 version that is returning the following exception:    System.Runti...
asked by 14.12.2016 / 17:38