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
| SELECT | |
| ser.heCode AS DOCSERIES, | |
| ser.heShortcut AS DOCSERIESSHORTCUT, | |
| ser.heName AS DOCSERIESNAME, | |
| typ.heCode AS DOCTYPE, | |
| typ.heName AS DOCTYPENAME, | |
| acc.heCode AS ACCTMP, | |
| acc.heName AS ACCTPMNAME, | |
| cmp.heName AS CMP, | |
| J.PLETHOS AS PLETHOS |
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
| SELECT | |
| heDocEntries.heDocCode Doc, | |
| heDocEntries.heofficialdate DocDate, | |
| CASE heDocEntries.heAccUpd | |
| WHEN ';1;' THEN 'Yes' | |
| ELSE 'No' | |
| END Accounting, | |
| heCompanies.heName Company, | |
| heDocSeries.heCode Code, | |
| hedocseries.hename Description, |
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
| SELECT | |
| ser.heCode AS DOCSERIES, | |
| ser.heShortcut AS DOCSERIESSHORTCUT, | |
| ser.heName AS DOCSERIESNAME, | |
| typ.heCode AS DOCTYPE, | |
| typ.heName AS DOCTYPENAME, | |
| acc.heCode AS ACCTMP, | |
| acc.heName AS ACCTPMNAME, | |
| cmp.heName AS CMP | |
| FROM heDocSeries AS ser |
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
| SELECT | |
| heDocEntries.HEDOCCODE AS Document, | |
| crUser.POUSERNAME AS CreateUser, | |
| updUsers.POUSERNAME AS UpdateUser | |
| FROM heDocEntries | |
| LEFT JOIN heUsers crHUsers | |
| ON heDocEntries.HECREATIONUSRSID = crHUsers.HEUSERID | |
| LEFT JOIN poUsers crUser | |
| ON crHUsers.HEUSERID = crUser.POID | |
| LEFT JOIN heUsers updHUsers |
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
| /* | |
| SQL Server Maintenance Solution - SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, SQL Server 2014, SQL Server 2016, and SQL Server 2017 | |
| Backup: https://ola.hallengren.com/sql-server-backup.html | |
| Integrity Check: https://ola.hallengren.com/sql-server-integrity-check.html | |
| Index and Statistics Maintenance: https://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html | |
| License: https://ola.hallengren.com/license.html |
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
| /* | |
| 1. Backup HeDocSeries | |
| */ | |
| INSERT INTO hedocseries_bak | |
| SELECT | |
| * | |
| FROM hedocseries | |
| /* | |
| * |
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
| -- Update sequence current value with max reference number | |
| -- example is for HEITEMS sequence | |
| DECLARE @refno int = (SELECT | |
| CAST(MAX(HEITEMS.herefnumber) AS int) | |
| FROM HEITEMS) | |
| DECLARE @inc int = (SELECT | |
| CAST(current_value AS int) | |
| FROM sys.sequences | |
| WHERE name LIKE 'HEITEMS%') |
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 @SearchStr nvarchar(100) | |
| SET @SearchStr = '48a95b8a-5636-e811-95a5-30e37a693c68' | |
| CREATE TABLE #Results ( | |
| ColumnName nvarchar(370), | |
| ColumnValue nvarchar(3630) | |
| ) | |
| SET NOCOUNT ON |
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
| -- Check DBs | |
| /* | |
| DECLARE @pylonVer varchar(20) -- current pylon ver | |
| -- specify current pylon version | |
| SET @pylonVer = '170432' | |
| SELECT | |
| name | |
| FROM master.dbo.sysdatabases |
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 -Version 4 | |
| $root = "C:\infomind" | |
| $sql = invoke-sqlcmd -Username sa -Password db_password -Database pylonchp -ServerInstance "SERVER\INSTANCE" -InputFile "$($root)\scripts\m-hospitality.sql" | Export-csv -Path "$($root)\file.csv" -Force -Encoding "UTF8" -NoTypeInformation | |
| #$json = convertto-json -inputobject $sql | |
| #$null = new-item -type file -force "$($root)\m-hospitality.json" -value $json | |
| #$null = convertto-json -inputobject $sql | Out-File "$($root)\file.json" | |
| #$csv = Export-csv -InputObject $sql -Path "$($root)\file.csv" -Force -Encoding "UTF8" | |
| # create the FtpWebRequest and configure it | |
| $ftp = [System.Net.FtpWebRequest]::Create("ftp://ftp.infomind.gr/chp.csv";;) | |
| $ftp = [System.Net.FtpWebRequest]$ftp |