Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4267598
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:55:18+00:00 2026-05-21T06:55:18+00:00

Msg 245, Level 16, State 1, Line 89 Conversion failed when converting the varchar

  • 0

Msg 245, Level 16, State 1, Line 89
Conversion failed when converting the varchar value ‘There was an error creating the System.DirectoryServices assembly. ‘ to data type int.

This error is caused by the statement below:

begin try print '  - Preparing to create System.DirectoryServices assembly with UNSAFE_ACCESS permission'
    create assembly [System.DirectoryServices] from 'c:\Windows\Microsoft.NET\Framework\v2.0.50727\System.DirectoryServices.dll'
    with permission_set = unsafe
    print '  - System.DirectoryServices assembly created'
end try
begin catch
    print 'There was an error creating the System.DirectoryServices assembly. '+Error_number()+Error_Severity()
end catch
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:55:18+00:00Added an answer on May 21, 2026 at 6:55 am

    This is coming from your concatenation of number to string in the catch block. This is not allowed without casting as it tries to convert the string to number rather than vice versa and as your string literal is not numeric this attempt is doomed to fail!

    You can use RAISERROR with severity 0 to print the message with the values substituted in or the alternative is to concatenate the string yourself using explicit casts.

    begin catch
    declare @num int = Error_number()
    declare @sev int = Error_Severity()
    raiserror('There was an error creating the System.DirectoryServices assembly. %d %d ',0,1, @num,@sev)
    end catch
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Msg 701, Level 17, State 123, Line 1 There is insufficient system memory to
I get the error: Msg 2714, Level 16, State 1, Line 16 There is
Msg 8114, Level 16, State 5, Procedure spGetDetails, Line 88 Error converting data type
I get Msg 8114, Level 16, State 5, Procedure DetayliArama, Line 0 Error converting
error list Msg 4866, Level 16, State 7, Line 2 The bulk load failed.
I am getting this error: Msg 201, Level 16, State 4, Procedure NewEmployee, Line
Msg 547, Level 16, State 0, Line 1 The INSERT statement conflicted with the
Msg 7302, Level 16, State 1, Line 13 Cannot create an instance of OLE
I have this message Msg 6603, Level 16, State 17, Line 38 in the
Msg 1086, Level 15, State 1, Line 20 The FOR XML clause is invalid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.