.Net & SharePoint '07

Technical blog for .Net and all SharePoint 2007 related Information

About the author

Me(Prince) and my wife are B.E in I.T & C.S.E respectively.  I a certified MCPD: Web from 2007 Dec. I am Intrestes in Web Application, MOSS, EPM, etc.
Now working with Deira International School, as IT Application & Help Manager. I have started my career as "Software Developer" @  REACH Sewn Technologies and Consulting Pvt. Ltd, Bangalore India from Oct 2004 to Feb 2006, then as "Web & Intranet Developer" @ Fosroc International Ltd, Dubai from April 2006 to Sep 2009.
You can catch me on mail@jpy-tech.com or mail@princepy.com. Or on 00971 - 50 - 4284530 

Google Translate

Tag cloud

Calendar

<<  May 2012  >>
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

View posts in large calendar

RecentComments

Comment RSS

Google Your Location


SQL: Duplicate Rows from a Table

How to Delete SQL Server Database Duplicate Rows from a Table Using a Specified Column List and No Temp Tables

 

SELECT COUNT(*),
	Column1,
	Column2,
	.
	.
	Columnn
FROM TestTable
GROUP BY 
	Column1,
	Column2,
	.
	.
	Columnn
HAVING COUNT(*) > 1

--find duplicate emails in a 'users' table:
SELECT id, email, count(email) FROM users GROUP BY email HAVING count(email) > 1

--Another approach is to list all the duplicate entries. We assume the field 'id' is the primary key of the table 'users'
SELECT DISTINCT t1.id, t1.email FROM users t1, users t2 WHERE t1.email = t2.email AND t1.id <> t2.id


/*
How to find duplicates in multiple columns
I have a table with columns b and c that links two other tables b and c, and I want to find all rows that have duplicates in either b or c.
*/

create table a_b_c(
   a int not null primary key auto_increment,
   b int,
   c int
);

insert into a_b_c(b,c) values (1, 1);
insert into a_b_c(b,c) values (1, 2);
insert into a_b_c(b,c) values (1, 3);
insert into a_b_c(b,c) values (2, 1);
insert into a_b_c(b,c) values (2, 2);
insert into a_b_c(b,c) values (2, 3);
insert into a_b_c(b,c) values (3, 1);
insert into a_b_c(b,c) values (3, 2);
insert into a_b_c(b,c) values (3, 3);

select b, c, count(*) 
from a_b_c
group by b, c
having 
	count(distinct b) > 1
	or count(distinct c) > 1;

 


Categories: SQL 2005 | SSRS
Posted by Admin on Tuesday, January 19, 2010 1:28 AM
Permalink | Comments (0) | Post RSSRSS comment feed

How to customize the RSWebParts (‘Report Viewer’,’ Report Explorer’)?

Report Root Folder(%rsroot%) = "C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services"

http://localhost/reports => "C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportManager"

http://localhost/reportserver =>"C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer"

    * Edit Styles [%rsroot%\ReportServer\Styles]
         1. HtmlViewer.css
               1. Css Class = ".MenuBarBkGnd"
                  Type = "background-color"
         2. SP_Full.css
               1. Css Class = ".MenuBarBkGnd"
                  Type = "background-color"
         3. SP_Small.css
               1. Css Class = ".MenuBarBkGnd"
                  Type = "background-color"

    * Replace [%rsreports%\ReportManager\images\TOOLGRAD.GIF] with you image (keep imagename as "TOOLGRAD.GIF")

    * Edit Style [%rsroot%]\ReportManager\Styles]
         1. ReportingServices.css
         2. RSWebParts.css


Posted by admin on Tuesday, June 30, 2009 3:25 PM
Permalink | Comments (2) | Post RSSRSS comment feed

SQL Reporting Services(SSRS) Reports In SharePoint (MOSS)2007 [Integrated Mode] throught SQL Server Reporting Services Report Viewer

Install SSRS web parts in integrated mode

 

Coming Soon....

 


Posted by admin on Thursday, May 21, 2009 10:21 AM
Permalink | Comments (0) | Post RSSRSS comment feed

SQL Reporting Services(SSRS) Reports In SharePoint (MOSS)2007 [Native Mode] throught Report Explorer + Report Viewer

Install SSRS web parts in native mode

If you want to access report server content on a SharePoint site from a native mode report server, use the SharePoint 2.0 Web Parts that are included with Reporting Services.
Web parts are delivered to a SharePoint server as a cabinet (.cab) file. Run the Stsadm.exe tool on the .cab file from the command line to install the Web Parts. The Stsadm.exe tool is included in a SharePoint installation.

  1. Copy the RSWebParts.cab to a folder on the SharePoint server. The .cab is installed with Reporting Services. By default, it is located in the C:\Program Files\Microsoft SQL Server\100\Tools\Reporting Services\SharePoint folder, (if missing please download it from here [RSWebParts.cab (23.08 kb)]). You can copy it to any folder on the SharePoint server, and then delete it later after you install the Web Parts.
  2. On the computer that has the installation of the SharePoint product or technology, open a Command Prompt window and navigate to the folder that has the Stsadm.exe tool. The path will vary depending on which version of Windows SharePoint Services you are running. If you are using Windows SharePoint Services 3.0, the path is C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN.
  3. Run Stsadm.exe on the .cab, using the following syntax:
    STSADM.EXE -o addwppack -filename "C:\ Program Files\Microsoft SQL Server\100\Tools\Reporting Services\SharePoint\RSWebParts.cab" -globalinstall

    Specifying -globalinstall adds the Web Parts to the global assembly cache (GAC). This step is necessary if you want to connect the Web Parts.
  4. After you install the Web Parts, you can add them to a Web Part Page on a SharePoint site. You must have permission to create Web sites and add content.

 

Note : If you get the below error

An unexpected error has occurred.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.
Troubleshoot issues with Windows SharePoint Services.


Changing the trust level from WSS_Minimal to WSS_Medium to resolve the problem

Links


Posted by admin on Thursday, May 21, 2009 9:58 AM
Permalink | Comments (0) | Post RSSRSS comment feed