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
<?php | |
/*********************************************************** | |
MYSQL VERSION | |
************************************************************/ | |
$username="root"; $password=""; $database="exam_codes"; | |
$con = mysql_connect("localhost",$username,$password) or die( "Unable to Connect database"); | |
mysql_select_db($database,$con) or die( "Unable to select database"); | |
// Table Name that you want | |
// to export in csv |
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
<?php | |
// requiring autoload with the pluguin | |
require __DIR__ . '/../../vendor/autoload.php'; | |
// invoking needed classes | |
use PhpOffice\PhpSpreadsheet\Spreadsheet; //class responsible to change the spreadsheet | |
use PhpOffice\PhpSpreadsheet\Writer\Xlsx; //class that write the table in .xlsx | |
$spreadsheet = new Spreadsheet(); //instanciando uma nova planilha |
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
-- Orinal em Mysql : https://www.ricardoarrigoni.com.br/cidades-brasil-lista-de-cidades-brasileiras-em-sql/ | |
-------------------------------------------- | |
--> Scrip abaixo cria estrutura de Pais > Estado > Cidade | |
-------------------------------------------- | |
-- < Cria tabela de países > -- | |
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[paises]') ) | |
DROP TABLE paises; -- < Dropa a tabela se já existir > -- | |
CREATE TABLE paises ( |
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 @XML XML | |
SET @XML = '<rows><row> | |
<transacao> | |
<IdInvernadero>8</IdInvernadero> | |
<IdProducto>3</IdProducto> | |
<cars> | |
<id>z</id> | |
<test> oi</test> | |
</cars> | |
<IdCaracteristica1>8</IdCaracteristica1> |
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
var foco = ""; | |
var msgstatus = ""; | |
// fonte: http://www.receita.fazenda.gov.br/aplicacoes/atcta/cpf/funcoes.js | |
/************************************************* | |
Função que permitir digitar numeros | |
**************************************************/ | |
function EntradaNumerico(evt) { | |
var key_code = evt.keyCode ? evt.keyCode : | |
evt.charCode ? evt.charCode : |
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://www.sqlservercentral.com/scripts/run-sqlt-sql-scripts-on-folder | |
:: A bat script to run all the sql/t-sql scripts in a specific folder. | |
:: | |
:: Features: | |
:: | |
:: - Using SQLCMD for running the scripts. | |
:: | |
:: - Logging the results of your sql to a file per script. | |
:: | |
:: - Input for scripts and log folders. |
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
/* | |
Solução pro erro: | |
Mensagem 1755, Nível 16, Estado 0, Linha 22 | |
Não podem ser criados padrões em colunas de carimbo de data/hora do tipo de dados. Tabela 'STG_MSAF_SALES_HEADER', coluna 'created_timestamp'. | |
Mensagem 1750, Nível 16, Estado 0, Linha 22 | |
Não foi possível criar a restrição ou o índice. Consulte os erros anteriores. | |
quando feito: | |
ALTER TABLE STG_MSAF_SALES_HEADER ADD created_timestamp timestamp default getdate() |
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/662383/better-techniques-for-trimming-leading-zeros-in-sql-server/662437#662437 | |
SELECT SUBSTRING(IDCLIENTE, PATINDEX('%[^0]%', IDCLIENTE+'.'), LEN(IDCLIENTE)) ,* FROM TB_IN_SAP_CUSTOMER WHERE CNPJ IN ( 'zzzzzz') |
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 this solution when we need to do an action when the request is finished | |
var myPromise = function(){ | |
return new Promise(function(resolve,reject){ | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET','https://api.github.com/users/brunotdantas'); | |
xhr.send(null); // if you have any parameters to complement the request | |
xhr.onreadystatechange = function(){ | |
if(xhr.readyState === 4){ |
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
-- #tags #sql #backup #bkp #sqlcmd #scheduler #windows | |
-- run this via batch | |
-- sqlcmd -S localhost -U [username] -P [password] -d master -Q "exec sp_BackupDatabases '[databaseName]','[typeOfBackup]', '[directoryToSaveData]'" | |
-- https://support.microsoft.com/en-us/help/2019698/how-to-schedule-and-automate-backups-of-sql-server-databases-in-sql-se | |
-- ============================================= | |
-- Author: Microsoft | |
-- Create date: 2010-02-06 | |
-- Description: Backup Databases for SQLExpress |
OlderNewer