Posts

Showing posts from May, 2021

How to change Sql Server name. A micro tips!

Image
Hello friends, Welcome back again! Last time we have a long post about Disassembling the SQL Server parser so today we have a very short post... Do you need to change the name of the instance of SQL Server? Easy! Let's step back Some days ago i was connected with a customer. I saw the name of the instance in the SSMS but if I execute a statement where the name of the server is explicited, like this: select * from [instancename]. [database]. [dbo]. [Table] I get the Error: Messaggio 7202, livello 11, stato 2, riga 10 Non รจ stato possibile trovare il server 'xxxxxx' in sys.servers. Verificare che sia stato specificato il nome corretto del server. Se necessario, eseguire la stored procedure sp_addlinkedserver per aggiungere il server a sys.servers. Where is the problem? If i execute the command  Select * from sys.sysservers The servaname columns return a name that's not equal to the name displayed by the SSMS   So, how to solve? As I sayd this is a very

Disassembling the SQL Server parser. The LGetToken procedure - part 1

Image
Happy Sunday my dear friends and welcome back to this blog! Today we will talk about the parser component of SQL Server. We keep disassemble the parser as we already done here: SQL Server, inside the parser: the Get_Gen_Lex procedure   SQL Server, A bit of reverse engineering inside the parser: the Parser and the GetChar procedure. (attention contains news published for the first time)   I don't think it has ever been done before and I don't even know if I will end up ...maybe I could probably write a book about it, who knows!  ...but today I want to show you a few interesting things. So start your management studio enter a simple select command, start a debugger like WINDBG ...and of course "happy reading"! The LGetToken procedure The LGetToken procedure is so defined: void LGetToken(uint **param_1,uint *param_2,ushort **param_3) The param_2 contain the pointer to the sql command. This procedure is called by the yylex procedure in order to parse the T-SQL commands