CREATE PROC SearchAllTables ( @SearchStr nvarchar(100) ) AS BEGIN CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630)) SET NOCOUNT ON DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110) SET @TableName = ” SET @SearchStr2 = QUOTENAME(‘%’ + @SearchStr + ‘%’,””) WHILE @TableName…
Sharepoint Powershell Set scope of people picker to particular domain
To scope people picker $wa = Get-SPWebApplication “http://webapplicationurl“ $adsearchobj = New-Object Microsoft.SharePoint.Administration.SPPeoplePickerSearchActiveDirectoryDomain $adsearchobj.DomainName = “domain.com” $wa.PeoplePickerSettings.SearchActiveDirectoryDomains.Add($adsearchobj) $wa.Update() To reset peoplepicker setting $wa = Get-SPWebApplication “http://webapplicationurl” $adsearchobj = New-Object Microsoft.SharePoint.Administration.SPPeoplePickerSearchActiveDirectoryDomain $wa.PeoplePickerSettings.SearchActiveDirectoryDomains.clear() $wa.Update()
SQL server Truncate Log for all databases on the server
CREATE TABLE #TransactionLogFiles (DatabaseName VARCHAR(150), LogFileName VARCHAR(150) ) — step 1. get hold of the entire database names from the database server DECLARE DataBaseList CURSOR FOR SELECT name FROM SYS.sysdatabases WHERE NAME NOT IN (‘master’,’tempdb’,’model’,’msdb’) DECLARE @DataBase VARCHAR(128) DECLARE @SqlScript…
Alert in MS SQL when new database is created or when database is deleted
Execute the below SQL query to create a trigger on the MASTER database. An email will be sent when ever a new database is created on the server or when a database is deleted. CREATE TRIGGER trgCreateDatabase ON ALL…
Reset List Item ID in sharepoint Using SQL
Sharepoint list dosent have an option to reset the ID which is created internally when an item is added on the list. Which is referred to as List Item ID. OOTB there is no way to reset the List item…
How to List all SharePoint Databases
After many Google searches and a few forum posts i got the easiest way to find out all the databases names used by the current sharepoint farm.. Central Admin >> OPERATIONS >> PERFORM A BACKUP (which takes you to “/_admin/Backup.aspx”)…
Export Search Crawl Logs in SharePoint
SharePoint does not provide an option to export crawl logs from the Search crawl. The following set of queries can be executed in the database to export the list of errors from the crawl logs. select * from MSSCrawlErrorList with…
SQL query to find tables with a specific value in any column and in any table
An excellent way of scanning a database [Every Table, Every Column] for any Value. As I’m sure you can imagine, this is incredibly useful for a developer, especially those who have to support existing applications… This has been wrapped into…
Sql Query to find all the tables and columns in selected database
As a developer, it is really important for us to understand database design and underlying tables used in application. Sometime we do not have direct access to database server so that we can not open the server console and look in…
SQL Server 2008 Books
SQL Server 2008, the latest release of Microsoft SQL Server, provides a comprehensive data platform. Books Online is the primary documentation for SQL Server 2008. Books Online includes the following types of information: Setup and upgrade instructions. Information about new…