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.CompareString | |
| ( | |
| @keyString NVARCHAR(MAX), | |
| @ansString NVARCHAR(MAX), | |
| @Normalised BIT = 0 | |
| ) | |
| RETURNS NVARCHAR(MAX) | |
| AS | |
| BEGIN |
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
| -- Tested on SQL Server 2019 | |
| DECLARE @inputString NVARCHAR(100) = '1,3,2,4,2'; | |
| SELECT STUFF(( | |
| SELECT ',' + CAST(value AS NVARCHAR(MAX)) | |
| FROM STRING_SPLIT(@inputString, ',') | |
| ORDER BY CAST(value AS INT) | |
| FOR XML PATH('') | |
| ), 1, 1, '') AS SortedString; |
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
| WITH RankedData AS ( | |
| SELECT *, | |
| ROW_NUMBER() OVER (PARTITION BY id ORDER BY CASE WHEN type = 'I' THEN 0 ELSE 1 END) AS TypePriority | |
| FROM your_table_name | |
| ) | |
| SELECT id, name, type | |
| FROM ( | |
| SELECT *, | |
| ROW_NUMBER() OVER (PARTITION BY id ORDER BY CASE WHEN type = 'E' THEN 0 ELSE 1 END) AS ETypePriority |
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
| DECLARE @SQL AS VarChar(MAX) | |
| SET @SQL = '' | |
| SELECT @SQL = @SQL + 'IF EXISTS(SELECT 1 FROM ' + TABLE_SCHEMA + '.[' + TABLE_NAME + ']) SELECT ''' + TABLE_NAME + ''' as TableName;IF EXISTS(SELECT 1 FROM ' + TABLE_SCHEMA + '.[' + TABLE_NAME + ']) SELECT * FROM ' + TABLE_SCHEMA + '.[' + TABLE_NAME + '] --ELSE SELECT ''No records'' AS [' + TABLE_NAME + ']' + CHAR(13) | |
| FROM INFORMATION_SCHEMA.TABLES ORDER BY TABLE_NAME | |
| EXEC (@SQL) |
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
| Dim driver As WebDriver | |
| Sub ColetaDadosCorreios() | |
| Set driver = New ChromeDriver | |
| With driver | |
| .Get "http://www2.correios.com.br/sistemas/precosPrazos/" | |
| .FindElementById("data").SendKeys Format(DateAdd("d", 1, Now), "dd/MM/yyyy") | |
| .FindElementByName("cepOrigem").SendKeys "01310-200" 'MASP - São Paulo | |
| .FindElementByName("cepDestino").SendKeys "20021-200" 'Museu Nacional do Rio de Janeiro | |
| .FindElementByName("servico").AsSelect().SelectByText ("PAC") |
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
| 'source: https://qr.ae/TWs7hb | |
| 'author: Chip Pearson | |
| Sub SortWorksheets() | |
| Dim i As Long, j As Long, n As Long | |
| Dim ws As Worksheet | |
| Application.ScreenUpdating = False | |
| With ActiveWorkbook | |
| n = .Worksheets.Count | |
| If n > 1 Then | |
| For i = 2 To n |
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
| #Requires -RunAsAdministrator | |
| if((Get-NetAdapter -Name 'Wi-Fi').Status -ne 'Connected' -And (Get-NetAdapter -Name 'Wi-Fi').Status -ne 'Up') | |
| { | |
| Write-Output "Restarting Wi-Fi..." | |
| Disable-NetAdapter -Name 'Wi-Fi' -Confirm:$false -AsJob | Wait-Job | |
| Enable-NetAdapter -Name 'Wi-Fi'-Confirm:$false | |
| } | |
| else | |
| { | |
| Write-Output "Wi-Fi is Ok!" |
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
| name: Teste Script Lab - Coletando CEPs | |
| description: '' | |
| author: Tomamais | |
| host: EXCEL | |
| api_set: {} | |
| script: | |
| content: | | |
| $("#run").click(run); | |
| async function getAddressByCEP(CEP: string) { |
NewerOlder