Questions tagged as 'sql-server'

1
answer

How to compare more than one column in an IN clause?

Is there a way to compare > = 2 columns in a IN clause %? type as if it were to compare objects? For example (It will give error so the question) SELECT * FROM Usuarios1 WHERE Nome,Sobrenome IN(SELECT Nome,Sobrenome from Usuarios2);...
asked by 17.08.2018 / 17:10
1
answer

How do I save an image in the database through an application? [duplicate]

I have an application in C # and I want to make it possible to save a photo in the SQL database. 1- How do I set up the database structure to receive an image? 2 - How will I send the application photo to the DB?     
asked by 05.07.2018 / 06:29
1
answer

how to subtract column date with system date?

I have a column with date data_novo and I want to know how many days the product is open, I have to make a subtraction count between the "system date" and the date it is in the data_novo column. And this result will be displayed in...
asked by 11.06.2018 / 21:20
1
answer

Error creating Diagrams in SQLServer Studio 2014

This week I had a problem creating diagrams in my database (SQL Server 2014), it returned an error message:    Database diagram support objects can not be installed because this   database does not have a valid owner. To continue, first use t...
asked by 27.06.2018 / 20:54
2
answers

Connection error with database .MDF C # Visual Studio

App.Config <connectionStrings> <add name="conn" connectionString="Data Source=.\SQLExpress;AttachDbFilename=C:\Sistema\Sistema.mdf;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectio...
asked by 25.05.2018 / 01:03
1
answer

How to define multiple variables at once within a trigger in SQLServer

Hello, I'm creating a TRIGGER where I should do a series of treatments after an UPDATE in a table in SQLServer. In this TRIGGER, I need to set some variables so I can work with them in the rest of the script, like this: CREATE TABLE foo (...
asked by 30.05.2018 / 18:47
1
answer

How to do an SE function in SQL

Good morning. How do I make an SE function in SQL server? For example, I have data in a column and when it is = '1';'masculino';'feminino' . Can you help me out?     
asked by 14.06.2018 / 16:47
1
answer

Doubt in an SQL query

With this DER model I would like to make an sql query that returns me the following information: Type a command that shows how many clients are single.     
asked by 15.06.2018 / 00:35
1
answer

SQL error in casting from int to string

I have a method where I need to return the ID ( integer ) of a particular record whose name passes as a parameter, however Visual Studio points to the following error:    Object reference not set to an instance of an object This err...
asked by 13.05.2018 / 18:08
1
answer

Consider NULL as 0

In the following query I need the transaction_value to be considered 0 when it is NULL in the highlighted aggregation, how can it be done? I tried using it but it did not work SELECT num_empenho AS EMP, data_empenho AS DATA, nome_fornecedor AS...
asked by 18.04.2018 / 19:37