Questions tagged as 'sql-server'

2
answers

Deleting Duplicate Values in SQL

I have a problem with a query, because there is only one field that differs from one data to the other. I have tried to use group by , order by , having , I have researched in several forums, I have tried everything and I can n...
asked by 20.09.2017 / 16:13
0
answers

How to do a SELECT with CONVERT or CAST in the WHERE clause using sequelize

I need to make the select below using sequelize. SELECT COUNT(*) AS 'Count' FROM Table WHERE CAST(DatetimeField AS DATE) = CAST(GETDATE() AS DATE) So far I've been able to do this using between but this is not the best way to do this...
asked by 22.09.2017 / 21:08
0
answers

Error doing Linked Server with Firebird Bank

I installed Firebird 2.5 and the appropriate ODBC driver on my computer. I tested the connection and it worked, I called DB DB . But when I create the linked server in SQL Management Studio 2008, it gives me the following error, number 7303:...
asked by 17.10.2017 / 15:49
1
answer

Separate values from a multi select into columns

On my system, I have a multi select as they may come in the image below: AndIdoanexportofthisvariableinthisselectSELECTREPLACE(p.Argautor,',',';')ASArgautorFROMjud_ProcessospLEFTJOINjud_ComarcascONp.ComarcaId=c.ComarcaIdLEFTJOINjud_Municipio...
asked by 26.09.2017 / 14:58
1
answer

How to check, in the middle of a select, relationship existence of a record of a table A with records of other tables

I notice that I am a beginner and may be asked something simple, but come on. I have two tables, PROMOTIONAL and PRODUCTS, where a PRODUCT can relate to zero or many PROMOTIONAL records. What I need is, when I make a select in product, I also b...
asked by 29.09.2017 / 14:55
1
answer

Graphical query handling via javascript [closed]

Good afternoon, I have a query on my system where it generates a graph. Inthefirstcaptionofthegraphitislikeundefined,Iwastryingtoredomyqueryonlyitwasnotcomingwiththesamevalues.Iwantedtoremovetheundefinedoptionthatisinmycaptionleaveonlythelastth...
asked by 18.09.2017 / 20:45
0
answers

SQL Server Error When converting VarChar to Integer type [closed]

FOLLOW THE ERROR Msg 245, Level 16, State 1, Line 2 Conversion failed when converting the varchar value '280-64460-2' to data type int. SQL DONE USE TOXICOLOGICO SELECT NomeUnidadeColeta, NomeUnidadeColetaAlterar, Procedimento FROM dbo.Z...
asked by 02.10.2017 / 20:41
0
answers

Alter table in giant table

I need to perform an alter table operation on multiple fields in a table, and this table has more than a billion lines. One operation for each field takes approximately 2 hours and now it imagines for several fields. In development environmen...
asked by 30.08.2017 / 14:10
2
answers

Adds WITH query within another query - SQL Server

People, like adding the query below as a subquery. Query with WITH: WITH dias AS( SELECT CAST('2017-06-26' AS DATE) AS dia UNION ALL SELECT DATEADD(DAY, 1, d.dia) FROM dias d WHERE d.dia < '2017-06-30' ) SELECT CONVERT(VARC...
asked by 18.08.2017 / 20:01
0
answers

How to get the return of a sql query using nodejs [closed]

Good afternoon, I'm venturing into nodejs and I'm having some fun and I'm having a hard time getting the return of an sql query. I found some examples on the internet and they even work (the result stays on the console), and it's not what I expe...
asked by 06.08.2017 / 21:52