-
we have a number of batch scripts at work which executes sql-related tasks for each of our project releases. last time, i incorporated errorlevel checks so we know if there was a problem with the execution and in order to abort the rest of the operations if something else has gone wrong. i was surprised...
-
you want to know the queries being executed by your application which uses ADO.NET. sql profiler comes in. however you got agents running (whatever they are), you also browse the tables using Enterprise Manager or Visual Studio and you want them to be excluded in the watch list. Filter is the key, Under...
-
I have read a number of books/articles and I wonder why they always use the global variable @@IDENTITY in obtaining the generated identity after an INSERT operation. They should be using SCOPE_IDENTITY() instead which is safer due to triggers. With SCOPE_IDENTITY(), is there really a use for @@IDENTITY...
-
i just got back from an interview with another local company after being invited by their CEO to explore my opportunities with them. it was unexpected that i scheduled for an interview today and you can find the reason on my personal blog (if you have the link). exam was not that hard and what caught...
-
during development, i always make use of backup-restore of test data and restoring a database requires that there is no other active connection to it. i have these three ways to deal with it. 1. use sp_who2 to determine the spid (what is spid again?) of connections to the database to be restored then...
-
i got tired of dealing with the text data type column used by the dba for optional fields in our DB like remarks and description. i keep getting errors in concatenation and specifically for union queries involving a field with the said data type since it could not perform a select distinct implicitly...
-
Basically I have this nullable column which I wanted to filter my resultset from. Let's take the authors table of the pubs database as an example. SELECT * FROM authors where au_fname = ISNULL(@firstname, au_fname) Seeing the query this way, I thought there is no problem since if the @firstname parameter...
-
Wasn't really familiar with this feature of SQL Server until today. I have a 4-character field (BidTypeID) in SQL server which actually contains integers (pardon the design issues here people) which i have configured as flaggable enumerations in C#. My stored procedure filtering looks somewhat like this...
-
i have been using profiler to easily monitor the commands being issued to our development database server. i haven't really read anything about it (aside from the autoscroll button post of the sql godess). i wanted to just filter commands being issued by my workstation so i posted a query on the sql...
-
I have been wanting to put stored procedures in our current project under source control. Although changes to SPs will be minimal, we all know what we can get when we keep history of parts of our code and the ease of comparing them side by side. Searching usenet as usual, it brought me to this KB: How...
-
I have just updated my SQL 2000 BOL for the first time and so far, I have noticed the annotations which are majority perf issues (my major concern in programming). You might just want to update yours as well... http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
-
Just bumped into a stored procedure made by a teammate using just a JOIN operator on two tables: FROM authors JOIN titleauthors ON ... Confused me a bit until I asked her what it does and she told me that it defaults to an INNER JOIN operation. As usual (I don't trust anyone regarding tech information...
-
The SQL Profiler is one of the tools that I used in monitoring an SQL Server. The problem I have before was since I always watch the central database during development, I just want to watch a specific block of execution so I use the Pause or Stop buttons. I just read SQL Goddess’ blog entry about this...