Questions tagged as 'sql-server'

4
answers

Increase Id with an INSERT in SQL Server

I have a table with different fields, I want to do a INSERT in which the new sentences have the Id from the last one. How could I do it? I thought about doing something like this: insert into id = id + 1 But I'm not conv...
asked by 22.08.2017 / 09:41
1
answer

Register IP of those who modify something on my site

My problem is this: I have a website where the user is given the freedom to create more users for their own account, modify their data and delete records that they no longer want (the usual), I was asked to create a Log in the database to kee...
asked by 09.03.2017 / 18:33
5
answers

How to copy a table from one BD to another BD - SQL SERVER

I have to make a copy of some tables from one BD to another BD within the same SQL SERVER instance. I was thinking about using the Import / Export utility but I would have to recreate the indexes again and create the statistics in the target tab...
asked by 19.05.2016 / 20:02
2
answers

In SQL query check if a dateA field is equal to "01/01/1900" and if so it returns the value of another dateB field

I have a very long SQL query in one of its paragraphs I need to control if a field dateA is equal to "01/01/1900" and if so it returns the value of another field dateB. As I commented the query is very very long with other CASE, arguments, et...
asked by 05.09.2018 / 11:56
2
answers

Show return value SQL Server in WPF window C #

I have the following code with which I recover the value that a stored procedure returns to me public bool EjecutarSQL(string consecutivo, string otratabla) { Clsconexion objConexion = new Clsconexion(); objConexion.SQL = "...
asked by 06.12.2018 / 16:26
1
answer

use of Sum SQL SERVER

I need to add everything that is in value; This is my query create procedure sp_DetalleDeduccionesEmpleado @inicio datetime, @final datetime, @emp int as select ded.DedId, sum(ded.DetDedEmpValor), emp.EmpId from Tbl_DetalleDeduccio...
asked by 27.10.2018 / 00:13
2
answers

Validations in SQL

I have the following problem, I have a web application, in which I fill a form in which an image is attached (in sql I only save the name of the image and then open it in another form), when updating the record, if the image is not updated the S...
asked by 18.05.2018 / 17:44
2
answers

Obtain a result with decimals in SQL Server

I am dividing two numbers in excel as follows: 352/440 and the result is: 0.80 I need to do the same in SQL Server, this is my query: SELECT CONVERT(FLOAT,352 / 440) But the result is 0.     
asked by 11.09.2018 / 16:49
2
answers

Convert int a float SQL

I'm trying to get the decimals of an operation: SELECT CAST(22*100/148 AS FLOAT) My result is 14 and I need it to be 14.86 as the result shows a calculator.     
asked by 30.07.2018 / 18:00
2
answers

How to register users in ASP.NET MVC?

My code is this to register users: [HttpPost] [ValidateAntiForgeryToken] public ActionResult RegistrarUsuario([Bind(Include = "estado")] Usuarios usuarios) { if (!ModelState.IsValid) { return RedirectTo...
asked by 11.04.2018 / 20:52