Questions tagged as 'sql-server'

1
answer

Failed to execute statement in SQL Server 2008 [duplicate]

I need to run this MYSQL statement in SQLServer CREATE TABLE venta ( idVenta INTEGER PRIMARY KEY, Fecha DATE NOT NULL, Cliente_Cedula INTEGER NOT NULL, producto_idProducto INTEGER NOT NULL, empleado_Cedula INTEGER NOT NULL, can...
asked by 02.03.2018 / 18:14
1
answer

Sub-Query SQL server

I'm new in these parts. I'm doing an SQL query, which started as a girl and ended up making my life more complicated. I have something like this: Two tables. One has data on costs, date and ID, the other has date and exchange rate / Curr...
asked by 15.03.2018 / 18:28
1
answer

Add column as identifier

Greetings, I am working with a table that does not have a column to be able to identify the rows, that is, it does not have a identity which causes me a problem because I need to obtain information from a column of each one of the records...
asked by 23.02.2018 / 22:36
1
answer

Export data from excel to sql

How can it be done to export an excel table to a SQL Server table and also, whenever someone adds, edits or deletes a value from the excel table, that same value is removed from the sql table? I have already been able to export the values of...
asked by 15.02.2018 / 17:54
1
answer

How to query a sqlserver table with (numeric) to c #

I have a problem and I am trying to make a query from c # to sqlserver but I get the following error    System.InvalidCastException: 'Unable to convert an object of type   'System.Decimal' to the type 'System.String' And I know that the e...
asked by 19.03.2018 / 04:21
1
answer

Help with CASE in SQL Query

First I will clarify a point that this question is similar to the one previously formulated, entering the following link you can see: Case in sql query But given that that question could not solve my doubt, after of course having reviewe...
asked by 20.03.2018 / 18:45
2
answers

How to make an UPDATE on a BD SQL Server from C Sharp

I have the following code which makes the query. private void EditarUsuario() { miconexion.Open(); string sql = @"UPDATE USUARIOS SET [USUARIO] = @USUARIO, [CLAVE] = @CLAVE"; SqlComm...
asked by 08.03.2017 / 06:05
2
answers

Dynamic SQL, Knowing if DB exists SQL 2008?

I raise my problem. I have a SQL Server 2008 Database Server in which new bases are constantly being created, many of them are also erasing them and I do not have full knowledge of how the logging works, because I can actually see which bases ha...
asked by 06.02.2018 / 15:10
1
answer

How to create an email automatically in SQL [closed]

At the time of entering the names and surnames (maternal and paternal) create an email with its first two letters. Example:    Armando Casas Sanchez = [email protected]     
asked by 04.07.2018 / 10:07
2
answers

problem getting the number of the day of the week on sql server

I have the following query SELECT DATEPART(WEEKDAY,'2018-01-18') What I want is an example that if that day is Thursday, I return a 3 because in the table that I have the days start from 0 to 6 the field is of type int and is called DAYI...
asked by 18.01.2018 / 15:06