x002548's Blog

Not Just a Number - Brett Kaiser
posts - 89, comments - 586, trackbacks - 39

March 2007 Blog Posts

Alias to be or not to be

  EDIT:  This is bizzare..I ran multiple table joins, and reran it ovr and over, and the times are always different and one time one is faster than the othe and other times it's the other wway around. We were having a discussion over at SQLTeam on whether to use full table name aliases or short aliases to label columns.  It always seemed to be a mattter of preference and debate on how self docuenting the code.  For m I will always use short aliases and make sure I lable every column, even if it's unique, just so when I come back...

posted @ Tuesday, March 27, 2007 2:59 PM | Feedback (2) | Filed Under [ SQL Server ]

Add Foreign Keys Back to the Database

"OK Brett, Now that I Removed all my Foreign Keys to Truncate the Data, Now What?  I'm Hosed!  Thanks a bunch" OK, Well....sorry to keep you hangng out there.  But, if you followed the code in the above link you will have all of the RI saved to the work table, so now all you need to do is replay it.  The following is the code that will do this for you.  Again, sorry for the delay. CREATE procedure isp_exec_FK_code   AS DECLARE @FKcode nvarchar(3000) DECLARE @error_out int, @Result_Count int, @Error_Message varchar(255), @Error_Type int, @Error_Loc int, @rc int SET NOCOUNT ON SELECT @rc = 0 DECLARE FKcode cursor fast_forward...

posted @ Thursday, March 01, 2007 9:49 AM | Feedback (0) | Filed Under [ SQL Gimmicks ]

Powered by:
Powered By Subtext Powered By ASP.NET