|
|
|
|
Browse by Tags
All Tags » Tips and Tricks (RSS)
-
This question came up today and here is one way of doing it. It requires running xp_cmdshell so this is probably not such a good idea.The problem with functions is that you cannot just insert into any table. INSERT, UPDATE, and DELETE statements modifying table variables local to the function.EXECUTE statements calling an extended stored ...
-
I answered this question on the MSDN forums: How can I search all my sprocs to see if any use a function? Several people suggested using sp_depends. You can't really depend on sp_depends because of deferred name resolution. Take a look at this
First create this proc
CREATE PROC SomeTestProc
AS
SELECT dbo.somefuction(1)
GO
now create this ...
-
A variation of this question popped up twice in the SQL programming newsgroup since yesterday, this means it is time for a blogpost.Let's say you have a proc like this
CREATE PROC prUpdateTable@Salesman int = -1AS..........If the user calls the proc like this exec prUpdateTable null then @Salesman will be null, if the user calls the proc like ...
-
It's pretty well understood that it's highly desirable to keep servers lean and mean. But what do you do when you need to use a tool, particularly if it is needed only once? You could install the utility application and then remove it, but that does introduce risk. Virtual applications provide the answer. You can actually run an application ...
-
This question is asked every now and then so I decided to do a little blog post. How can you quickly without writing a bunch of OR statements determince if any columns have a NULL value, a value of 0 or if the value is 0 or NULL?To test for NULL is very easy, you just concatenate the columns since NULL + anything else is always NULL. Okay that ...
-
Someone had code like this on the tek-tips forum
DECLARE @v varchar(24)
SELECT @v ='06029202400250029'
SELECT RIGHT(@v,4) -SUBSTRING(@v,10,4)
If you run this code, you will get the following message
Server: Msg 403, Level 16, State 1, Line 4Invalid operator for data type. Operator equals subtract, type equals varchar.
Instead of casting to ...
-
Drag And Drop Column Names In Query Analyzer you can save a lot of time by using this trick instead of typing all the column names of a table Hit F8, this will open Object Browser Navigate to DatabaseName/TableName/Columns Click on the column folder and drag the column folder into the Code Window Upon release you will see that all the column names ...
|
|
|
|
|