Questions tagged as 'sql-server'

1
answer

Relationship Tables

I have a Endereco table that serves both Funcionario and Vendor: 1 Funcionario possui 1 Endereco 1 Fornecedor possui 1 Endereco How do I create this relationship without having inconsistencies?     
asked by 03.03.2015 / 22:30
1
answer

Logical deletion of SQL Server records

We have the culture to only make logical exclusions in the application, maintaining 2 fields where 1 is the deletion date and another one that receives 'S' or 'N'. When we perform searches for undeleted records, we do something like: select...
asked by 13.02.2015 / 00:52
1
answer

Inserting data into sql server table

I'm trying to insert data into a table: INSERT INTO [RDO].[dbo].[observacaoProtocolos] (id_protocolo, statusObs1, observacao1, statusObs2, observacao2, statusObs3, observacao3, statusObs4, observacao4, statusObs5, observacao5, statusObs6, obse...
asked by 22.01.2015 / 14:48
1
answer

Error: Multi-part identifier could not be associated

I'm trying to run the following command: SELECT * FROM pendencia, cliente LEFT JOIN servico ON pendencia.id_pendencia = servico.id_pendencia LEFT JOIN cidade ON cliente.id_cidade = cidade.id_cidade WHERE cliente.id_cliente = pendencia.id_clie...
asked by 26.11.2014 / 19:33
1
answer

How to publish .mdf database in Azure SQL Dabases?

I have solution with a Asp.Net MVC 5 project and I'm using Code First and Migrations to update the .mdf database automatically generated in the App_Data folder. How do I put this .mdf in Azure and can u...
asked by 15.09.2014 / 20:56
1
answer

Execute procedure with CodeFirst

I'm trying to run a procedure in ASP.NET MVC with CodeFirst. I saw some examples on the internet but they are not working, can anyone help me? public void Copiadados(int Cod_Cli, int Cod_Obra) { SqlParameter p1 = ne...
asked by 13.08.2014 / 19:55
2
answers

Paging Results in SQL Server 2000

I sometimes need to query SQL Server 2000 and paginate the results however there is only the TOP clause that limits the number of records returned without an offset. Other banks like MySQL or PostgreSQL have this and query would look like...
asked by 21.03.2014 / 14:29
1
answer

Update if the value does not exist

I have these two tables in the database (SQL Server) Banking Table ID CODIGO NOME 1 246 Banco ABC Brasil S.A. 2 075 Banco ABN AMRO S.A. 3 025 Banco Alfa S.A....
asked by 22.04.2014 / 16:17
3
answers

Problem with users when publishing application

I'm using SQL Server 2012, and when I publish my application, both on the client server and on my pc everything works fine. The connection strings for DB is correct, everything looks fine. Now where's the problem? When trying to authentic...
asked by 04.04.2014 / 17:57
1
answer

Return 3 previous months from day 1

Every Friday I need to generate a report that brings me transactions made in the last 3 months. However, I have to pick up from the 1st of each month, for example, we are in month 9, so I have to pick up all the transactions since 01/06. I alway...
asked by 28.09.2018 / 17:37