Wed 19 Feb 2014

I have came through below wiki article on Microsoft technet, which have a nice collection of eBooks and articles on Microsoft Technologies.

Download content for SharePoint, Lync, MS Office, SQL Server, System Center, Visual Studio, Web Development (asp.net), Windows Server, Window Azure, Windows Phone and other Microsoft technologies in e-book formats (references, guide, and step-by-step).

 

E-Book Gallery for Microsoft Technologies

 

Source: social.technet.microsoft.com/wiki/contents/articles/11608.e-book-gallery-for-microsoft-technologies.aspx (Monica Rush)
Source: mstechtalk.com/collection-of-e-book-and-articles-on-microsoft-technologies/ (Adnan Amin)

 

Comments here
Tue 26 Mar 2013

In last days, I was trying to restore SharePoint web application backup using PowerShell, but run into following error (although my sharepoint version was newer then the backup version)

Restore-SPSite : Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '14.0.0.5138' or later.

Following is the quick overview / steps which I followed and successfully restored the SharePoint backup. Might be this could be applicable in your case

If you have the source database files (mdf and ldf) not the SharePoint backup file then follow step 2, otherwise step 1 and 2

Step 1.

  • Create a virtual machine if you don’t have

  • Install SharePoint on that vm if your don’t have it on that vm

  • Make the environment version same by installing the same cumulative update(s) which source server has. Once the server has the same version as of the backup, in my case it was (14.0.0.5138). (to check SharePoint version central administration -> upgrade and migration -> check product and patch installation)

  • Create new web application and Restore the SharePoint backup.

  • In sql server, detach the restored SharePoint database and physically copy database files (mdf and ldf)

 

Step 2.

On SharePoint environment where you want to restore the backup (this SharePoint version obviously needs to be later version, in my case it was 14.0.6029.1000)

  • Create web application (no need to create site collection) (central administration -> application management -> manage web application-> new)

  • Remove content database of newly created web application (central administration -> application management -> manage content database -> choose web application from the dropdown -> click on database name -> choose offline from database status and check mark Remove content database) (make sure you have selected the newly created web application and its content database)

  • In sql server, detach that content database of newly created web application

  • Physically replace the detached content database files (mdf and ldf) from the SharePoint backup's mdf/ldf file (which were taken from step1 or from the original server / source)

  • Attach Database (while attaching, after selecting mdf file, Change the Database name as of file name in Database to Attach's -> Attach As textbox, then on same screen, select/browse both mdf and ldf file in database details section -> Current File Path)

  • Open SharePoint 2010 Management Shell, and add content database using following command
    stsadm -o addcontentdb -url <URL name> -databasename <database name>

  • Then follow remaining application specific restore steps (for e.g. change site collection administrators, changes in web.config, add or change global resource files etc.)

Then access web application, hope so it would restored successfully

 

Comments (2)
Thu 8 Nov 2012

If you want to show records (Parent Child concatenation), then following SQL Server recursive query could help you in achieve. For a clear picture have a look at following snap

 

 Recursive+Qeury+Parent+Child+Concatenation.jpg

Recursive Query showing only child Records

                           

with parentChildResult as

(

       select ItemId,

                     ItemDescription,

                     ItemCategoryId,

                     cast('' as nvarchar(max)) as ParentNames

       from Items

       where ItemCategoryId is null

        union all

        select i2.ItemId,

                     i2.ItemDescription,

                     i2.ItemCategoryId,

                     parentChildResult.ParentNames + ' > ' + parentChildResult.ItemDescription

       from Items as i2

       inner join parentChildResult

              on parentChildResult.ItemId = i2.ItemCategoryId

)     

 select ItemId,

              stuff(ParentNames, 1, 3, '') + ' > ' + ItemDescription as ParentNames

from parentChildResult

 where ItemId in

(

       SELECT i.ItemId FROM Items i

       WHERE NOT EXISTS(SELECT 1 FROM Items I2 WHERE i.ItemId = I2.ItemCategoryId)

)

 

order by ParentNames

 

  

Recursive Query showing All parents and Child Records

 

with parentChildResult as

(

       select ItemId,

                     ItemDescription,

                     ItemCategoryId,

                     cast('' as nvarchar(max)) as ParentNames

       from Items

       where ItemCategoryId is null

        union all

        select i2.ItemId,

                     i2.ItemDescription,

                     i2.ItemCategoryId,

                     parentChildResult.ParentNames + ' > ' + parentChildResult.ItemDescription

       from Items as i2

       inner join parentChildResult

              on parentChildResult.ItemId = i2.ItemCategoryId

)     

 select ItemId,

              stuff(ParentNames, 1, 3, '') + ' > ' + ItemDescription as ParentNames

from parentChildResult

 order by ParentNames

 

Comments here
Fri 20 Jun 2008

Today I tried to find out which table is taking much space in DB or to find the numbers of columns and rows in all tables of DB

Following query will return the required result

=========

USE DatabaseName
GO
CREATE TABLE #temp (
                table_name sysname ,
                row_count INT,
                reserved_size VARCHAR(50),
                data_size VARCHAR(50),
                index_size VARCHAR(50),
                unused_size VARCHAR(50))
    SET NOCOUNT ON
INSERT     #temp
    EXEC       sp_msforeachtable 'sp_spaceused "?"'
SELECT     a.table_name,
            a.row_count,
            COUNT(*) AS col_count,
            a.data_size
    FROM       #temp a
            INNER JOIN information_schema.columns b
            ON a.table_name collate database_default
    = b.table_name collate database_default
    GROUP BY   a.table_name, a.row_count, a.data_size
    ORDER BY   CAST(REPLACE(a.data_size, 'KB', '') AS integer) DESC
DROP TABLE #temp

 

 

 

Comments here




Ads