Questions tagged as 'sql-server'

1
answer

How to condition the WHERE with a variable and a temporary table ?, dynamic query [closed]

What a good day, I have a question with SQL Server, how can I use a variable to choose if I want to add the not like or if I do not want to add it, I have this code but it does not work, it puts an error in the temporary table: DECLARE @option...
asked by 28.11.2017 / 23:20
1
answer

Check the records of a field in SQL SERVER 2008

I need to know the number of records a field has in SQL SERVER 2008. If I execute the statement: select count(*) from 'tabla' the result that throws me is 996.561 but if I execute the sentence: select count(e-mail) from 'tabla' the...
asked by 04.12.2017 / 22:57
2
answers

Save the value of a column in a variable using a WHILE

I'm trying to save a value in a variable. I create the table and insert records. CREATE TABLE #TEMP (IDSOL INT not null PRIMARY KEY ,USUARIO VARCHAR(50) ,LastName varchar(255) NOT NULL,FirstName varchar(255),Age int, ) INSERT INTO #TEMP V...
asked by 25.01.2018 / 20:10
1
answer

Doubt with Visual Studio and SQL Server

Dear, It turns out that I have a system in visual studio which I wanted to generate a visible query in a datagridview, this gave me error at first, but I realized that as it added a very high amount for an int for it did not work , so I chang...
asked by 25.01.2018 / 13:25
1
answer

how to know in which database is a sql server procedure?

Good I would like you to help me, I have 100 database and I would like to find a stored procedure, with a query to show me the location of the database that has that procedure: I have made this script but as long as I am in a specific databas...
asked by 11.11.2017 / 00:15
1
answer

Error sending file by AJAX

I am trying to save a file in a database of SQL SERVER 2008 and I am not managing to send the data to the server side or I am not receiving it well not what I know. Here is my code: Front-End @model PCotiza_compras.Models...
asked by 10.11.2017 / 18:53
1
answer

Use ALIAS for conditional and operations of addition, subtraction, etc.

I want to compare the ALIAS hours with the ALIAS PlanWorkHours and assign the result to a new variable, however this is not possible since these ALIAS are temporary or do not represent as such a column of the table, there is some way to implemen...
asked by 26.12.2017 / 22:15
1
answer

How to list my databases in EXCEL with VBA

I'm trying to dig deeper into the connection from VBA using Excel versus MS SQL. All right with the forced connection putting all the parameters in the data of the macro (name of the server, database, etc.) But I would like to do something mo...
asked by 26.12.2017 / 13:08
1
answer

Not Equals in the Where clause

I have the following tables create table Puesto ( id_puesto int identity(1,1) primary key not null, piso int, cantidad_sillas int, frente_ventana bit, cantidad_computadoras int, cantidad_sillas_adicionales int, acce...
asked by 28.10.2017 / 00:09
2
answers

How to make queries prepared with VB.NET and SQL Server?

I have experience programming in Java and I have taken as a personal project to learn .NET languages (VB.NET and C #). In JAVA, the following is used to create MySQL prepared queries to avoid SQL injection: public void consultaPreparada()...
asked by 21.10.2017 / 22:53