Sunday, June 27, 2010

Relational Database Design

A database is a collection of data. Related data are grouped together in a tabular format so that it makes sense. For instance, salary data would better completement work related data than address data.
A relational database is acollection of tables of such data which can be linked with some common culumns, primary key and foreign key in database term. For instance:
EmpIdFNameLName
1JohnQ
2MaryJames
3HenryDew

EmpIdTypeDesc
1PrimaryThis is primary description
1SecondaryThis is secondary description
1TertiaryThis is tertiary description
3PrimaryThis is primary description

Here, these two tables can be connected with the common field EmpId. Also notice that employee 2 does not has any entry in second table. This way information can be separated without loosing its integrity. There would have been duplication and few blanks if these two tables were combined. This is a form of a relational database.

In above, the first table could be called Employee and the second, Description. In database term it would be written as:

Employee (EmpId, FName, LName)

Description (EmpId, Type, Desc)

Employee and Description are called "entity" and those in parenthesis are called attributes.

As with every design, one needs to decide what needs to be put into the table as shown above. How detailed do you want to be will decide on how many tables and how to group them.


Once this has been decided, linking those tables with common field would produce ERD and the documentation something like (for first table above):






TableFieldData TypeLengthDescriptionConstraints
EmployeeEmpIdIntegerUnique number that identifies an employeePrimary Key, Identity

FNamevarchar 50first name of an employee

LNamevarchar 50last name of an employee


Would be data dictionary where one defines data: name, type, length etc.

Wednesday, June 16, 2010

Installing SSMS 2008 in Windows 7

What?
I wanted to install SQL Server Management Studio 2008 in Windows 7 machine

Problem:
Whenever I tried to install it failed in preliminary run saying it could not restart the computer and continued even after restarting computer (not just one or two restarts)

How I solved:
Before running the initial run, I went to registry in:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Mananger
and cleared the value of "PendingFileRenameOperations"
and run the setup. mz! it worked.

Friday, June 4, 2010

Making Contact Us Forms in SharePoint with SharePoint Designer (SPD)

What?
I am creating a "Contact Us" form in SharePoint (SP) without coding (only little in SPD)

What do I need?
i. SPD
ii. Access in SP to add/delete/edit a list

How?
Concept:
1. Create a list in SP with required fields
2. Create a workflow which triggers on create
2.1 will email the content of the item (our Contact Us form content)
2.2 will delete the current item, it will just send email and not save the content
3. Tweak a little so that user fills as if they are filling out normal form

Procedre:
1. Set up a Custom List

2. Give the name "Contact Us"
3. Add column "Body", there already is "Title" and this can be used as 'subject'

4. Go to Settings->Advance Setting and disable attachment

5. Go to SPD and create workflow that triggers automatically on create.
5.1 Build email
5.2 Send email
5.3 Delete the current Item
7. Few tweaks
7.1 Go to Site Actions-> Site Settings

7.2 Click on "Navigation"
7.3 "Edit" navigation of "Contact Us" to /mysite/Lists/Contact Us/NewForm.aspx
This will take users directly to the form instead of list items.
7.4 Now change verbiage in NewForm.aspx in SPD so that it reads "Contact Us: Please fill out the form" instead of "Contact Us: New Item," the default one.
7.5 Also change verbiage in AllItems.aspx, mine says "Thank you for . . . " instead of the default one. This will act as a confirmation page and will appear when "Ok" button is presse in NewForm.aspx.
So,
This is an easy way to do "Contact Us" or similar kind of form. I'd appreciate if someone could add more to this one.
Happy F'day!

Making Contact Us Forms in SharePoint (SP) with SharePoint Designer (SPD)

What?
I am making a "Contact Us" from in SharePoint without coding (only little changes in SPD)

What do I need?
i. SPD
ii. Access in SP to add/delete/edit list

How?
Concept:

1. Create a list in SP with required fields

2. Create a workflow that will send email to required recipient and is triggred when new item is created.

3. Have a workflow delete the "current item" after the email has been sent

4. Tweak the SP ways to give impression to user as if they are working in normal form


Procedure:

1. Set up a Custom List