Friday, August 14, 2009

Stored Procedure Returning and Receiving

If the stored procedure is returning a single value you could define one of the parameters on the stored procedure to be an OUTPUT variable, and then the stored procedure would set the value of the parameter

CREATE PROCEDURE dbo.sp_myoutName @In INT, @Out VARCHAR(100) OUTPUT
AS
BEGIN SELECT @Out = 'Test'
END
GO


And then, you get the output value as follows

DECLARE @OUT VARCHAR(100)
EXEC sp_myoutname 1, @Out OUTPUT
PRINT @Out

Tuesday, May 26, 2009

Check Index Details in Database

Following query helps to find the index details within a database.
This will list down all the tables and their index details that are indexed in a database.
SELECT
t.[name],
i.[name] as IndexName
FROM
SYS.INDEXES AS i WITH (NOLOCK)
INNER JOIN
SYS.TABLES AS t WITH (NOLOCK)
ON
i.[object_id] = t.[object_id]
INNER JOIN
SYS.INDEX_COLUMNS AS ic WITH (NOLOCK)
ON
i.[object_id] = ic.[object_id]
AND i.index_id = ic.index_id
WHERE
t.[type] = 'U'
AND t.Is_MS_Shipped = 0
AND i.Is_Hypothetical = 0

Monday, May 18, 2009

Sharepoint Stsadm command

cd \Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

Adding a solution
stsadm -o addsolution -filename stsadm -o

ex: stsadm -o addsolution -filename c:\mysolutions\emprecord.wsp

Deploying a Solution

stsadm -o deploysolution -name .wsp

stsadm -o deploysolution -name emprecord.wsp


Delete Solution

stsadm -o deletesolution -name .wsp
stsadm -o deletesolution -name emprecord.wsp

Upgrade Solution
stsadm -o upgradesolution -name -filename WSP file name with the physical path where that is located> -allowGacDeployment –immediate

stsadm -o execadmsvcjobs

EX:
stsadm -o upgradesolution -name emprecord.wsp -filename c:\mysolutions\emprecord.wsp -allowGacDeployment –immediate

stsadm -o execadmsvcjobs

Friday, March 27, 2009

Copy Assembly from GAC,



Getting a copy of a DLL that's only in the GAC




Go to Command window




Find the Assembly directory


C:\Windows\Assembly




C:\Windows\Assembly\dir




This will display the different GAC folders




You need to find where exactly your dll is stored.




It would be GAC_




where can have MSIL, 64, 32. you can see the processor architecure from from the windows exproer view of the Assembly.






Suppose your dll processor Architecure is MSIL then your assembly would be there in GAC_MSIL




Then Go to


C:\Windows\Assembly\GAC_MSIL\__
Remember __ (Are two underscore)


type command to copy the dll to the directory where you want that.



EX: dll name : mydll


Processor Architecure: MSIL


version: 1.0.0.0


publc key: 9f4da00116c38ec5




The dir to copy: Mybackup




then command


Copy C:\windows\Assembly\mydll\1.0.0.0__9f4da00116c38ec5\mydll.dll c:\Mybackup

Wednesday, March 4, 2009

Success

“Take up one idea. Make that one idea your life - think of it, dream of it, live on that idea. Let the brain, muscles, nerves, every part of your body, be full of that idea, and just leave every other idea alone. This is the way to success, that is way great spiritual giants are produced.”

Swami VivekaNand

Satisfaction does not come with achievement, but with effort. Full effort is full victory.

Mahatma Gandhi

Tuesday, January 20, 2009

Installation and Setup – Preparing your Server Environment

For SharePoint Installation, i don't think any other article on the web could be better then this.
http://mindsharpblogs.com/bill/archive/2006/06/27/1153.aspx

The thing that is missing on most of the articles are regarding the principal acocunts and permissions.

Proper planning is crucial to the successful implementation of any MOSS 2007 Farm.

Below is guide to preparing your server environment by creating the proper accounts and simplifying permissions by making of use of Active Directory groups.


Step 1 – Create Accounts and Admin Group in Active Directory

The following user accounts should be created:

SAMPLE USER ACCOUNTS:

Server Farm Account = Domain\SP-ServerFarm
Setup User Account = Domain\SP-SetupUser
SQL Service Account = Domain\SP-SQLService

SAMPLE DOMAIN GLOBAL GROUP:

AD Global Group = Domain\SharePointAccounts

Step 2 – Add Accounts to Administrative Group

Add the three setup accounts created in Step 1 to the Active Directory Global Group created in Step 2.

Step 3 – Add Domain Group to Local Administrators Group on SharePoint Servers

Add the Active Directory Global Group (Domain\SharePointAccounts) to the Local Administrators Group of every Web Front End or Application Server within your SharePoint Farm.

Note: You may also use Active Directory Group Policies to accomplish this.

Step 4 – Add Account to the SQL Server Local Admin Group

Add the SQL Service Account (Domain\SP-SQLService) to the Local Administrator Group of your SQL Server.

Step 5 - Assign SQL Server Roles

Create the following Logins and assign the defined Roles on the SQL Instance to be used for the installation of MOSS 2007:

Logins Roles
Domain\SP-ServerFarm dbcreator, securityadmin
Domain\SP-SetupUser dbcreator, securityadmin
Domain\SP-SQLService dbcreator, securityadmin, sysadmin
========= ===== === ==== = ================= =============


Domain-level SharePoint User Accounts (Farm Deployment Only)

Setup User Account

SQL Server Service Account

SharePoint Farm Account

Shared Services Provider (SSP) Account

SSP Service Account (Timer Service)

My Sites Application Pool Account

Search Service Account

Content Access Account

User Profiles Access Account

Excel Services Account

Application Pool Identity Account

STSADM command to update the solution

stsadm -o upgradesolution -name -filename C:\join0120\ -allowGacDeployment -immediate

Monday, January 19, 2009

The trial period for this product has expired


you may get this error sometime while working with a website that is developed using Sharepoint.With this error message do not think that the trial period of your shrepoint has got expired.Rather this error comes due to a DCOM permissions bug.
To fix please add your MOSS web application's IIS Application Pool domain account to the local BUILTIN\Administrators user group and then it works fine.

SharePoint Designer Server error: This item cannot be deleted because it is still referenced by other pages

Server error: This item cannot be deleted because it is still referenced by other pages

You might get this error when you try to delete a master page from the _catalogs directory.

Following solution worked for me.

Open the Master gallery in Explorer view
Create a Directory named "Delete"
Cut all the un-wanted Master Pages and paste it inside the "Delete" directoty
Delete the "Delete" Directory