background preloader

SQL

Facebook Twitter

How to: Step into an Object Using Server Explorer. This topic applies to: Table legend: The following procedure describes how to debug a database object by stepping into it with the Visual Studio Server Explorer. This method of SQL debugging is known as Direct Database Debugging, and can be done in Visual Studio outside of any project if need be. You can step into stored procedures and user-defined functions (UDFs). To debug any other object, you must reference it from a stored procedure or UDF, or cause it to fire, in the case of triggers, and start debugging by stepping into the procedure or function. To step into an object by means of Server Explorer. 2005 2000 – Search String in Stored Procedure.

SQL Server has released SQL Server 2000 edition before 7 years and SQL Server 2005 edition before 2 years now. There are still few users who have not upgraded to SQL Server 2005 and they are waiting for SQL Server 2008 in February 2008 to SQL Server 2008 to release. This blog has is heavily visited by users from both the SQL Server products. I have two previous posts which demonstrate the code which can be searched string in stored procedure. Many users get confused with the script version and try to execute SQL Server 2005 version on SQL Server 2000, they do send me email or leave comment that this does not work. I am going to list both the post here with clearly indicating the SQL Server version. I am sure this will clear some of the doubts. Related Articles: SQL SERVER – 2005 – Search Stored Procedure Code – Search Stored Procedure Text SQL SERVER – Find Stored Procedure Related to Table in Database – Search in All Stored procedure Reference: Pinal Dave (

A Developer's Blog · Adding an Else to your Switch. In this short article I will be talking about two functions in the SQL Server Reporting Services (SSRS) function stack. Those functions are IIF() and Switch(). And I’ll be showing you how easy it is to add an Else part to the Switch function. Two commonly-used functions in Reporting Services are the IIF() and the Switch(). These are two functions of the Program Flow type, or Decision Functions as they are called on this MSDN page. In case you’re wondering why it’s so difficult to find a function reference for the built-in functions of SSRS, it’s because these are actually Visual Basic functions and Microsoft refers to those for any detailed explanation.

Click this link for the IIF() function in the Visual Basic Language Reference, and this one for the Switch(). Anyone who’s done some programming most likely already knows the if <expression> then <some_code> else <other_code> statement. The IIF() works in the same way. This is its definition: Here’s a simple example: =IIf(Fields! Valentino. Management Studio - Searching text of views, stored procedures, functions, etc. COUNT() and GROUP BY : Count « Select Clause « SQL / MySQL. SQL Cheat Sheet: Query By Example. Structured Query Language (SQL) is a set-based language as opposed to a procedural language. It is the defacto language of relational databases. The difference between a set-based language vs. a procedural language is that in a set-based language you define what set of data you want or want to operate on and the atomic operation to apply to each element of the set.

You leave it up to the Database process to decide how best to collect that data and apply your operations. In a procedural language, you basically map out step by step loop by loop how you collect and update that data. There are two main reasons why SQL is often better to use than procedural code. do until eof if rs("state") = "NH" then rs("salesperson") = "Mike" end if rs.next loop The SQL way would be: UPDATE customers SET salesperson = "Mike" WHERE state = "NH" If you had say 2 or 3 tables you need to check, your procedural quickly becomes difficult to manage as you pile on nested loop after loop. Value Insert.