Manage Unicode Characters in Data Using T-SQL

source: SQLShack Skip to contentSQL Server trainingEspañol Manage Unicode Characters in Data Using T-SQL November 7, 2019 by Jignesh Raiyani In this article, I’ll provide some useful information to help you understand how to use Unicode in SQL Server and address various compilation problems that arise from the Unicode characters’ text with the help of T-SQL.
Read More »

How to find NT Service\MSSQLSERVER and NT Service\SQLSERVERAGENT accounts?

fonte: You have installed SQL Server and it is up and running without any issue. Later, you need to change some permission given to either SQL Server engine or agent. You look for accounts, searched in local users, searched in local groups but you cannot find them. Are you experiencing above issues? If yes, first understand the what are these
Read More »

SQL Server – Recuperare il Product Key da una installazione esistente

fonte: A volte può essere necessario recuperare il Product Key del proprio SQL Server da una installazione esistente: il caso più comune è quello di un Server di una certa età del quale si è perso ogni ricordo di configurazione e che si ha improvvisamente necessità di trasferire altrove, ma può anche capitare di smarrire semplicemente
Read More »

How to grant insert in a table that is in another database on SQL Server 2008 R2?

fonte: Use [DatabaseA] GO ALTER DATABASE [DatabaseA] SET DB_CHAINING ON GO Use [DatabaseB] GO ALTER DATABASE [DatabaseB] SET DB_CHAINING ON GO EXEC sp_grantdbaccess 'UserB'; GO GRANT SELECT, UPDATE on [DatabaseB].[dbo].[TableA] TO [UserB] GO

How to run 32-bit UDL file on a 64-bit Operating System

fonte: We’ll need to  execute the command below from a command line or Start/Run :   C:\Windows\syswow64\rundll32.exe “C:\Program Files (x86)\Common Files\System\Ole DB\oledb32.dll”,OpenDSLFile C:\test.udl   Check the paths of rundll32.exe and oledb32.dll while running this command!   Here you have your 32 bit OLE DB Providers.

Rimuove spazi in eccesso da stringa SQL

fonte: SELECT REPLACE(REPLACE(REPLACE('some string with many spaces' , ' ', ' ' + CHAR(7) + CHAR(7)), CHAR(7) + CHAR(7) + ' ', ''), ' ' + CHAR(7) + CHAR(7), ' ') AS NewStr --but it remove CHAR(7) + CHAR(7) from string How it works: Caution: Char/string used to replace spaces shouldn’t exist on begin or
Read More »

Esportazione dati da SQL a file posizione fissa

Fonte: Exporting data from SQL Server to Fixed Position Flat file Just as usual, this post is kind of “Bi-product” of my attempt to create a demo for another post in which I need to use fixed position file. At first I tried to create a fixed position file using BCP. BCP has query out
Read More »

Using sp_change_users_login to fix SQL Server orphaned users