Questions tagged as 'sql-server'

1
answer

The INSERT statement conflicted with the FOREIGN KEY C #

I have this code to insert values into a table: conn.Open(); comm.CommandText = @"INSERT INTO ArticleBarCode(Code, Code_Article, BarCode, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn, IsDeleted) VALUES (@code, @codearticle,...
asked by 28.04.2017 / 12:00
1
answer

Encryption AES128 / 256 C # .net E SQL 2008/2012

Greetings, Does anyone know of any implementation of AES encryption compatible between C # and SQL? I want to encrypt in C # and decrypt in SQL.     
asked by 29.09.2015 / 19:04
1
answer

Procedure sql server, return the total value of an id

I have a bank of products sold forming by id, name and value. I would like to do a procedure that would return total of each product that was sold. Algem knows how to do it? That the result is Mouse = 60 CPU = 1500 Keyboard = 100...
asked by 14.10.2015 / 18:35
2
answers

Problems converting data mon dd yyyy hh: mm

I made a select in SQLSERVER within php: mssql_query(SELECT TOP 1 ven.DATA FROM tab_venda ven (nolock) INNER JOIN dbo.tab_item_venda iven (nolock) ON iven.num_Venda = ven.NUM_VENDA...
asked by 24.09.2015 / 16:57
2
answers

Error changing static property value

I have my class DadosConexao , this class is responsible for saving the connection string of the database, it contains the following properties: A statistical property StringConexao . isServ indicates whether it is a...
asked by 18.10.2015 / 01:01
1
answer

Database modeling helps!

I need to make a library system for book loans, in which I wrote this database diagram. the teacher said that this diagram is inconsistent. What needs to be done, are these tables just what I really need?     
asked by 06.07.2015 / 00:52
2
answers

Double insertion with mssql_query

I'm having a little problem and would like help solving it. I have a code that inserts into a SQL SERVER database through php. Everything is fine except that two "INSERT" on the bench are being made. I can not see what is wrong, so I wish someon...
asked by 23.10.2015 / 19:50
2
answers

Get last record of each id in sql query with condition

I'm having trouble getting the last record of every id in a SQL Server table. select c.Serial,v.Descricao,v.Placa,v.Cor,v.AnoFabricacao,v.Chassi c.DataHora,c.Endereco from [CheckPoint] c inner join Equipamento e on e.Serial= c.Serial in...
asked by 26.05.2015 / 21:29
2
answers

TSQL dynamic for multiple returns

I need to make multiple inserts that will depend on an existing result in a table like this: --CRIA TABELA #CONTATO CREATE TABLE #CONTATO( NOME VARCHAR(100) NULL, TELEFONE VARCHAR(50) NULL ); --INSERE 2 LINHAS NELA INSERT INTO #CONTATO...
asked by 22.04.2015 / 22:29
2
answers

Insert time and time into the database [closed]

I want to insert the time and date separately into the database, which has the timestamp and data fields, respectively. I have the following code on the button that inserts: SqlCommand sqlInsertCabecalho = new SqlCommand("Ins...
asked by 22.04.2016 / 15:48