Questions tagged as 'sql-server'

1
answer

Calculate distance between two points

in Sql server 2008 it was very simple for me to get the distance between two latitude and longitude points, but now I am occupying Sql server 2005 and the data type geography apparently does not exist ... I do this: DECLARE @source geog...
asked by 27.10.2016 / 17:43
1
answer

Consult last access date Login MS SQL Server

To know the last access of a Login to a database in SQL Server; Perform the following query to obtain dates however the LOGINPROPERTY function does not contain the last login date of Login. SELECT dbp.name AS [nombreUsuarioBD],...
asked by 14.09.2017 / 17:11
1
answer

SqlBulkCopy: Error inserting a DateTime

I have a table with this structure: Create Table dbo.DoesNotMakeSense ( Id Int Not Null Identity (1, 1), Name NVarChar(100), CreationDate DateTime Not Null, Constraint PK_DoesNotMakeSense Primary Key Clustered (Id Asc) ) On [Primary]...
asked by 15.03.2018 / 01:18
3
answers

Obtain the highest value name of a Sql Server query

Good morning. I have a table in Sql Server that contains Id , Nombre , Numero . The names can be repeated but each will have a unique id , I need to get the names that have the number ( Phone ) greater. I attach...
asked by 20.10.2016 / 01:35
1
answer

How to use CASE within WHERE in SQL Server

I have the next part of a procedure on sql Server. FROM Personas as p inner join Estados as e on p.EstadoId=e.Id inner join ListaMarketing_Persona as lmpe on p.Id=lmpe.IdPersona inner join ListaMarketing as lm on lmpe.IdListaMarketing=l...
asked by 28.10.2016 / 17:01
1
answer

I need help with a query

I would like to know if anyone knows how to make the values of an example column add up: id | Fecha | Efectivo | TC | TD | Otro | Total | Obtenido | Resta | Acomulado 1 | 18/07/2016 | 5861 | 0 | 0 | 0 | 5861 | 650 | 5211...
asked by 18.05.2017 / 18:21
1
answer

How to start Microsoft SQL Server 2014 in Windows 10?

How to start Microsoft SQL Server 2014 in Windows 10, since it is installed inside the programs but I can not find the shortcut icon to start it     
asked by 18.11.2016 / 18:56
4
answers

Doubt query sql from php with special characters

I hope you can help me with this doubt, Given the following php code that connects to a sql server database: $sql = "select * from tabla1 where campo1 like '%ñ%'" ; $datos = $this->objeto->listar() ; $numRegistros = sqlsrv_row_num($da...
asked by 14.12.2018 / 18:56
2
answers

SELECT SCOPE_IDENTITY () in Oracle

This PROCEDURE is done in the MSSQL database engine and I need to pass it to ORACLE 11g: CREATE PROCEDURE [dbo].[Insert_User] @Username NVARCHAR(20), @Password NVARCHAR(20), @Email NVARCHAR(30) AS BEGIN SET NOCOUNT ON; IF EXISTS...
asked by 14.11.2018 / 16:14
1
answer

Error in PHP sqlsrv_num_rows ()

I did a multicary program but with mysqli to do tests since they do not let me take information about the work, where you work with sql server and when passing the connection and other statements in the php to sql server I get this error:   ...
asked by 23.08.2016 / 22:01