Questions tagged as 'sql-server'

2
answers

How to call an image from C #, stored in SQL Server. Using Stored Procedure and Entity Framework

I have this code made so far where I apply the SP "InsertEmployee", it adds records to the BD: var Insertar_NuevoEmpleado = _empleados.InsertarEmpleado(txtcedula.Text, txtnombres.Text, txtapellidos.Text, txtcargo.Text, txtdepartamento.Text, Co...
asked by 26.02.2018 / 19:27
1
answer

Problem with ConnectionString

I have a problem with the connection string: Putting it directly into the SqlConnection works for me: SqlConnection connection = new SqlConnection("server=DESKTOP-Q5REQCB\MSSQLSERVER01 ; database=Synergy ; user id = Synergy; password = Syne...
asked by 15.02.2018 / 13:06
1
answer

Error "INCORRECT SYNTAX NEAR '@nombretbl'" trying to query with dynamic table name

Hello Friends, I'm trying to generate several tables in Sql, which will come from a base table. Example: I have a BONUS table that can contain more or less than 4 million records; and I have a CONTEO_CUENTA table, where are the amounts of rec...
asked by 28.12.2017 / 17:32
1
answer

Delete user table dtproperties SQL Server

Is there any consequence of deleting the user table dtproperties of SQL Server ?, I am filtering the permissions of Role Public and verifying that this Role does not have DML and DDL permissions different from the Default ones that...
asked by 13.12.2017 / 23:51
1
answer

case when sql server in a single row

Hello, how are you? I wanted to know if you can help me with this. I have these 3 tables. I need to bring the users and the profiles they have, as shown in the following photo. but the result I get is the following:...
asked by 22.01.2018 / 14:16
2
answers

In SQL Server 2008, I need to decrease decimal part

I have the following query: select (select (select(select sum(paquetes) from koc4 where Material = '1000230')*((select AVG (convert(decimal (10,2),(Prom_lote)))as prom_lot from QM where Material = '1000230')/1000) )-((select (select sum(paque...
asked by 21.11.2017 / 13:05
1
answer

Add the total hours worked during 1 month

How can I add the hours in a period of 1 month, starting from an Initial date and a Final date in such a way that the result is as follows: Code fechaActual idClave nombre HorasTotalesMes 2300 2017-12 14290...
asked by 20.12.2017 / 20:23
1
answer

Save a numeric value separated by commas in a variable sql server 2008

Greetings to all, I would like to know if any of you have used any method that allows you to store a numerical string separated by commas and then save it in a variable to be used later. In the following example, what I am trying to do is tha...
asked by 21.12.2017 / 21:03
1
answer

sql query with conditions

trying to solve a request from a client I ran into a problem and wanted to know if it is possible to make an sql query with conditionals. My problem is the following at the moment I have a query that allows me to bring information from 3 tabl...
asked by 19.10.2017 / 18:11
2
answers

How to make this query in sql server 2014?

I have a problem when trying to make a query, I explain what I have: I have a schedule of X device, to calculate the hours of operation against the hours that have failures, what I need is a query to totalize the hours of operation per month....
asked by 27.09.2017 / 19:10