During my studies, I tried to sort the records and put the ones that are NULL at the end, I did the following:
SELECT
tbl1.firstname,
tbl1.mgrid
FROM
(
SELECT TOP 100 firstname, mgrid
FROM HR.Employees...
I have a select and I need to generate an excel through it. However there are some observations. I would like this script to run every day at a certain time, 23:55 for example, as it is to get the request data open that day. Another question is...
I have the following problem, when I place an order in the quantity field when I put a certain number I have to get it if it is in stock in the bank, and if I have to decrease the quantity in the bank, I do not know how to pass the value of the...
I'm having a problem submitting a form developed in ASP MVC. Clicking the save button returns the following error message:
System.InvalidOperationException: 'Não existe item ViewData do tipo 'IEnumerable<SelectListItem>' que possui a cha...
I have a table with customer purchase records, I would like to select only the last purchase from each customer. How to do this? I tried to use DISTINCT, but I have other data I need and it is not possible to group such as date.
For example:...
I was trying to run my database but this error appears. System.NullReferenceException: 'Object reference not set to an instance of an object.
with era null
using System;
using System.Collections.Generic;
using System.Configuration;
usin...
I have the following code block:
sqlConn.Open();
SqlCommand inserirAluno = new SqlCommand("INSERT INTO ALUNOS (Nome, DataNascimento, CPF, Endereco, Bairro, " +
"CEP, Cidade, IdEstado, Sexo) OUTPUT INSERTED.ID" +...
I have this querry that gives me the total nr of rows that start with the same code
USE CCILCDatabase;
GO
DECLARE @mes int;
SET @mes = 1;
WHILE (select @mes) <= 12
BEGIN
SELECT LEFT(CONVERT(VARCHAR(10),[CPVCodeID]),2), COUNT...
Good morning!
I need to insert the return data of a Select into a .txt file containing the column names and separating the data with ";"
How can I do this?
Thank you in advance
I'm creating two foreign key references pointing to two different tables, but I'm getting an error creating one.
There are no primary or candidate keys in the referenced table
'dbo.TB_PODERES' that match the referencing column list in th...