Questions tagged as 'sql'

1
answer

Generate HASH of XML content in SQL

Is there a way to generate hash of a XML beyond the master.sys.fn_repl_hash_binary function? Currently this is my implementation, but I do not know if it is the only way to do it. --Preparação do ambiente CREATE TABLE [...
asked by 20.05.2016 / 19:51
1
answer

Login does not work

First time here, I got a code ready adapted for my college work, however the login does not verify, accept anything that you put. Create login <div id="nav"> <div id="sup_direito"> <div id="login">...
asked by 14.06.2016 / 06:13
1
answer

Connect to SQL Server on remote server

I need to connect to a SQL Server service on a remote server via SQLConnection, C #. Initially, it was giving the server could not be found, but I solved this by modifying the system32 hosts file, enabling exception on the server firewall and en...
asked by 02.02.2016 / 14:57
1
answer

How to create foreach (PHP / SQL)

I'm trying to send from a form to html, a table, with two fields with Array[] . These two fields are Service and Value, I want to add more than one product in form , and it inserts into different records in my table. I did...
asked by 26.04.2016 / 21:51
2
answers

Group column sum by quarter

I would like to group the sum of one column per quarter, that is, every three months. I have the following query that groups from month to month: select month(data) as mes, year(data) as ano, ifnull(sum(det.quantidade),0) as total...
asked by 03.08.2015 / 15:39
1
answer

from sql server to mysql with php

I have a SqlServer database and need, via php script, to send the data from a table to a MySql database. Will OPENQUERY result within the condition I have (php script)? How best to do this? The code I use to connect banks: Sql...
asked by 20.08.2015 / 14:09
1
answer

OUTER APPLY does not work as INNER JOIN

I know the OUTER APPLY command is analogous to INNER JOIN, but I'm confused by a situation where this does not happen. The following query extracted from Training Kit 70-461: SELECT c.custid FROM Sales.MyCustomers AS C CROSS APPLY (SELECT...
asked by 11.11.2014 / 21:22
1
answer

Retrieve last row inserted into table with non sequential primary key - MySql

Is it possible to know which last row was inserted into a MySql table where the primary key is not sequential? I have a table where the primary key is made up of two columns that are FK, so they do not follow a sequence. When executed the...
asked by 23.08.2016 / 16:08
1
answer

Comparing Columns in SQL Server

Good afternoon! I wonder if you can help me. I have the following case, we have a client that has the version of our system VERY outdated, with this is missing several columns in SQL tables. I was wondering if there is any way I can see all t...
asked by 12.07.2016 / 17:03
2
answers

How do I update multiple rows in a table after it has changed?

CREATE or REPLACE TRIGGER TG_ATUALIZA_BLOQUEIO AFTER UPDATE ON pcclient FOR EACH ROW begin if :NEW.BLOQUEIO = 'S' THEN UPDATE PCCLIENT SET BLOQUEIO='S' where codcliprinc=:OLD.CODCLIPRINC; END IF; end TG_ATUALIZA_BLOQUEIO; Explain...
asked by 16.06.2015 / 19:34