SQL Server Performance

SQL/CLR debugging in VS 2005

Discussion in 'SQL Server 2005 General DBA Questions' started by dwivedialok, Dec 14, 2004.

  1. dwivedialok New Member

    I am trying to debug a stored procedure written in CLR (and deployed on to SQL Server 2005) using Visual Studio 2005, but it doesn#%92t works at all. I have created a very simple SQL Server project through VS2K5. It has got just one simple SP. If I build and deploy the project everything goes fine i.e. assembly and SP get registered with SQL server 2005 (I can also confirm that .pdb file is in sys.assembly_files table). Also I have enabled ‘Allow SQL/CLR debugging#%92 option for SQL connection used for this project. Also under ‘Debug#%92 section of project properties (Rt Click ‘Project#%92 -> Properties) I have checked the ‘SQL Server debugging#%92 under ‘Enable debuggers#%92. But in spite of all these settings my BP is not hit. I have also ensured the ‘Test.sql#%92 debug script is correctly calling the CLR written SP. Also I can see in debug output window that SQL Server is auto-attached, DLLs loaded and SP is executed. But no BP is hit. I can also results of SP in ‘Database output#%92 window.
    The normal debugging works fine i.e. .Net assembly methods invoked through Windows.Net application or through other .Net assemblies. It#%92s only CLR/SQL debugging that#%92s not working.

    So everything is done as mentioned in standard procedures for debugging CLR/SQL code. But nothing is working. Now only thing that I feel worth mentioning here is that I have got SQL Server 2000 also installed on same machine and I am running a named instance of SQL Server 2005. Also I have got .Net Framework 1.1.4 (other than 2.0) also installed on the same machine.

    Can anyone please suggest whats going wrong here and why I can#%92t debug CLR/SQL code?

    Regards,
    Alok
  2. Adriaan New Member

    In SQL 2K you cannot debug against a named instance, only on the default installation. Could be the same with SQL 2005?
  3. dwivedialok New Member

    Now I have uninstalled SQL Server 2000 and am running SQL Server 2005 as the default instance but its still the same. Everything is fine except not being able to debug SQL/CLR code. Another point I want to mention is that my OS is WinXP with latest SP. So can there be any security issues here? Any help/suggestions would be highly appreciated.

    Thanks
    Alok



    quote:Originally posted by Adriaan

    In SQL 2K you cannot debug against a named instance, only on the default installation. Could be the same with SQL 2005?
  4. dwivedialok New Member

    I have finally managed to find out why debugging was not working and thought I will post my observation in case someone finds himself in the same problem. My SQL server had a default binary collation. So all the database are created with binary collation. For some reason debugging is not working for case sensitive databases(it could be due binary collation preventing SQL server from loading correct debug symbols from debug info pdb file or may be something else) . If I change the collation of that database to case insensitive then it all works fine.

    Thanks
    Alok

Share This Page