Questions tagged as 'sql-server'

1
answer

Do a SQL Server procedure receiving string with special character and obtaining only the numbers

Hello, I have a system developed in Classic ASP, in which I select up to 5 times on a screen. These times are sent to the other page via querystring, however the next format is followed by an exclamation. Example 7, 10.19. What I need is to get...
asked by 27.07.2015 / 17:56
0
answers

How to assemble a structure starting from the same structure?

I have a lot of research on how to set up a query in sql server but I have not been very successful. First, I have a system that controls an industrial courtyard in which there are organizational levels and I have the structure that has the n...
asked by 11.11.2015 / 11:49
2
answers

How to Save Datagridview items within a column?

I'm creating a Budgets form, similar to this one in the photo: As you can see, in the New button, you generate a new row in the bank with the budget number in the Código field and the client in the NomeCliente field. But whe...
asked by 19.06.2015 / 14:28
1
answer

Script to Execute in Function

I'm doing a conversion on some bd objects where they have a fixed database name. Example: select * from banco.dbo.tabela ... In this case, we are exchanging this banco fixed, with a variable that contains the name in each database...
asked by 18.06.2015 / 15:07
1
answer

Table Update Update Doubt

I have two tables, questions and answers, and I would like to update them according to what is selected: Bank Sql Server 2005 Problem: --usuário excluindo a pergunta (não está gravando a data da exclusão é não está excluindo as perguntas) u...
asked by 03.07.2015 / 04:28
3
answers

Error in procedure "Must declare the scalar variable"

When I run the following Procedure, SQLServer gives the error:    error Must declare the variable scalar "@VDIAPARALISADO". Procedure: BEGIN SELECT @VDIAPARALISADO = COUNT(F.DATA) FROM ED_FERIADO F WHERE F.EDEMPRESA_ID = @PEDEMPRESA_ID...
asked by 28.10.2014 / 12:57
2
answers

How to check if a table exists in SQL Server 2005 database and if it does not exist create it and the columns

How to check if a table exists in the SQL Server 2005 database, and if it does not exist, create it and the columns. The purpose of this process and create this routine for when I need to create a new field in my application, I put it inside thi...
asked by 05.05.2016 / 23:44
2
answers

Create total sales procedure (value) per customer

I need to make a procedure that instantiates the cli_TotalCompras column of the client table with the customer's total (in value). In the vendaProduto table I have the value ( vpr_ValorUnit ), the quantity ( vpr...
asked by 26.10.2016 / 00:22
5
answers

Group records per day

I have the following table ID | Início | Fim | Horas 333 | 01/01/2017 | 03/01/2017 | 5 333 | 02/01/2017 | 05/01/2017 | 1 333 | 05/01/2017 | 07/01/2017 | 3 333 | 01/01/2017 | 07/01/2017 | 6 I need a result like this...
asked by 12.01.2017 / 17:39
3
answers

Grouping by day and date period

I have a query from the period from 26 to 30-06 which brings the following result: Data_Cancelado Cancelados 27-06-2017 4 29-06-2017 5 However, I want it to come this way, that is, I want it to come to the query...
asked by 18.08.2017 / 15:41