Questions tagged as 'sql-server'

1
answer

Discount amounts in SQL without using a cursor (SQL)

I need to discount or download quantities, I have a query that yields the following result: This result I have to download the balance based on the amount, the column to calculate is descontar ; that is, for an article I have an a...
asked by 11.06.2018 / 16:44
2
answers

Thousands Separator

I have this query SELECT CONVERT(numeric(18,0), CAST((g.SI_Existencia) * gg.SI_Costo_Promedio AS MONEY),1) from SI_Inventario_Teorico_QAD g INNER JOIN SI_Maestro_Ref_QAD gg ON g.SI_Articulo = gg.SI_Num_Articulo WHERE SI_Articulo = 200...
asked by 24.07.2017 / 19:20
1
answer

I can not start Database Engine Tuning Advisor SQL Server 2014

Good morning, whenever I try to log in I get this error, do you know how to fix it? Database Engine Tuning Advisor Failed to open a new connection. ADDITIONAL INFORMATION: In order to perform tuning you have to be a member of sysadmi...
asked by 21.07.2017 / 15:32
2
answers

Send image by mail using SQL SERVER 2012

Good, I would like you to help me, I am sending an email using SQL MAIL SQL SERVER which I get the email generated but now I want to attach an image for that I have a table that has a field that stores a Format image IMAGE . When I try...
asked by 13.04.2017 / 01:20
3
answers

Error using count in a subquery

I have a query where I use 1 subquery to get data from several tables. And as a result, it returns a total of 2947 records. --CONSULTA INICIAL SELECT dniEgre, (SELECT TOP 1 CASE WHEN numeRespu = 1 THEN 'SI' ELSE 'NO' END FROM OCL.tblDet...
asked by 10.02.2017 / 05:24
5
answers

Accumulate query in variable n times during a while

I'm doing a TSQL that brings me the rowcount of certain tables for several databases. And it actually makes me the rowcount , but I can not get the unified result. Now bring this: When you should bring me everything unified...
asked by 10.04.2017 / 22:35
1
answer

Problems with accents Laravel 5 server

I have this: <html lang="es"> <meta charset="utf-8"> also in config/database I have 'charset' => 'utf8' . Still I have problems with the accents. In the local DB tests the problem is working with the DB of...
asked by 19.10.2016 / 21:10
1
answer

What is the correct way to send several datasets in the response using Nodejs and mssql?

Good morning everyone, I have a web application made in Nodejs, in one of the requests I must send two sets of data, which are retrieved independently from a Microsfot SQL Server database. My query is the following Is this the correct way? fun...
asked by 02.02.2017 / 17:12
2
answers

Mens. INSERT SQL error

I have configured a user with INSERT permission for Customers table: GRANT INSERT ON CLIENTS TO userX executing the query: return the following notice: Mens. 102, Level 15, State 1, Line 1 Incorrect syntax near ')'. (1 affecte...
asked by 29.08.2016 / 15:57
2
answers

Convetir nvarchar to datetime

I have a table with many records, when the table was created a type field nvarchar was used to store the date and time (I do not know why datetime was not used) the case is that I need to convert those values into datetime...
asked by 29.07.2016 / 19:09