This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
/* steps to use this test file: | |
1- install package lowdb : npm install lowdb | |
2- create a file empty data.json | |
3- manipulate the variable option to test the scenarios you want | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--https://docs.microsoft.com/en-us/sql/t-sql/functions/serverproperty-transact-sql?view=sql-server-2017 | |
-- 07/06/2019 | |
SELECT | |
SERVERPROPERTY('BuildClrVersion') AS BuildClrVersion, | |
SERVERPROPERTY('Collation') AS Collation, | |
SERVERPROPERTY('CollationID') AS CollationID, | |
SERVERPROPERTY('ComparisonStyle') AS ComparisonStyle, | |
SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS ComputerNamePhysicalNetBIOS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://stackoverflow.com/questions/11186183/hash-a-sql-row/54789730#54789730 | |
drop table if exists #table1; | |
create table #table1 ( | |
campo varchar(10) | |
,campo1 varchar(10) | |
) | |
drop table if exists #table2; | |
create table #table2 ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE INTEGRADOR | |
GO | |
SELECT Dia, [Linx Venda] as Linx,[Integ. Venda] as Integrador,[L1 Venda OK] as Protheus, | |
[Linx Venda]-[Integ. Venda] as 'Linx - Integrador', | |
[Integ. Venda]-[L1 Venda OK] as 'Integrador - Protheus', | |
[Linx Venda]-[L1 Venda OK] as 'Linx - Protheus' | |
FROM (select Dia, Origem, QtdDoc from [VW_ConsultaIntegracao] where Dia > GETDATE()-3) as consulta | |
Pivot | |
( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem Primeiro descubra o formato que o servidor está rodando o comando echo %date% | |
rem e aplique uma das funcionalidades abaixo | |
rem para PT-br | |
rem Transforma data em formato dd/mm/YYYY em YYYYmmDD, ou seja, 27/09/2021 em 20210927 | |
rem a ténica abaixo é basicamente um substring | |
set year=%date:~6,4% | |
set month=%date:~3,2% | |
set day=%date:~0,2% | |
set pt_br_today=%year%%month%%day% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS #VENDEDORES_ATIVOS; | |
SELECT Distinct | |
B.COD_VENDEDOR | |
,B.CODIGO_FILIAL | |
,A.CPF | |
INTO #VENDEDORES_ATIVOS | |
FROM #TMP_VENDEDORES_ATIVOS A | |
INNER JOIN TB_AUX_LNX_VENDEDOR B ON LTRIM(RTRIM(B.CPF)) = LTRIM(RTRIM(A.CPF)) | |
WHERE | |
-- REGRAS CPFs VALIDOS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#fonte https://devaprender.com/como-criar-um-bot-no-telegram/ | |
import requests | |
import time | |
import json | |
import os | |
class TelegramBot: | |
def __init__(self): | |
token = 'seutoken' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dCalendario = | |
ADDCOLUMNS( | |
CALENDARAUTO(); | |
"Ano";FORMAT([Date];"yyyy"); | |
"Trimestre";FORMAT([Date];"q"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 23/12/2021 - Bruno | |
drop table if exists #resouce_mapping ; | |
select distinct | |
s.name as schema_name | |
,o.type_desc as resource_type | |
,p.name as resource_name | |
,t.name as table_name | |
,c.name as column_name | |
,ty.name as type | |
,c.max_length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION dbo.RepetitiveReplace_fn | |
( | |
@P_String VARCHAR(MAX), | |
@P_Pattern VARCHAR(MAX), | |
@P_ReplaceString VARCHAR(MAX), | |
@P_ReplaceLength INT = 1 | |
) | |
RETURNS VARCHAR(MAX) | |
BEGIN | |
DECLARE @Index INT; |