SQL SERVER – Fix : Error: 18452 Login failed for user ‘(null)’. The user is not associated with a trusted SQL Server connection.

Some errors never got old. I have seen many new DBA or Developers struggling with this errors. Error: 18452 Login failed for user ‘(null)’. The user is not associated with a trusted SQL Server connection. Fix/Solution/Workaround: Change the Authentication Mode of the SQL server from “Windows Authentication Mode (Windows Authentication)”…
Read More

SQL SERVER – Fix : Error: 3902, Severity: 16; State: 1 : The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.

SQL Server Integration Services Error : The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION. (Microsoft OLE DB Provider for SQL Server) Fix/Workaround/Solution: Option 1: To work around this problem, do not call the stored procedure by using ODBC Call syntax. You can call the stored procedure in may ways…
Read More

SQL SERVER – UDF – User Defined Function to Extract Only Numbers From String

Following SQL User Defined Function will extract/parse numbers from the string. CREATE FUNCTION ExtractInteger(@String VARCHAR(2000)) RETURNS VARCHAR(1000) AS BEGIN DECLARE @Count INT DECLARE @IntNumbers VARCHAR(1000) SET @Count = 0 SET @IntNumbers = '' WHILE @Count <= LEN(@String) BEGIN IF SUBSTRING(@String,@Count,1) >= '0' AND SUBSTRING(@String,@Count,1) <= '9' BEGIN SET @IntNumbers =…
Read More