Add columns to t-sql table


ALTER TABLE ModelDataByID

ADD

A_DebtFeesRate decimal(11, 2) NULL,
A_CcaFeesRa decimalte (11, 2) NULL,
A_ExchangeDate decimal NULL,
A_ConditionalDate decimal NULL,
A_CompletionDate decimal NULL

OR

ALTER TABLE [User] ALTER COLUMN Internal_External varchar (20);

that’s it.
RuSs

Advertisements

Finding Duplicates with SQL

Info was found here:
http://www.petefreitag.com/item/169.cfm

Here's a handy query for finding duplicates in a table. Suppose you

want to find all email addresses in a table that exist more than once:

SELECT email,
COUNT(email) AS NumOccurrences
FROM users
GROUP BY email
HAVING ( COUNT(email) > 1 )

You could also use this technique to find rows that occur exactly once:

SELECT email
FROM users
GROUP BY email
HAVING ( COUNT(email) = 1 )

RuSs

How to install WSS and MOSS SP1

Thanks to the Sharepoint farmer’s almanac for this:

http://msmvps.com/blogs/shane/archive/2007/12/14/how-to-install-wss-and-moss-sp1.aspx

Service Pack 1 for SharePoint is here. The SharePoint Team blog has a great full length article on all of fixes and tweaks. You can read it here Announcing the Release of WSS 3.0 SP1 and Office SharePoint Server 2007 SP1.

This post is just meant to give you the easy version of the install instructions. If you have complex scenarios or have issues I highly recommend you read Planning and deploying SP1 for Microsoft Office SharePoint Server instead of my instructions. Cool?

Ok here is my setup that I am about to patch. Server 1 is the SQL 2005 SP2 database box. Server 2 is a Windows Server 2003 SP2 with MOSS 2007 Enterprise installed. I am doing everything on Server 2. I give you run times on the longer parts for reference points. Your times will vary!

  1. Backup SharePoint! Seriously handy little paper here if you need help.
  2. Download the software you need. For my servers I downloaded the 32 bit editions. You must install BOTH the WSS and MOSS update if you have MOSS installed.
    1. WSS SP1 downloads
    2. MOSS SP1 downloads
  3. Stop the World Wide Web Publishing Services to keep your users off the server.
    1. Start > Administrative Tools > Services
    2. Scroll to the bottom of the list, click World Wide Web Publishing Service
    3. Click the Stop button
  4. Install the Windows SharePoint Services Service Pack (total time less than 2 minutes)
    1. Find the downloaded file. For me this was wssv3sp1-kb936988-x86-fullfile-en-us.exe
    2. Double click to run the file
    3. Read the license terms, click accept
    4. Click continue
    5. At the reminder message click OK
    6. Now it starts processing the update.
    7. At the installation complete message click OK
  5. Now if you have just WSS skip to step 8
  6. If the configuration wizard opens close it.
  7. Install the MOSS update (total time less than 2 minutes)
    1. Find the downloaded file. For me this was officeserver2007sp1-kb936984-x86-fullfile-en-us.exe
    2. Double click to run the file
    3. Read the license terms, click accept
    4. Click continue
    5. At the reminder message click OK
    6. Now the update processes…
  8. Run SharePoint Configuration Wizard (15 minutes)
    1. Start > All Programs > Microsoft Office Server > SharePoint Product and Technologies Configuration Wizard
    2. Click Next at the Welcome screen
    3. Click Yes at the warning about restarting services
    4. Click Next at the Completing the SharePoint Product and Technologies Configuration Wizard
    5. Your server is now processing step 1
    6. You will be prompted to now install the updates on other servers in your farm. Click OK since you only have 1 SharePoint server.
      1. NOTE: If you did have multiple servers you would repeat all of the above steps on each of those servers before moving on. Also, if you are wondering you should probably start with the server that host central admin.
    7. Now your server is processing steps 2 through 9.
    8. Speaking of step 8 it took my server approximately 13 minutes to process 4.4 GB of content. I am sure your times will vary. Just don’t panic on this step if it takes a while. It is essentially touching all of your content.
    9. At Configuration Successful click Finish
  9. Check out Central Admin
    1. Restart the World Wide Web Publishing service you stopped in step 2. If you had to reboot this is not necessary.
    2. Click Operations tab
    3. Under Topologies and Services click Servers in farm
    4. Next to your server you should see Version 12.0.0.6219 not 12.0.0.4518. If you do you should be good to go.

That is it. 🙂

Seeing decent error messages in Sharepoint


I dont know about anyone else but I am sick of seeing:

“An error has occurred”

in Sharepoint then having to look in the logs to see what the error is.

I just found out that if you set CallStack=”true” in the relevant sites web.config you get the error on the screen. How easy is that!!!

I knew this already but you can also turn on tracing which will provide lots more info.

RuSs

How do delete a TFS team project

open visual Studio 2008 command prompt from

START > Programs > VS 2008 > VS tools > VS Command Prompt

enter:

tfsDeleteProject /force /server:TLONDEV002 “MSDN Calc v2”

You will get the following info and it may take a few minutes:
E:\Program Files\Microsoft Visual Studio 9.0\VC>tfsDeleteProject /force /server:
TLONDEV002 “MSDN Calc v2”
Warning: Deleting a team project is an irrecoverable operation. All version cont
rol, work item tracking and Team Foundation build data will be destroyed from th
e system. The only way to recover this data is by restoring a stored backup of t
he databases. Are you sure you want to delete the team project and all of its da
ta (Y/N)?y

Deleting from Build …
Done
Deleting from Work Item Tracking …
Done
Deleting from Version Control …
Done
Deleting Report Server files …
Done
Deleting SharePoint site …
Done
Deleting from Team Foundation Core …
Done