December 11, 2009 at 1:35 pm
GabyYYZ (12/11/2009)
Lynn Pettis (12/11/2009)
GabyYYZ (12/11/2009)
Lynn Pettis (12/11/2009)
Sometimes, you just have to question people.Was the original post a request or a command? (or is it a followup to another thread that escapes me?)
Actually, I think the original post is simply an announcement, but I took exception to the statement about three primary keys. If you're going to talk the talk, be sure you talk it right. 😉
Multiple primary keys...perish the thought. It's like a table with a split personality.
I found a bug once, many, many moons ago, on Sybase that let you create two clustered indexes as primary keys on a table. Of course, it immediately hosed the entire database, but it was possible to do, just not desirable.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
December 11, 2009 at 1:39 pm
bitbucket-25253 (12/11/2009)
SET NOCOUNT ONDECLARE @Rem INT
SET @Rem = 56
DECLARE @Down INT
SET @Down = 1
DECLARE @Verse VARCHAR(Max)
SET @Verse = ' '
WHILE @Rem > 0
BEGIN
SET @Verse = CAST(@Rem - @Down AS VARCHAR(4))+ ' Bottles of beer on the wall ' +
'and One fell down '
SELECT @Verse
SET @Rem = @Rem - 1
END
Here's the version I'm familiar with:
SET NOCOUNT ON
DECLARE @Rem INT
SET @Rem = 99
DECLARE @Down INT
SET @Down = 1
DECLARE @Verse VARCHAR(200)
SET @Verse = ' '
WHILE @Rem > 1
BEGIN
SET @Verse = CAST(@Rem - @Down AS VARCHAR(4))+ ' Bottles of beer on the wall. '
+ CAST(@Rem - @Down AS VARCHAR(4)) + ' Bottles of beer. You take one down, you pass it around. '
+ CAST((@Rem - @Down - 1) AS VARCHAR(4)) + ' bottles of beer on the wall. '
print @Verse + char(10)
SET @Rem = @Rem - 1
END
PRINT 'One more time!!!'
We should post this code for the Question of the day and ask what the results will be. 😀
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
December 11, 2009 at 1:42 pm
select cast(Number as varchar(10)) + ' bottles of beer on the wall
' + cast(Number as varchar(10)) + ' bottles of beer
take one down, pass it around'
from dbo.Numbers
where Number between 1 and 100
order by Number desc;
Can't believe you guys are using a While loop for this! 😀
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
December 11, 2009 at 1:45 pm
GSquared (12/11/2009)
select cast(Number as varchar(10)) + ' bottles of beer on the wall
' + cast(Number as varchar(10)) + ' bottles of beer
take one down, pass it around'
from dbo.Numbers
where Number between 1 and 100
order by Number desc;
Can't believe you guys are using a While loop for this! 😀
Gus, it's my beer and I'll take it down which ever way I want!! 😎
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
December 11, 2009 at 1:47 pm
Alvin Ramard (12/11/2009)
GSquared (12/11/2009)
select cast(Number as varchar(10)) + ' bottles of beer on the wall
' + cast(Number as varchar(10)) + ' bottles of beer
take one down, pass it around'
from dbo.Numbers
where Number between 1 and 100
order by Number desc;
Can't believe you guys are using a While loop for this! 😀
Gus, it's my beer and I'll take it down which ever way I want!! 😎
Actually, according to your script, you're sitting around waiting for them to fall off of the wall on their own.
Seems like a waste of beer to me (and I don't even drink). At least in my version, you're taking them down and passing them around, with the implication that it may still be a bottle after that, but not a bottle of beer.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
December 11, 2009 at 1:50 pm
GSquared (12/11/2009)
Alvin Ramard (12/11/2009)
GSquared (12/11/2009)
select cast(Number as varchar(10)) + ' bottles of beer on the wall
' + cast(Number as varchar(10)) + ' bottles of beer
take one down, pass it around'
from dbo.Numbers
where Number between 1 and 100
order by Number desc;
Can't believe you guys are using a While loop for this! 😀
Gus, it's my beer and I'll take it down which ever way I want!! 😎
Actually, according to your script, you're sitting around waiting for them to fall off of the wall on their own.
Seems like a waste of beer to me (and I don't even drink). At least in my version, you're taking them down and passing them around, with the implication that it may still be a bottle after that, but not a bottle of beer.
I'm not waiting anymore. See the revised script. :hehe:
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
December 11, 2009 at 1:52 pm
Can't believe you guys are using a While loop for this!
I can't chug fast enough to keep up with a tally table !! :sick:
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
December 11, 2009 at 1:54 pm
Alvin Ramard (12/11/2009)
--------------------------------------------------------------------------------
GSquared (12/11/2009)
--------------------------------------------------------------------------------
select cast(Number as varchar(10)) + ' bottles of beer on the wall
' + cast(Number as varchar(10)) + ' bottles of beer
take one down, pass it around'
from dbo.Numbers
where Number between 1 and 100
order by Number desc;
Can't believe you guys are using a While loop for this!
Gus, it's my beer and I'll take it down which ever way I want!!
I wrote mine after drinking the 9,943 that were already on the wall.........
December 11, 2009 at 1:55 pm
The Dixie Flatline (12/11/2009)
Can't believe you guys are using a While loop for this!
I can't chug fast enough to keep up with a tally table !! :sick:
Parallel processing. It's what friends are for.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
December 11, 2009 at 1:56 pm
bitbucket-25253 (12/11/2009)
Alvin Ramard (12/11/2009)
--------------------------------------------------------------------------------
GSquared (12/11/2009)
--------------------------------------------------------------------------------
select cast(Number as varchar(10)) + ' bottles of beer on the wall
' + cast(Number as varchar(10)) + ' bottles of beer
take one down, pass it around'
from dbo.Numbers
where Number between 1 and 100
order by Number desc;
Can't believe you guys are using a While loop for this!
Gus, it's my beer and I'll take it down which ever way I want!!
I wrote mine after drinking the 9,943 that were already on the wall.........
So that's what the bucket is for!!!!
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
December 11, 2009 at 1:57 pm
On the subject of beer, one of my favorite jokes is that the human body is the world's most efficient machine at turning European beer into American beer. Can't remember where I first heard that one, but thought it was pretty funny!
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
December 11, 2009 at 2:00 pm
GSquared (12/11/2009)
On the subject of beer, one of my favorite jokes is that the human body is the world's most efficient machine at turning European beer into American beer. Can't remember where I first heard that one, but thought it was pretty funny!
I don't get it. What's American beer? I've never seen such a thing. 😛
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
December 11, 2009 at 2:03 pm
SET NOCOUNT ON
DECLARE @Posts INT
SET @Posts = 9958
DECLARE @Up INT
SET @Up = 1
DECLARE @Verse VARCHAR(200)
SET @Verse = ' '
WHILE @Posts < 9999
BEGIN
SET @Verse = CAST(@Posts + @Up AS VARCHAR(5))+ ' Posts in the thread. '
+ CAST(@Posts + @Up AS VARCHAR(5)) + ' Posts in the thread. You post one more, '
+ CAST((@Posts + @Up + 1) AS VARCHAR(5)) + ' posts in the thread. '
print @Verse + char(10)
SET @Posts = @Posts + 1
END
PRINT 'Hurray!!!'
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
December 11, 2009 at 2:12 pm
Alvin Ramard (12/11/2009)
GSquared (12/11/2009)
On the subject of beer, one of my favorite jokes is that the human body is the world's most efficient machine at turning European beer into American beer. Can't remember where I first heard that one, but thought it was pretty funny!I don't get it. What's American beer? I've never seen such a thing. 😛
You're Canadian, right? Then you've gotta be familiar with yellow snow, right? From what I gather, the two are pretty much synonymous.
Eh.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
December 11, 2009 at 2:16 pm
GSquared (12/11/2009)
Alvin Ramard (12/11/2009)
GSquared (12/11/2009)
On the subject of beer, one of my favorite jokes is that the human body is the world's most efficient machine at turning European beer into American beer. Can't remember where I first heard that one, but thought it was pretty funny!I don't get it. What's American beer? I've never seen such a thing. 😛
You're Canadian, right? Then you've gotta be familiar with yellow snow, right? From what I gather, the two are pretty much synonymous.
Eh.
Oh, that stuff, with the 3% alcohol. I get it now.
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
Viewing 15 posts - 9,946 through 9,960 (of 66,815 total)
You must be logged in to reply to this topic. Login to reply