- 8 Week Game
- Quick Ref
Archive for December, 2008
Handy web.config value to know – in Dot net if you find everything being americanised when you're not expecting it try this in your web.config under the system.web section -
<globalization culture="en-GB" />
you can obviously replace this with any of the other standard country codes.
Posted by in SQL Server on December 8, 2008
I've recently inherited the integration support for a web project being built by a third party which is about to go live. Amongst the numerous odd's and ends which are being tied up are a bunch of SSIS packages which have been updated, but not run for some time. When the moment came to finally push the button, as is my luck, nothing happened.
The package clears a bunch of data from some book and author tables, then replaces it with nice fresh data from our internal data repository- the trouble is, the developer has a "shopping basket" and "shopping basket items" table, which had the "book id" from the books table as a foreign key- so in order to maintain referential integrity the DBMS (Sql 2000) moaned up when we tried to bin everything from the books table. The exact error i got was;
Error: DELETE statement conflicted with COLUMN REFERENCE constraint ‘FK_ShoppingBasketItem_Book’. The conflict occurred in database ‘BookDB’, table ‘ShoppingBasketItem’, column ‘BookID’.
Error: Executing the query “Delete from Book” failed with the following error: “The statement has been terminated.” Possible failure reasons: Problems with the query, “ResultSet” property not set correctly, parameters not set correctly, or connection not established correctly.
After having googled about for a bit it seems there is no nice way to do this- but the cleanest work around I could find was to disable the CHECK constraint before the package ran, then re-enable it when complete- the syntax was;
ALTER TABLE <Tablename> NOCHECK CONSTRAINT <constraint name>
ALTER TABLE <Tablename> WITH CHECK CHECK CONSTRAINT <constraint name>
For example, in my case;
ALTER TABLE ShoppingBasketItem NOCHECK CONSTRAINT FK_ShoppingBasketItem_Book
ALTER TABLE ShoppingBasketItem WITH CHECK CHECK CONSTRAINT FK_ShoppingBasketItem_Book
We have a couple of sharepoint install's here and I recently had an issue with the server running out of disk space- the server has not been up long and had around 60GB free, so this seemed a little strange. On investigation it seems the site had been indexing 100's of external websites for the purposes of searching, and it was these indexes which had consumed the space. Under content administration there is an option to reset the search indexes, but this option just hung when clicked. After much googling and messing around i eventually found the solution- I had to physically remote onto the desktop of the server, open the task manager and close the mssearch process- then from the front page of sharepoint ;
Click Site Settings >[under Search Setting and Indexed Content] click Configure Search and Indexing > [under Content Indexes] click Manage content indexes > highlight the erronious index so the menu prompt pops up, then from the menu select "Reset Content Index".
The trick is to make sure mssearch.exe isnt running as this seems to lock the files- be aware the server will try to restart the process when you close it!
Once you've cleared the index, you can then adjust the indexing settings to prevent it from happening in future.