Questions tagged as 'sql-server'

1
answer

Odd Row Queries SQL SERVER

I need to create query script that returns from the table only its odd rows, sorted in ascending order: DECLARE @table TABLE (coluna1 varchar(50)) INSERT INTO @table VALUES ('Anthony'),('Miguel'),('Benjamin'),('Lucca'),('Enzo'),('Martim'), ('N...
asked by 23.11.2017 / 16:06
3
answers

How to remove single-variable apostrophes

I have a text edit PRODUCT that looks like this: 'ADHESIVE 478', with apostrophes. How do I make it look like this: 478 ADHESION on sql server? I've tried it that way and it does not work: DECLARE @ProdutoNome VARCHAR(30); SET @ProdutoNome =...
asked by 13.06.2018 / 19:19
3
answers

Handle String in JAVA?

I have a query of SQL that the content brings me like this: [email protected];[email protected] I need only the first address, I have to disregard everything that is from ; ?     
asked by 03.04.2017 / 20:35
1
answer

Retrieve value using node.js and mssql

I'm having trouble retrieving a value using the mssql library I have tried to put a variable in global scope and update the value using the recordset, put everything inside a function passing the value of the recordset as a return and use fun...
asked by 24.08.2017 / 12:04
3
answers

Difference between dates in months with decimal return

Good morning! I am using the command below and the result returned is 6. In fact, observing the dates well, it has not closed exactly the 6 months, I think that through this function days are not being considered, and this is causing me a pro...
asked by 17.08.2018 / 16:03
1
answer

What are the differences between Stored Procedures and Functions within Sql Server?

This is a somewhat academic question, but the question has come to me. What are the differences between one and the other? What should I consider to choose each case in certain scenarios? Thank you.     
asked by 24.02.2016 / 20:19
1
answer

Sql Server Management Studio can handle any database?

I'm asking this question because I find this DBMS simply fantastic, so I'd like to use it with another database (not because I want to, but because most of the databases I have are in Mysql). Is there any adapter, plugin, or any feature that...
asked by 04.03.2016 / 15:33
2
answers

Update multiple records together with select

I need to do UPDATE with SELECT for multiple records, today I'm with this query: UPDATE banco.ordem SET valor = (SELECT (CEILING((litros * 3.67)*100)/100) AS valor_litros FROM banco.ordem WHERE ordens = 2763) WHERE ordens = 2763 Thi...
asked by 19.10.2016 / 15:14
1
answer

Select checking for a condition

I need to do a select where a condition is checked. Ex: If the value of a given field is < 0 assigns the sum of this field the column " PerdaGerada " otherwise assign the column " LucroGerado ". Something like shown below: SE...
asked by 03.02.2016 / 13:19
3
answers

Crossing of Multiple Coalesce Tables

Expensive, I have a table of "processes requested for consultation" and two tables with information of the processes registered (the "new" processes and the "old" processes). My intention is to bring the information contained in the process r...
asked by 04.07.2017 / 19:47