Archive for the Windows Category

Oct 27 2024

Windows 11 / Windows 10 Download

Goto https://uupdump.net

Search  “23H2” (build number 22631)

Download and unpack files

Click uup_download_windows.cmd batch file and select the Run as administrator option.

After download use Rufus or other app to create bootable USB Drive

Oct 11 2024

Install Windows 11 24H2 on Unsupported Hardware

Get ISO fro https://www.microsoft.com/pl-pl/software-download/windows11
Mount iso
Windows+r “cmd”
select mounted drive ex.: D:
then
.setup.exe /product server
click “Change how to setup download updates” and select “Not right now”

Oct 11 2024

Enable Multiple RDP Sessions

Enable Multiple RDP Sessions

  1. Log into the server, where the Remote Desktop Services are installed.
  2. Open the start screen (press the Windows key) and type gpedit.msc and open it.
  3. Go to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections.
  4. Set Restrict Remote Desktop Services user to a single Remote Desktop Services session to Disabled.
  5. Double click Limit number of connections and set the RD Maximum Connections allowed to 999999.
Sep 9 2023

MSSQL restore all databases from folder with .bak files

Powershell

Install-Module dbatools
Import-Module dbatools
Set-DbatoolsInsecureConnection -SessionOnly
Restore-DbaDatabase -SqlInstance SERVER-NAME\INSTANCE-NAME -Path 'C:\PATH-TO-BACKUPS'
Sep 2 2023

MSSQL: User, group, or role ‘platnik’ already exists in the current database.

lists logins and incorrect SIDs
USE <platnik_db>
GO
EXEC sp_change_users_login 'Report'
GO

Then start SQL
USE <platnik_db>
GO
EXEC sp_change_users_login 'Auto_Fix','<user_name>',NULL, '<password>'
GO

Sep 2 2023

Delete multiple databases in MSSQL

drop databases query

USE master;
Go
SELECT 'DROP DATABASE ['+ name + ']'
FROM sys.databases WHERE name like 'PREFIX%';
GO
Aug 13 2023

Windows recovery

bootrec /scanos

bootrec /fixmbr

bootrec /fixboot

bootrec /rebuildbcd

Aug 9 2023

Deletes files older than 30 days

forfiles /p "C:\sql.arch" /s /m *.* /D -30 /C "cmd /c del /Q /S @path"

Jun 24 2023

Migracja bazy danych Płatnik z Access 32 bit na MS SQL Server

Instalujemy po kolei

Microsoft Visual C++ Redistributable

Microsoft OLE DB Driver 19 for SQL Server (x64)

Microsoft Access 2016 Runtime

Microsoft SQL Server Migration Assistant (SSMA) for Access

SQL Server Management Studio (SSMS)

Uruchamiamy Migration Assistant (SSMA) for Access

Pomijamy Kreatora

Tools -> Default Project Settings

Zmieniamy “Add timestamp column” na Never

Tools -> Project Settings -> Type Mapping

zmieniamy

date na datetimetext[*..*]
text[*..*] na varchar[*]
memo na varchar[max]

Odpalamy kreatora, wybieramy bazę źródłową <nazwa>.mdb bazę docelową na serwerze MSSQL i wykonujemy konwersję.

 

Uruchom SQL Server Management Studio (SSMS) i usuń ograniczenia dotyczące zerowej długości wszystkich pól

polecenie poniżej wyświetli kwerendę która to zrobi

SELECT
ctu.TABLE_CATALOG
,ctu.TABLE_SCHEMA
,ctu.TABLE_NAME
,ctu.CONSTRAINT_CATALOG
,ctu.CONSTRAINT_SCHEMA
,ctu.CONSTRAINT_NAME
,cc.CHECK_CLAUSE
,[drop_statement]= 'ALTER TABLE [' + ctu.TABLE_CATALOG + '].['+ ctu.TABLE_SCHEMA+ '].[' + ctu.TABLE_NAME + '] DROP CONSTRAINT [' + ctu.CONSTRAINT_NAME +'];'
FROM [platnik].[INFORMATION_SCHEMA].[CONSTRAINT_TABLE_USAGE] ctu
join [platnik].[INFORMATION_SCHEMA].[CHECK_CONSTRAINTS] cc on ctu.CONSTRAINT_NAME=cc.CONSTRAINT_NAME


 

Tworzenie konta dla Płatnika

Uruchom SQL Server Management Studio (SSMS)

Utwórz konto dla bazy docelowej

Security -> Logins

Przejdź do User Mapping i ustaw usera jako właściciela bazy

 


Podłączanie Płatnika

Podłączamy się pod serwer MSSQL używając MSSQL Server Authentication, podając usera i hasło

Jeśli dostaniemy błąd

to zmieniamy sterownik połączenia z MSOLEDBSQL na SQLOLEDB (w moim przypadku musiałem tak zrobić pomimo migracji na MSSQL 2014 Standard)

 

Program accesspassview do odzyskiwania hasła do pliku mdb

Jun 24 2023

SQL Server Configuration Manager

Version Path
SQL Server 2022 C:\Windows\SysWOW64\SQLServerManager16.msc
SQL Server 2019 C:\Windows\SysWOW64\SQLServerManager15.msc
SQL Server 2017 C:\Windows\SysWOW64\SQLServerManager14.msc
SQL Server 2016 C:\Windows\SysWOW64\SQLServerManager13.msc
SQL Server 2014 (12.x) C:\Windows\SysWOW64\SQLServerManager12.msc
SQL Server 2012 (11.x) C:\Windows\SysWOW64\SQLServerManager11.msc