Starting in PHP with SQL Server 2008.
I'd like to know what's wrong with my code.
<?php
$serverName = "DESKTOP-B8EB4SG\SQLEXPRESS";
$connectionInfo = array( "Database"=>"contas", "UID"=>"sa", "PWD"=>"123456" );
$conn = sqlsrv_conne...
I have a PERSON table that has field A and B that form a UNIQUE .
I squeeze this select to return the name of the constraint :
SELECT DISTINCT COL.CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS Tab, INFORMATION_SCHEMA...
I'm implementing a new project, using EF6 CodeFirst , EF6 creates my Sql-Server database, with date columns like datetime .
What would be the difference between datetime and datetime2 , and which one is most likely to be used?
I have the following Query:
SELECT distinct finmovem.num_transacao
,finempe.codigo_orgao
,finempe.cod_reduzido
,finempe.num_empenho
,finempe.data_empenho
,finempe.nome_fornecedor
,finempe.valor_...
I need to query the sql server so that it identifies to me when the 1,2 and 3 or 2 and 3 combinations of the "desc" column are present for repeated values of the "cod" column, the result should be returned as 1 for found and 0 not found. Does an...
About the following trigger:
CREATE TRIGGER [dbo].[TG_TESTE]
ON [MINHABASE].[dbo].[TB_DOCUMENTOS]
AFTER UPDATE
AS
DECLARE @ID INT
DECLARE @DOC INT
DECLARE @QTD FLOAT
SELECT TOP 1 @ID = ID, @DOC = DOCUMENTO, @QTD = QUANTIDADE
FROM d...
Can anyone help me with this?
Must declare the scalar variable "@hospitalId".
PendingController:
public async Task<ActionResult> Index()
{
if (!Cookies.Exists("hid"))
return RedirectToAction("Index", "Login", new { are...
First of all, I apologize if the question is vague, since it is a very broad topic.
Today I have a system of registration and consultation of students, where the query is made exclusively by CPF, since it is a unique identifier and a constrai...
I'm working with 2 queries and would like a way to put the 2 in one, but I'm having trouble.
I have the following example:
Table T1:
CD PF Data Total
1 JSL001 15/03/2018 100
Table T2:
ID PF...
I have a table with the field CtrlChargeNum that has the log of the number of the load of a truck. I need to make a query that brings the total of that field. Until I got the query, see:
SELECT COUNT (*) CtrlCargaNum
FROM CTRL_CARGA
WHERE Ct...