Home Database Mysql Tutorial SQLSERVER2005调试存储过程跟函数

SQLSERVER2005调试存储过程跟函数

Jun 07, 2016 pm 05:43 PM
function storage debug process

SQLSERVER2005调试存储过程跟函数 以前一直用Toad for SqlServer 和Database.Net来调试SQL2005的存储过程跟函数 Toad for SqlServer介绍以及下载:toad for sqlserver5.7 Database.Net介绍以及下载:Database .NET 8.0 发布,数据库管理工具 今日发现原来上

SQLSERVER2005调试存储过程跟函数

以前一直用Toad for SqlServer 和Database.Net 来调试SQL2005的存储过程跟函数

Toad for SqlServer介绍以及下载:toad for sqlserver5.7

Database.Net 介绍以及下载:Database .NET 8.0 发布,数据库管理工具

今日发现原来上面两个工具的功能,虚拟主机,微软的Visual Studio也可以做到

本来微软自家的Visual Studio就支持调试SQLSERVER的存储过程跟函数,美国空间,我竟然用了第三方工具,而且这些第三方工具也不是很好用

微软在SQLSERVER Management Studio2008里才集成了TSQL调试功能,那么SQL2005只有用VS来调试了

幸亏VS调试TSQL也不是很复杂

我的环境:VS2008 TeamSystem  ,  SQL2005 个人开发版 ,   Windows7 Ultimate

我使用的工具还是比较落后

step1:打开Visual Studio2008,然后点击菜单 视图-》服务器资源管理器

最好以管理员身份登录操作系统,打开VS的时候一般就以管理员的身份运行了

step2:在数据连接那里 右键-》添加连接

step3:数据源那里选择SQLSERVER就可以了

step4:选择你本地的数据库不要选择局域网或者广域网里的数据库,因为Windows安全问题的原因你是调试不了的只能执行

joe是我的笔记本电脑的计算机名,joe-homepc是局域网里另一台计算机的计算机名

 

选择好了之后点击“测试连接” ,没有问题就可以点击“确定”按钮了

 

step5:打开存储过程或者函数的树节点,然后找一个存储过程或者函数进行调试

step6:调试函数,调试的时候无论是存储过程还是函数,都会直接跳过变量定义部分进入函数或存储过程主体来执行

只有当TSQL语句运行的时候才会中断到断点的地方

 

step7:调试存储过程

 

 当你调试远程SQL服务器的时候,VS就会报错,就像你写C#的时候是调试不了远程电脑上的代码的

 

 

不过个人觉得调试如果能看到表数据就最好了,调试的时候varchar nvarchar int  datetime这些数据都可以看到

但是表的内容,无论是临时表,虚拟主机,表变量,表都是无法看到数据的,如果你想查看中途我插入到@temp表变量里的数据是看不到的

包括Toad for SqlServer 这些工具也是没办法看到的,个人觉得这是一个缺点

最后给大家一个函数,这个函数的作用就是切割字符串,大家可以用来调试一下

.(@string varchar(6000)) (substr varchar(30)) (6000) ((@string)) () () (,len(@string)) (ltrim(@str)) (ltrim(@string))

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Detailed explanation of C++ function debugging: How to debug problems in multi-threaded functions? Detailed explanation of C++ function debugging: How to debug problems in multi-threaded functions? May 02, 2024 pm 04:15 PM

C++ multi-thread debugging can use GDB: 1. Enable debugging information compilation; 2. Set breakpoints; 3. Use infothreads to view threads; 4. Use thread to switch threads; 5. Use next, stepi, and locals to debug. Actual case debugging deadlock: 1. Use threadapplyallbt to print the stack; 2. Check the thread status; 3. Single-step the main thread; 4. Use condition variables to coordinate access to solve the deadlock.

How to use LeakSanitizer to debug C++ memory leaks? How to use LeakSanitizer to debug C++ memory leaks? Jun 02, 2024 pm 09:46 PM

How to use LeakSanitizer to debug C++ memory leaks? Install LeakSanitizer. Enable LeakSanitizer via compile flag. Run the application and analyze the LeakSanitizer report. Identify memory allocation types and allocation locations. Fix memory leaks and ensure all dynamically allocated memory is released.

Shortcut to golang function debugging and analysis Shortcut to golang function debugging and analysis May 06, 2024 pm 10:42 PM

This article introduces shortcuts for Go function debugging and analysis, including: built-in debugger dlv, which is used to pause execution, check variables, and set breakpoints. Logging, use the log package to record messages and view them during debugging. The performance analysis tool pprof generates call graphs and analyzes performance, and uses gotoolpprof to analyze data. Practical case: Analyze memory leaks through pprof and generate a call graph to display the functions that cause leaks.

Complete collection of excel function formulas Complete collection of excel function formulas May 07, 2024 pm 12:04 PM

1. The SUM function is used to sum the numbers in a column or a group of cells, for example: =SUM(A1:J10). 2. The AVERAGE function is used to calculate the average of the numbers in a column or a group of cells, for example: =AVERAGE(A1:A10). 3. COUNT function, used to count the number of numbers or text in a column or a group of cells, for example: =COUNT(A1:A10) 4. IF function, used to make logical judgments based on specified conditions and return the corresponding result.

How to conduct concurrency testing and debugging in Java concurrent programming? How to conduct concurrency testing and debugging in Java concurrent programming? May 09, 2024 am 09:33 AM

Concurrency testing and debugging Concurrency testing and debugging in Java concurrent programming are crucial and the following techniques are available: Concurrency testing: Unit testing: Isolate and test a single concurrent task. Integration testing: testing the interaction between multiple concurrent tasks. Load testing: Evaluate an application's performance and scalability under heavy load. Concurrency Debugging: Breakpoints: Pause thread execution and inspect variables or execute code. Logging: Record thread events and status. Stack trace: Identify the source of the exception. Visualization tools: Monitor thread activity and resource usage.

PHP Debugging Errors: A Guide to Common Mistakes PHP Debugging Errors: A Guide to Common Mistakes Jun 05, 2024 pm 03:18 PM

Common PHP debugging errors include: Syntax errors: Check the code syntax to make sure there are no errors. Undefined variable: Before using a variable, make sure it is initialized and assigned a value. Missing semicolons: Add semicolons to all code blocks. Function is undefined: Check that the function name is spelled correctly and make sure the correct file or PHP extension is loaded.

C++ Function Exception Advanced: Customized Error Handling C++ Function Exception Advanced: Customized Error Handling May 01, 2024 pm 06:39 PM

Exception handling in C++ can be enhanced through custom exception classes that provide specific error messages, contextual information, and perform custom actions based on the error type. Define an exception class inherited from std::exception to provide specific error information. Use the throw keyword to throw a custom exception. Use dynamic_cast in a try-catch block to convert the caught exception to a custom exception type. In the actual case, the open_file function throws a FileNotFoundException exception. Catching and handling the exception can provide a more specific error message.

How to debug PHP asynchronous code How to debug PHP asynchronous code May 31, 2024 am 09:08 AM

Tools for debugging PHP asynchronous code include: Psalm: a static analysis tool that can find potential errors. ParallelLint: A tool that inspects asynchronous code and provides recommendations. Xdebug: An extension for debugging PHP applications by enabling a session and stepping through the code. Other tips include using logging, assertions, running code locally, and writing unit tests.

See all articles