Questions tagged as 'sql'

2
answers

Protect SQL Server database

I have 2 SQL Server databases in my SQL Server Management Studio. I would like to put a password in one of them, making it impossible to access it, is it possible?     
asked by 04.05.2017 / 21:26
2
answers

Is it possible to connect an application made in C to some database?

We usually use files to save data using C language (I at least). Is it possible to connect a relational database to some application made in C ? If so, do you need any library for this and how is that connection made? Preferably MySQL.     
asked by 21.09.2016 / 19:42
2
answers

What is the difference between MER (Relationship Entity Model) and DER (Entity Relationship Diagram)?

What is the difference between a diagram of the MER and one of the DER, with examples.     
asked by 09.09.2018 / 20:12
2
answers

SQL query taking too long and returning a Time Out error

I am trying to perform a query in SQL. Here is the method: public void excluirVenda(int Codigo) { Conexao conexao = new Conexao(); SqlCommand cmd = conexao.CreateCommand(); SqlTransaction transaction = null;...
asked by 05.10.2018 / 15:03
2
answers

How to delete duplicate lines without using distinct?

The following query returns the following: IFobject_id('tempdb..#tmpHistorico')ISNOTNULLBEGINDROPTABLE#tmpHistoricoENDCREATETABLE#tmpHistorico(Idintnotnull,IdColuna1intnotnull,IdColuna2intnotnull,Valor1varchar(10)notnull,Valor2varchar(10)not...
asked by 10.04.2018 / 09:49
2
answers

Insert multiple values into one table

How do I insert multiple values into a table, but in a single query of sql ?     
asked by 14.03.2018 / 13:45
3
answers

How to mount this SQL to bring months that are not in the list?

The SQL below brings the number of entries made month by month, until then blz. I needed to show the last 6 months, even if it was zero, but in this select it would only bring up when there are records. select extract(month from data_cad) a...
asked by 21.05.2018 / 17:44
2
answers

Condition for INSERT INTO

I need SQL to check if there is any value equal to 1, 2 or 3 in the '@variavel' sent; If it is green enter the value 1, otherwise enter the value 0. Note: the table and column can be given as example as fictitious.     
asked by 24.10.2018 / 14:16
2
answers

How to check day and month birthday in SQL in Oracle?

I've seen some examples here, and I've tried to reproduce them, but in oracle does not accept operators like MONTH , so I was not successful. SELECT nome from aluno where month(datanascimento) = month(now());     
asked by 11.08.2018 / 16:35
3
answers

How to generate new code from DBO

I have a table with the name Produtos where I inserted 3 products for testing. Now I'm setting up the product registration form and I need to always generate a sequential product code from the last id already registered + 1. The code I...
asked by 14.07.2016 / 15:26