I would like to format the DataAfr and DataTrm fields of type DATETIME , in Brazilian date format dd / MM / YYYY instead of the American format yyyy-mm-dd hh: mm: ss
SELECT
e.NmrCnt AS [Contrato]
,e.NmrSeri...
I need to display all the dates that exist between two defined dates.
I do not need the information of the difference between these dates, nor of data that is in the interval between them, but rather display the dates for each day of the inte...
By Identity do not want to, because it breaks the sequence if something happens. Max() + 1 , I find it very vulnerable and slow when I have many records. So I ask, is there a way that someone knows, that I can generate sequential n...
I need to do SELECT on two tables with relationship n to n , so I will have to make use of the middle table too, but I do not know how to do this. I'm using PHP and SQLServer database.
I have the following function that treats a time that comes from the bank:
SELECT f.chapa AS chapa,
f.nome AS nome,
f.secao AS cod_secao,
f.nsecao AS desc_secao,
c.codigo AS cod_funcao,
c.nome AS desc_funcao,...
Considering a variable with a text in SQL Server . How can I remove 2 or more spaces within the text? In this case leaving only 1 space.
For example:
'1 tigre, 2 tigres, 3 tigres'
Should result in:
'1 tigre, 2 tigres, 3 tigres...
I have a field in a table that must be filled in all lowercase, but the user being user has filled some lines in uppercase. I want to identify which records are in order to request correction.
How can I test if my string is all uppercase?
...
When we model a database, can the number of columns interfere with performance?
Ex: Tabela1 possui 2 campos, 1 int pk e 1 nvarchar(50)
Tabela2 possui 50 campos, 1 int pk e 49 nvarchar(50)
Select used for both tables, regardless o...
I've always used @@IDENTITY to get the last identity value entered, as in the example below.
create Proc [dbo].[Arquivos]
@IdArquivo int,
@IdArquivo_Out int output
as
begin
Set Xact_Abort on
Set Nocount on
Begin Tran
begin...