Posts

Delete All Object in SQL Server Database Query

DECLARE @name VARCHAR ( 128) DECLARE @SQL VARCHAR ( 254) SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 ORDER BY [name]) WHILE @name is not null BEGIN     SELECT @SQL = 'DROP PROCEDURE [dbo] . [' + RTRIM ( @name) +']'     EXEC (@SQL)     PRINT 'Dropped Procedure: ' + @name     SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 AND [name] > @name ORDER BY [name]) END GO /* Drop all views */ DECLARE @name VARCHAR ( 128) DECLARE @SQL VARCHAR ( 254) SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'V' AND category = 0 ORDER BY [name]) WHILE @name IS NOT NULL BEGIN     SELECT @SQL = 'DROP VIEW [dbo] . [' + RTRIM ( @name) +']'     EXEC (@SQL)     PRINT 'Dropped View: ' + @name     SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'V' AND category = 0 AND [name] > @name O...

How to enable developer ULS log dashboard in sharepoint

Image
Step 1 : Execute below command in powershell stsadm -o setproperty -pn developer-dashboard -pv on Step 2:  Follow the process as per below snap shot .

Start Stop SharePoint timer Service using command line

net stop SPTimerv4 To start timer service net start SPTimerv4 To stop SharePoint Administration service: net stop SPAdminV4 To start SharePoint Administration service net start SPAdminV4

Use of SPMetal.exe in SharePoint

SPMetal.exe Using the tool called SPMetal, we generate our entity-classes that are needed to perform these object oriented queries toward our SharePoint server Command for Generate entity class C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN>spmetal.exe /web:http://sharepointsite /code:c:\classname.css

SharePoint 2010 Book Direct Download link

http://5.9.78.50/cgi-bin/dl.cgi/pvb7677ynmxew3jkjlc6axrxyx5mkmwwlfyeaei4yq/Wrox.Beginning.SharePoint.2010.Development.May.2010.rar

Create Auto Increment ID in Table with data

Step 1 Create new Column as ID in Table with data type INT. Step 2 Update table with below query . ;WITH cte AS (     SELECT *, RowNum = ROW_NUMBER() OVER (ORDER BY GETDATE())     FROM  TableName ) UPDATE cte SET ID = RowNum + 1 WHERE (RowNum = RowNum) Step 3 Modify the ID column Identity (1,1)

Find Days of Month In Teradata

Find Days of Month In Teradata select extract(month from current_date) as monthofyear, CASE extract(year from current_date) MOD 5 WHEN 0 THEN CASE monthofyear WHEN 1 THEN 31 WHEN 2 THEN 29 WHEN 3 THEN 31 WHEN 4 THEN 30 WHEN 5 THEN 31 WHEN 6 THEN 30 WHEN 7 THEN 31 WHEN 8 THEN 31 WHEN 9 THEN 30 WHEN 10 THEN 31 WHEN 11 THEN 30 WHEN 12 THEN 31 END ELSE CASE monthofyear WHEN 1 THEN 31 WHEN 2 THEN 28 WHEN 3 THEN 31 WHEN 4 THEN 30 WHEN 5 THEN 31 WHEN 6 THEN 30 WHEN 7 THEN 31 WHEN 8 THEN 31 WHEN 9 THEN 30 WHEN 10 THEN 31 WHEN 11 THEN 30 WHEN 12 THEN 31 END END