Questions tagged as 'sql-server'

1
answer

Procedure price range

I'm trying to create a procedure that, depending on the price range, takes a different field from the table. Create Procedure BuscaPreco @preco decimal, @faixa1 int, @faixa2 int, @faixa3 int, @faixa1=100, @faixa2=200, @faixa3=300 Select case...
asked by 24.10.2017 / 16:15
1
answer

Error executing function SQL Server

I have a database test today and I'm practicing functions with old exercises only that I'm getting an error when I run the function. tables set language brazilian; CREATE TABLE pedido ( nr_pedido numeric(5) NOT NULL, dt_pedido date,...
asked by 30.11.2017 / 19:39
1
answer

How to migrate data between tables referencing ID?

I have a table called Clipping in my database containing miscellaneous data, including the binary data of an image in a varbinary(max) column. I need to migrate just the binary data column to another table called Files and reference t...
asked by 30.11.2017 / 19:48
1
answer

Error: There are no primary or candidate keys in the referenced table

I'm trying to relate these two tables IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'Periodo') AND type in (N'U')) DROP TABLE Periodo GO CREATE TABLE Periodo( Numero tinyint NOT NULL, SiglaCurso varchar(5) NOT NULL...
asked by 26.10.2017 / 20:12
2
answers

How do I compare values between two tables and send email if I have a new value?

My system imports CSV files from multiple directories every day into a table called TB_ARQUIVO. In this file, it contains the name of the Hotel (Column HOTEL_NOME) and four types of Channels ... SEGMENT, ORIGIN, COMMUNICATION and VEHICLE, outsid...
asked by 27.09.2017 / 17:19
1
answer

Doubt - SQL Server Dates

In the script below when a given task is completed the other will open on the first business day of the subsequent month. Example : Task 10 was completed on day 18-11-2016 , then another will be generated on day 01-12-2016 . The...
asked by 25.09.2017 / 13:56
1
answer

Error in Setup.exe of Sql server 2016 developer x64 [closed]

I downloaded the SQL Server ISO file, I mounted it and at the time of clicking setup.exe this error occurs. Cananyonehelpme?IneedtoinstallSQLServertousealongwithvisualstudio.Ididnotuninstalleverythingandtriedtoinstallagain,cleanedeverythingthat...
asked by 16.09.2017 / 17:10
1
answer

How to do column operations where nicknames are given?

I have the following hypothetical query to the bank: SELECT dinheiro_na_carteira, (SELECT sum(despesas_pagas_carteira) FROM DESPESAS WHERE id = X ) as despesas FROM RECEITAS WHERE dinheiro_na_carteira - despesas > 0 When trying to do t...
asked by 30.11.2017 / 12:10
1
answer

SQLServer in repositories

I have to send a project of an application through a GitHub repository, I was able to make the application work perfectly front-end, back-end and LOCAL database, my doubt is: How can I export SQLServer to a repository? Or do I have to put it o...
asked by 15.10.2017 / 05:21
2
answers

Error Object reference not set to an instance of an object in C # [closed]

I'm having trouble, when I register my route it appears an error in the time the system will make the comparison to see if the NumCarroId that is in the DropDownList is the same one that is in the bank so you can make the change. / p> Error ap...
asked by 04.09.2017 / 17:13