System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'SqlEdition'.

mpkingukmpkinguk Posts: 1 New member
Hello, get the above error when trying to run my sql test.

I do not have this column in the test, nor any of its associated files, so figure this is a redgate thing. 

Looks like it is coming from tSQLt.Private_Init:

Any assistance would be appreciated.



  • Eddie DEddie D Posts: 1,720 Rose Gold 5
    edited December 7, 2018 1:22PM

    Thank you for your forum post.

    What version of SQL Test are you using?
    Also the Version of SSMS and the SQL Server of the database being tested?

     tSQLt.Private_Init is installed as part of the tsqlt framework which essentially is this Stored Procedure:

    <div>CREATE PROCEDURE [tSQLt].[Private_Init]</div><div>AS</div><div>BEGIN</div><div>&nbsp; EXEC tSQLt.Private_CleanTestResult;</div><div><br></div><div>&nbsp; DECLARE @enable BIT; SET @enable = 1;</div><div>&nbsp; DECLARE @version_match BIT;SET @version_match = 0;</div><div>&nbsp; BEGIN TRY</div><div>&nbsp; &nbsp; EXEC sys.sp_executesql N'SELECT @r = CASE WHEN I.Version = I.ClrVersion THEN 1 ELSE 0 END FROM tSQLt.Info() AS I;',N'@r BIT OUTPUT',@version_match OUT;</div><div>&nbsp; END TRY</div><div>&nbsp; BEGIN CATCH</div><div>&nbsp; &nbsp; RAISERROR('Cannot access CLR. Assembly might be in an invalid state. Try running EXEC tSQLt.EnableExternalAccess @enable = 0; or reinstalling tSQLt.',16,10);</div><div>&nbsp; &nbsp; RETURN;</div><div>&nbsp; END CATCH;</div><div>&nbsp; IF(@version_match = 0)</div><div>&nbsp; BEGIN</div><div>&nbsp; &nbsp; RAISERROR('tSQLt is in an invalid state. Please reinstall tSQLt.',16,10);</div><div>&nbsp; &nbsp; RETURN;</div><div>&nbsp; END;</div><div><br></div><div>&nbsp; IF((SELECT SqlEdition FROM tSQLt.Info()) <> 'SQL Azure')</div><div>&nbsp; BEGIN</div><div>&nbsp; &nbsp; EXEC tSQLt.EnableExternalAccess @enable = @enable, @try = 1;</div><div>&nbsp; END;</div><div>END;</div>

    Are you able to execute the stored procedure manually (Right click the procedure >Execute Stored Procedure)?

    Many Thanks
    Eddie Davis
    Product Support Engineer
    Redgate Software Ltd
    Email: [email protected]
Sign In or Register to comment.