Create Stored Procedure IF NOT EXISTS (SQL Server)

This is especially useful if you're writing update scripts like I am.

IF NOT EXISTS(Select * from sysobjects where name = 'usp_UserSproc')
BEGIN
EXEC dbo.sp_executesql @statement = N'
CREATE PROCEDURE usp_UserSproc
(
@ID int = NULL --nullable input
)

AS
BEGIN
SET NOCOUNT ON;
IF @ID IS NOT NULL
SELECT * FROM My_Table WHERE ID=@ID;
ELSE
SELECT * FROM My_Table WHERE ID=1;
END';
END

SQL Server Analysis Services Deployment Error

I was following the MSDN Tutorial on SQL Server Analysis until I got stuck in the Deployment lesson. The error is mostly about being unable to connect to the database or having insufficient permissions.

I've tried everything and finally decided to start from scratch. Then the next attempt succeeded. I searched through whatever difference my first project had with the second and here is what I found out:
  • Right click your Project and click Properties.
  • Server: localhost
  • Database: (e.g., Sample SSAS (attempt 3) should be Sample SSAS attemp 3)
This is where my first Project crashed. I assumed that the server is supposedly the Server in my SQL Server Management Studio (which is MSSQL) and then the Database is naturally the database that I'm designing my Analysis Services Project for, which is AdventureWorksDW. Apparently, I am very much mistaken.

I shall find out more regarding this.

Missing Business Intelligence Types and Analysis Services Template

While following the tutorial on Analysis Services on MSDN:
http://msdn.microsoft.com/en-us/library/ms170208.aspx

I got stuck in item 3 in Creating Analysis Services Project
http://msdn.microsoft.com/en-us/library/ms166989.aspx

I have SQL Server 2008, Developers' Edition
I have installed Analysis Services (and Reporting Services for future use) so that's not the problem.
- If you're not sure if you have that. Go to Start -> Programs -> Microsoft SQL Server-> SQL Server Business Intelligence Development Studio

If you have that they you have Analysis Services and you might be encountering the same problem I did. When trying to create my first Analysis Services Project, the Business Intelligence Type was missing and so was the Analysis Services Templates.

Solution:
In MS Visual Studio (BIDS) click on Tools -> Import and Export Settings

Import Selected Environment Settings
Yes, Save my current settings
highlight "Business Intelligence Settings" and click on Finish.

This will add the Business Intelligence projects to BIDS.
Source: http://www.windows-tech.info/15/4e09444d2e59562b.php

FREE Starbucks Java Chip ^__^

Oyen is currently enjoying her FREE tall Java Chip from Starbucks.

Last week when we went to see Tropic Thunder, I bought a chocolate glazed doughnut from Starbucks. Then the cashier guy handed me my receipt and told me that I can claim a free tall drink from any Starbucks branch if I answer their online survey. Just follow the steps I took:



1. Go to http://www.mystarbucksvisit-ph.com/
2. Input the Customer Code that you can find in your receipt.
3. Answer the quick survey (took me 10 minutes)
4. On the provided space in your receipt, write the code that appears at the end of the survey.

That receipt will let you claim a free tall drink and is valid for a month, starting from the day you entered your code in the site.

British Comedy Insults Filipinos



British Comedy Insults Filipinos
Filipinos are insulted by BBC Comedy, 'Harry and Paul', where a sketch portrayed Enfield ordering his neighbor's Filipina maid to mate with his Northerner neighbor
View more »