Click here to Skip to main content
15,868,051 members
Home / Discussions / Database
   

Database

 
AnswerRe: An Iteration with renaming and avoiding duplicates Pin
Mycroft Holmes16-Jul-12 12:58
professionalMycroft Holmes16-Jul-12 12:58 
GeneralRe: An Iteration with renaming and avoiding duplicates Pin
SkyRunner17-Jul-12 2:39
SkyRunner17-Jul-12 2:39 
GeneralRe: An Iteration with renaming and avoiding duplicates Pin
Mycroft Holmes17-Jul-12 2:59
professionalMycroft Holmes17-Jul-12 2:59 
GeneralRe: An Iteration with renaming and avoiding duplicates Pin
SkyRunner17-Jul-12 3:08
SkyRunner17-Jul-12 3:08 
GeneralRe: An Iteration with renaming and avoiding duplicates Pin
SkyRunner17-Jul-12 3:44
SkyRunner17-Jul-12 3:44 
GeneralRe: An Iteration with renaming and avoiding duplicates Pin
Michael Potter17-Jul-12 3:52
Michael Potter17-Jul-12 3:52 
GeneralRe: An Iteration with renaming and avoiding duplicates Pin
SkyRunner17-Jul-12 4:11
SkyRunner17-Jul-12 4:11 
GeneralRe: An Iteration with renaming and avoiding duplicates Pin
Michael Potter17-Jul-12 4:51
Michael Potter17-Jul-12 4:51 
Something like this should work:

SQL
INSERT INTO [NewProductTable]
(
	[NewProductName],
	[NewCol1],
	[NewCol2]
)
SELECT
	REPLACE([ProductName],'_',' '),
	[Col1],
	[Col2]
FROM
	[Product]
WHERE
        (REPLACE([ProductName],'_',' ') = ProductName) OR
	(REPLACE([ProductName],'_',' ') NOT IN (SELECT [ProductName] FROM [Product]))

I want you to understand that any child records (think foreign key) based off the ignored rows will be orphaned in the new structure.
GeneralRe: An Iteration with renaming and avoiding duplicates Pin
SkyRunner17-Jul-12 23:24
SkyRunner17-Jul-12 23:24 
GeneralIncorrect Reporting Service instance name during SQL server 2005 SP3 installation Pin
Vipul Mehta15-Jul-12 22:55
Vipul Mehta15-Jul-12 22:55 
Questionlogin page Pin
Dinesh kumar tomer15-Jul-12 18:44
Dinesh kumar tomer15-Jul-12 18:44 
AnswerRe: login page Pin
ManishaSCode15-Jul-12 19:25
ManishaSCode15-Jul-12 19:25 
AnswerRe: login page Pin
Paul Conrad16-Jul-12 10:55
professionalPaul Conrad16-Jul-12 10:55 
QuestionCan a SQL login have more than one user Pin
yousefshokati14-Jul-12 19:53
yousefshokati14-Jul-12 19:53 
AnswerRe: Can a SQL login have more than one user Pin
Mycroft Holmes14-Jul-12 20:27
professionalMycroft Holmes14-Jul-12 20:27 
GeneralRe: Can a SQL login have more than one user Pin
yousefshokati14-Jul-12 20:50
yousefshokati14-Jul-12 20:50 
GeneralRe: Can a SQL login have more than one user Pin
Mycroft Holmes14-Jul-12 22:28
professionalMycroft Holmes14-Jul-12 22:28 
AnswerRe: Can a SQL login have more than one user Pin
ManishaSCode15-Jul-12 3:34
ManishaSCode15-Jul-12 3:34 
GeneralRe: Can a SQL login have more than one user Pin
Jan Steyn16-Jul-12 0:34
Jan Steyn16-Jul-12 0:34 
AnswerRe: Can a SQL login have more than one user Pin
rimazuc17-Jul-12 0:07
rimazuc17-Jul-12 0:07 
QuestionSql query that sorts data by top quantity per category Pin
Hardz13-Jul-12 16:49
Hardz13-Jul-12 16:49 
GeneralRe: Sql query that sorts data by top quantity per category Pin
PIEBALDconsult13-Jul-12 19:00
mvePIEBALDconsult13-Jul-12 19:00 
AnswerRe: Sql query that sorts data by top quantity per category Pin
__TR__15-Jul-12 0:49
__TR__15-Jul-12 0:49 
GeneralRe: Sql query that sorts data by top quantity per category Pin
Hardz15-Jul-12 15:18
Hardz15-Jul-12 15:18 
GeneralRe: Sql query that sorts data by top quantity per category Pin
Luc Pattyn15-Jul-12 16:27
sitebuilderLuc Pattyn15-Jul-12 16:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.