Bunch's Blog

One day I'll have a catchy subtitle, one day
posts - 87 , comments - 126 , trackbacks - 0

May 2012 Entries

SSMS Slow To Save
When using SSMS 2008 I found it to be really slow when trying to save a file, even a small one with just some simple SELECT statements on it. The symptoms were the flashing save disk icons in the lower right corner and selecting the location to save in the Save File dialog would hang each time I picked a location (e.g. Libraries, a folder). This was the first I had seen anything like this where it was really, really slow. It ended up that a server had died last week and I was still mapping a drive ......

Posted On Tuesday, May 29, 2012 1:52 PM | Comments (0) |

New Window Via JavaScript Clears Parent
This is not a new item at all but I came across it recently. For an app I had been using some JavaScript like: javascript:window.open(some... here) to open a new window via a button. That bit of code had been working great in several other apps. Then in one app that same code decided to open the new window correctly while clearing the parent of everything but [object]. The fix ended up being simple, change the javascript to: javascript:void(window.open... here); Then it worked like ......

Posted On Friday, May 25, 2012 1:28 PM | Comments (0) |

BoundField Formatting
If you have a GridView that uses BoundFields but does not display line breaks or a lot of spaces quite right here is a way to get around that. This example uses a GridView with one BoundField that uses a DataField of comments. The comments are stored in a database and entered from another page which displays the comments properly in a textbox with all the spaces and line breaks you intended. The trick to get a BoundField to show those items is to take the item and replace the \r\n with a <br /> ......

Posted On Wednesday, May 23, 2012 4:24 PM | Comments (0) |

Old SQL, Top and a Variable
I came across this the other day. Using SQL 2000 I could not get a Top statement to work with a variable. I had forgotten that only with SQL 2005 and higher could you do this trick. I found a good way around it, you can read about it here. Anyway this works on SQL 2000: declare @top intset @top = 5 BEGINset rowcount @top select Some_ID from tblStuffset rowcount 0END The code above would return the first five records from tblStuff. For any of the newer SQL Server version you can simply use the @top ......

Posted On Tuesday, May 15, 2012 1:48 PM | Comments (0) |

Searching SQL Server Objects
I came across this tool the other day and found it to be very useful. In the past if I needed to search within all the stored procedures or views in a database I would use some SQL to run a query using sysobjects and syscomments. That worked well but this is a bit slicker. The tool is redgate's SQL Search and it is available (for now at least) as a free stand alone tool. You can download it here. It supports SQL 2005 and later and I found it to integrate with the SSMS IDE well. It will add a red ......

Posted On Tuesday, May 8, 2012 9:41 AM | Comments (0) |

Powered by: