-
UPDATE : It seems Community Server stripped the actual CHAR(160) in @someStringWithPad, just so that it will be contrived append CHAR(160) at the @someStringWithPad variable. ;) Ever experienced trying the following code to trim a seemingly "space" padded string? DECLARE @someStringWithPad...
-
I was asked by a friend of mine on how to create a trigger that would trace the changes that a user did to a table. So i checked my bookmarks and give him this link http://www.nigelrivett.net/SQLTriggers/Triggers_2_Creating_Audit_Trails.html Hope to Get some of your opinions or maybe improvements on...
-
Here's an update to my blog entry 3 years ago regarding the same topic: ---Calculates the first day of the previous month SELECT DATEADD (mm, DATEDIFF (m, 0, GETDATE ()) - 1, 0) AS [First day of the previous month ] ---Calculates the first day of current month SELECT DATEADD (mm, DATEDIFF (m, 0,...
-
[This 3-part series was written by Douglas Reilly who died early 2007. The articles were written in February to June of 2006.] This is the Part I of the series: The Value of Conferences And here is the Part II : The Benefit of Foru m Finally, Part III : Importance of Books and the Constant Change Author...
-
Its been months since i have'nt posted anything haha. I was addicted to photography indeed. Http://HumpreyCogay.BlogSpot.Com Any way i want to share one of my problems then. I've been coding SQL Querries for SQL Server for several years now, but working for the bank we use AS400 DB2 as a main...
-
[Description from website:] The Microsoft SQL Server support team uses several internally-written utilities to make it easier to work on a typical customer support case. These utilities may also be useful to database developers and system administrators who work with Microsoft SQL Server 2000 and Microsoft...
-
Suppose that you need to populate record set from a stored procedure. This is how it's being done: CREATE PROC NameList AS SET NOCOUNT ON SELECT Emp_FNAME, Emp_LNAME From Emp_Table SELECT FName, LName From Table_of_Names RETURN When you execute this Stored Proc, it gives you something like this:...
-
My New Year's Resolution List: 1. Prepare For The MCTS-SQL Server 2005 Certification (70-431) 1.a Self-Paced Training (Training Kit + Videos Lessons) 2. Prepare For The OCA Exam (1Z0-042) 2.a Review Oracle 10g Architecture and Administration 2.b Attend Class For the Oracle 10g Backup and Recovery...
-
I wrote an article a few years ago using SQL SMO and just realized today that I can also list SQL Severs without importing an additional assembly to my project ( Microsoft.SqlServer.Management.Smo ) by using the SqlDataSourceEnumerator class . SqlDataSourceEnumerator is a class that provides a mechanism...
-
I have been thinking for a good solution on how to avoid the dynamic SQL in stored procedure for a while and I am happy that I got one. In my opinion, dynamic SQL statements are ugly, error-prone, difficult to maintain and hard to read especially if you have tons of conditional statements. For example...
-
While Sql Server provides functions to manipulate datetime data types(DateDiff, DateAdd etc.) they don't have(as far as I know) functions to manipulate time. Very useful when computing time differences. In the past I had to manually datediff parts of the time(hh:mm:ss) which wasn't scalable especially...
-
In one of the website I have developed, we feature random products displayed on a webpart. This can be done several ways either of the code behind or via t-sql but I think the simplest way to do it is via t-sql with the help of Guid columns. Globally Unique Identifier or GUID is a randomly generated...
-
Previously jokiz bloged about this one , I'd like to add further. The same issue cropped up again in the forums although not the exactly the same as jokiz's experience, this one could really give you hours of head scratching. Previously I was amazed that dynamic ORDER was possible with T-SQL without...
-
Here's a tool that im using for some of my projects. What it does is it Automate the Generation of Stored Procedures for Your Database. You just have to execute a querry like this EXEC pr__SYS_MakeUpdateRecordProc 'Order_Details', 1 and it will automatically generate a stored procedure for the table...
-
During my last post try to query the actual size of the logfile, and today i'm going to share a script i found months ago at the microsoft site. I cant find the original link.... Notes: Be sure that you have a backup of your database so that if something goes wrong you have something to get back into...