Questions tagged as 'sql-server'

1
answer

Merge SQL queries with different columns

I have the following queries, q1: SELECT finempe.codigo_orgao ,finempe.cod_reduzido ,finempe.num_empenho ,finempe.data_empenho ,finempe.nome_fornecedor ,finempe.valor_empenhado ,finempe.valor_anulado ,finempe.valor...
asked by 09.01.2018 / 17:22
3
answers

Find record with regular expression in mssql

I have a column that stores data in the following pattern #campo#=valor;#campo#=valor (and so on) ex: '#aaaa#=1111;#bbbbb#=2222;#cccc#=33333' However, they added ; within the value and I wanted to find them, I need to...
asked by 11.01.2018 / 13:31
1
answer

Split Error by Zero - SQL Query

I have the following query below, however, when I run it, the following message occurs: erro de divisão por zero . I tried to use the nullif function, but to no avail. How to solve? SELECT count(f.SolID) / cast(dbo.horas_uteis_tra...
asked by 05.12.2017 / 17:49
1
answer

How to add a 0 to the left in a datetime

I need to be able to add a 0 left at the time that sql only takes 3 digits ie from midnight to 9 in the morning for the information to be sorted! Because if not the information I have is in the following order 0:00 1:00 10:00 am 11:00 a.m. 19...
asked by 06.12.2017 / 17:40
1
answer

Return int on a select using Dapper.

I need to return the idCity. If it does not find in one table, it is mandatory in the other. Return is null. My Query public const string sql = @"DECLARE @retorno AS INT = 0; SELECT @retorno = id...
asked by 30.11.2017 / 13:56
1
answer

Import data from MS Access to Sql Server via code

I need to import data that is in an Access database via code to Sql Server. My software that is made in C # for many years has been integrated into an Access database. From now on we are migrating to Sql Server and the intention is that in the u...
asked by 30.11.2017 / 17:34
0
answers

I am having trouble inserting data into a table with php

My form looks like this: <form name="pedidooo" action="cadastrandoPedido.php" method="post" > <?php include './conex.php'; $query = ("SELECT * FROM conta"); $result = $mysqli->query($query); echo '<gg>Nu...
asked by 25.11.2017 / 11:51
0
answers

Help with sql and android studio search

I made this layout <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fillVi...
asked by 14.11.2017 / 17:34
0
answers

8000 character limit in ASP Classic / SQL server

Dear friends, I'm trying to make an update to a table in SQL Server 2008 R2, but the field writes only 8000 characters. The column is set to 'text', but I already tried to change it to 'varchar (max)' without success. I've also used 'ca...
asked by 22.11.2017 / 19:01
1
answer

Convert query to SQLServer

I have the following query for the Oracle database: select xmlagg(xmlelement(e, d.delinha, '').extract('//text()') order by d.nulinha).getclobval() . I need to convert to run on SQLServer database, but I can not. Does anyone know of...
asked by 10.11.2017 / 12:56