Click here to Skip to main content
15,943,089 members
Home / Discussions / Database
   

Database

 
AnswerRe: i want to do left join that should not return same multiple rows Pin
DRKARTHIKRAJ14-Jun-12 2:32
DRKARTHIKRAJ14-Jun-12 2:32 
AnswerRe: i want to do left join that should not return same multiple rows Pin
asifkhan114-Jun-12 3:09
asifkhan114-Jun-12 3:09 
GeneralRe: i want to do left join that should not return same multiple rows Pin
DRKARTHIKRAJ15-Jun-12 1:53
DRKARTHIKRAJ15-Jun-12 1:53 
AnswerRe: i want to do left join that should not return same multiple rows Pin
Eddy Vluggen14-Jun-12 2:39
professionalEddy Vluggen14-Jun-12 2:39 
AnswerRe: i want to do left join that should not return same multiple rows Pin
Nolan Sunico14-Jun-12 5:03
Nolan Sunico14-Jun-12 5:03 
AnswerRe: i want to do left join that should not return same multiple rows Pin
Michael Potter15-Jun-12 10:43
Michael Potter15-Jun-12 10:43 
QuestionFinding "Missing" ID Numbers in Table (SQL Server 2005) Pin
Peter Bamuhigire13-Jun-12 7:25
Peter Bamuhigire13-Jun-12 7:25 
AnswerRe: Finding "Missing" ID Numbers in Table (SQL Server 2005) Pin
Mycroft Holmes13-Jun-12 14:45
professionalMycroft Holmes13-Jun-12 14:45 
This is NOT a good design for your primary key, a PK should be stupid and not convey any information.

Create a table variable and fill it with all possible numbers between the range you want to test, then select from that table where the PK is not in your Distributor table.

SQL
DECLARE
	@Top INT,
	@bottom INT
	
SET @bottom = 2000
SET @Top = 6000

DECLARE
	@Count INT,
	@Str VARCHAR(20)
DECLARE 	@Tbl TABLE(Code VARCHAR(20))	
	
	
SET @Count = 1
WHILE @Count < @Top
BEGIN
	SET @Str = 'SL' + RIGHT('000000000'+CAST(@Count + @bottom AS VARCHAR(10)),8)
	INSERT @Tbl(Code) VALUES (@Str)
	
	SET @Count = @Count + 1

END

SELECT Code
FROM @Tbl		
WHERE Code NOT IN (SELECT PD FROM TableBame)

Never underestimate the power of human stupidity
RAH

AnswerRe: Finding "Missing" ID Numbers in Table (SQL Server 2005) Pin
Eddy Vluggen14-Jun-12 0:59
professionalEddy Vluggen14-Jun-12 0:59 
QuestionView might cause corruption? Pin
kmoorevs13-Jun-12 5:35
kmoorevs13-Jun-12 5:35 
AnswerRe: View might cause corruption? Pin
David Mujica13-Jun-12 5:56
David Mujica13-Jun-12 5:56 
AnswerRe: View might cause corruption? Pin
Pete O'Hanlon13-Jun-12 5:57
mvePete O'Hanlon13-Jun-12 5:57 
AnswerRe: View might cause corruption? Pin
Corporal Agarn13-Jun-12 5:57
professionalCorporal Agarn13-Jun-12 5:57 
AnswerRe: View might cause corruption? Pin
Mycroft Holmes13-Jun-12 14:52
professionalMycroft Holmes13-Jun-12 14:52 
GeneralRe: View might cause corruption? Pin
kmoorevs14-Jun-12 4:20
kmoorevs14-Jun-12 4:20 
QuestionMySQL Pin
klaydze12-Jun-12 21:54
klaydze12-Jun-12 21:54 
AnswerRe: MySQL Pin
Bernhard Hiller12-Jun-12 23:34
Bernhard Hiller12-Jun-12 23:34 
GeneralRe: MySQL Pin
klaydze13-Jun-12 1:33
klaydze13-Jun-12 1:33 
QuestionRemove a noise word in a SQL Server 2008 database Pin
Fernando A. Gomez F.12-Jun-12 13:55
Fernando A. Gomez F.12-Jun-12 13:55 
AnswerRe: Remove a noise word in a SQL Server 2008 database Pin
Bernhard Hiller13-Jun-12 0:00
Bernhard Hiller13-Jun-12 0:00 
GeneralRe: Remove a noise word in a SQL Server 2008 database Pin
Fernando A. Gomez F.13-Jun-12 5:05
Fernando A. Gomez F.13-Jun-12 5:05 
AnswerRe: Remove a noise word in a SQL Server 2008 database Pin
Eddy Vluggen13-Jun-12 1:24
professionalEddy Vluggen13-Jun-12 1:24 
GeneralRe: Remove a noise word in a SQL Server 2008 database Pin
Fernando A. Gomez F.13-Jun-12 5:06
Fernando A. Gomez F.13-Jun-12 5:06 
GeneralRe: Remove a noise word in a SQL Server 2008 database Pin
Eddy Vluggen13-Jun-12 5:48
professionalEddy Vluggen13-Jun-12 5:48 
AnswerRe: Remove a noise word in a SQL Server 2008 database Pin
Bernhard Hiller13-Jun-12 4:40
Bernhard Hiller13-Jun-12 4:40 

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.