Questions tagged as 'sql-server'

1
answer

How to insert entity with ID in the Entity Framework

How to insert an entity with ID in Entity Framework 6.0? That is, insert with ID because the table does not generate it. For example: var last = _contexto.Area.AsEnumerable().LastOrDefault(); area.Id = last !=null ? last.Id + 1 : 1; _contexto...
asked by 05.01.2016 / 20:34
1
answer

Make insert / update with values from other tables

Ihavethisbd.Iwanttodoaninsert/updatetothemissing_tabletable.ButIhavenoid,justthenumbersandnames.HowdoImakeaninsert/updatetorelatetoanothertable?DimsqlAsString="insert into Faltas_Licao values ()"     
asked by 16.02.2016 / 10:52
1
answer

SQL Sends NULL value to a DateTime column

I have a form in VB.NET where the user informs the delivery dates and delivery forecast of the order and other information. As he does not yet have, for example, the delivery date because he has not yet been informed by the carrier. My query...
asked by 20.06.2016 / 20:59
3
answers

Select current date [closed]

I need a select that pulls all records from the current date table (today), without informing the date, in the sql-server and how the syntax would look in PHP as well. Since I have a column named DtBase that stores the dates of the reco...
asked by 14.03.2016 / 17:24
1
answer

What is the best alternative for recording data using a 3G connection?

I have the following situation: a header table with the fields: IDJOGO IDMODALIDADE IDUSUARIO VALOR_JOGADO HORA_JOGO And a detail table: IDJOGO NUMERO_JOGO In this case, would it be feasible to write the header, retrieve the...
asked by 10.12.2015 / 02:24
2
answers

Mounting dynamic query with Stored Procedure in SQL Server

I need to mount a conditional query with a stored procedure, to make my problem clearer, I'll expose the sp here with what I want it to work, look at the end where I use the IFs, that's the problem. USE [MarcenariaDigital] GO SET ANSI_NULLS ON...
asked by 08.11.2015 / 19:05
1
answer

SQL Server 2012, questions

Based on the attached table, could you tell me if the resolution for the exercise below is correct?    Show orders that have items that were sold at a discount (discount occurs when the sales price - ITE_PrecoUnitario - is less than the price...
asked by 10.11.2015 / 17:43
1
answer

Auto-update of publish in Visual Studio by zeroing the database

In a short time I had to create an installer for desktop application in C #, and as in Visual Studio 2013 there was Publish that already created the Setup and Auto-Update I ended up using it for the convenience, but now I have a problem, every t...
asked by 18.11.2015 / 02:18
1
answer

Error updating a table. (Duplicate key)

Good. When doing the update I get error .. Yes I already have a record in the table with those values, but when changing the type should not let me do?     
asked by 24.02.2016 / 09:55
1
answer

Define specific ports for each database in SQLServer

Here in the company, we have a dedicated server hosted in a datacenter that maintains numerous databases using SQLServer. These databases are by default working from port 1433 where it is already open for clients. Today, I'm having difficulti...
asked by 24.02.2016 / 12:46