The Geek Forum

  • May 13, 2024, 05:10:09 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Due to the prolific nature of these forums, poster aggression is advised.

*

Recent Forum Posts

Shout Box

Members
  • Total Members: 4953
  • Latest: Leonriv
Stats
  • Total Posts: 129628
  • Total Topics: 7187
  • Online Today: 145
  • Online Ever: 1013
  • (January 12, 2023, 01:18:11 AM)

Author Topic: SQL versions and how to determine them.  (Read 3512 times)

xolik

  • King of the Geekery
  • Hacker
  • ****
  • Coolio Points: +541/-25
  • Offline Offline
  • Gender: Male
  • Posts: 5176
  • HAY GUYS
    • View Profile
SQL versions and how to determine them.
« on: March 06, 2007, 11:27:22 AM »

If you're like me and am terrified to do anything at all with SQL server, but want to find out which version and SP you're running on a particular server because the boss wants to know, then here's a handy website that will help you out:

http://sqlserverbuilds.blogspot.com/

I like doing it this way rather than opening up Enterprise Manager and accidentally dropping all tables doing the Select command that tells you the version.

This thread is now about random technology website links that provide other nifty information or about pie. I haven't decided yet.
Logged
Barium: What you do if CPR fails.

=-=-=-=-=-=-=-=-=-=-=
[The Fade^C Compound]
-=-=-=-=-=-=-=-=-=-=-

dcrog

  • Banned on the run
  • Hacker
  • ****
  • Coolio Points: +253/-2
  • Offline Offline
  • Posts: 1815
    • View Profile
Re: SQL versions and how to determine them.
« Reply #1 on: March 06, 2007, 12:05:11 PM »

My favourite is pecan pie.
Logged

Old enough to know better.
Apparently not wise enough.

And who says with age come's wisdom?

Vespertine

  • The VSUBjugator
  • Forum Moderator
  • Hacker
  • *
  • Coolio Points: +371/-38
  • Offline Offline
  • Posts: 1255
    • View Profile
Re: SQL versions and how to determine them.
« Reply #2 on: March 06, 2007, 12:10:41 PM »

There's an easier way than the select you're talking about.  Right click on the server (in Enterprise Manager) and select Properties.  The window that pops up will tell you the version you're at.
Logged
I have come here to chew bubble gum and kick ass.  And, I'm all out of bubble gum.

ivan

  • Forum Moderator
  • Hacker
  • *
  • Coolio Points: +499/-50
  • Offline Offline
  • Posts: 4929
  • Not a Mod, nor a Rocker. A Mocker.
    • View Profile
Re: SQL versions and how to determine them.
« Reply #3 on: March 06, 2007, 12:36:36 PM »

Here's the statement I use all the time:

"Hey, [sys admin]! What version we on?"
Logged
"I TYPE 120 WORDS PER MINUTE, BUT IT'S IN MY OWN LANGUAGE!"  -Detta

xolik: WHERE IS OBAMA'S GIFT CERTIFICATE?
Demosthenes: Is that from the gifters movement?


Detta: Crappy old shorts and a tank top.  This is how I dress for work. Because my job is to get puked on.
Demosthenes: So is mine.  I work in IT.


bananaskittles: The world is 4chan and God is a troll.

xolik

  • King of the Geekery
  • Hacker
  • ****
  • Coolio Points: +541/-25
  • Offline Offline
  • Gender: Male
  • Posts: 5176
  • HAY GUYS
    • View Profile
Re: SQL versions and how to determine them.
« Reply #4 on: March 06, 2007, 12:56:11 PM »

There's an easier way than the select you're talking about.  Right click on the server (in Enterprise Manager) and select Properties.  The window that pops up will tell you the version you're at.

Hey, thanks! What I don't know about SQL could fill a warehouse, and when the dedicated admins are out, I need all the help I can get.  :-D

My favourite is pecan pie.

Me too! Then cherry.
Logged
Barium: What you do if CPR fails.

=-=-=-=-=-=-=-=-=-=-=
[The Fade^C Compound]
-=-=-=-=-=-=-=-=-=-=-

xolik

  • King of the Geekery
  • Hacker
  • ****
  • Coolio Points: +541/-25
  • Offline Offline
  • Gender: Male
  • Posts: 5176
  • HAY GUYS
    • View Profile
Re: SQL versions and how to determine them.
« Reply #5 on: March 06, 2007, 12:56:29 PM »

Crap doublepost
Logged
Barium: What you do if CPR fails.

=-=-=-=-=-=-=-=-=-=-=
[The Fade^C Compound]
-=-=-=-=-=-=-=-=-=-=-

ivan

  • Forum Moderator
  • Hacker
  • *
  • Coolio Points: +499/-50
  • Offline Offline
  • Posts: 4929
  • Not a Mod, nor a Rocker. A Mocker.
    • View Profile
Re: SQL versions and how to determine them.
« Reply #6 on: March 06, 2007, 01:35:05 PM »

Code: [Select]
Declare @Warehouse int
Declare @WhatIvanKnowsAboutSQL int
Declare @SQLFact char(1049)

set @Warehouse = 2147483647
set @WhatIvanKnowsAboutSQL = 0

Declare WhatIvanKnows Cursor FAST_FORWARD for
     Select SQLFact From EverythingIvanKnows Where SQLFact <> ''

Open WhatIvanKnows

Fetch WhatIvanKnows into @SQLFact

While @@fetch_status = 0

Begin

     if @SQLFact not in (select * from WhatEveryIdiotKnowsAboutSQL)
     begin
               set @WhatIvanKnowsAboutSQL = @WhatIvanKnowsAboutSQL + 1
     end

     Fetch WhatIvanKnows into @SQLFact

End

Close WhatIvanKnows
Deallocate WhatIvanKnows

Print 'What Ivan knows about SQL fills ' + Cast(100 * @WhatIvanKnowsAboutSQL /  @Warehoue as varchar) + ' percent of a warehouse.'

GO

I'm afraid to run this.
Logged
"I TYPE 120 WORDS PER MINUTE, BUT IT'S IN MY OWN LANGUAGE!"  -Detta

xolik: WHERE IS OBAMA'S GIFT CERTIFICATE?
Demosthenes: Is that from the gifters movement?


Detta: Crappy old shorts and a tank top.  This is how I dress for work. Because my job is to get puked on.
Demosthenes: So is mine.  I work in IT.


bananaskittles: The world is 4chan and God is a troll.

pbsaurus

  • Hacker
  • ****
  • Coolio Points: +354/-31
  • Offline Offline
  • Gender: Male
  • Posts: 9981
  • Everyone Loves The King Of The Sea
    • View Profile
    • http://www.myspace.com/flipperpete
Re: SQL versions and how to determine them.
« Reply #7 on: March 06, 2007, 01:49:01 PM »

I make an awesome sour cream blueberry pie.  Chocolate cream and coconut cream are runners up as is pecan pie.  Sandy makes a wonderful sour cream apple pie.

Vespertine

  • The VSUBjugator
  • Forum Moderator
  • Hacker
  • *
  • Coolio Points: +371/-38
  • Offline Offline
  • Posts: 1255
    • View Profile
Re: SQL versions and how to determine them.
« Reply #8 on: March 06, 2007, 05:19:24 PM »

Code: [Select]
Declare @Warehouse int
Declare @WhatIvanKnowsAboutSQL int
Declare @SQLFact char(1049)

set @Warehouse = 2147483647
set @WhatIvanKnowsAboutSQL = 0

Declare WhatIvanKnows Cursor FAST_FORWARD for
     Select SQLFact From EverythingIvanKnows Where SQLFact <> ''

Open WhatIvanKnows

Fetch WhatIvanKnows into @SQLFact

While @@fetch_status = 0

Begin

     if @SQLFact not in (select * from WhatEveryIdiotKnowsAboutSQL)
     begin
               set @WhatIvanKnowsAboutSQL = @WhatIvanKnowsAboutSQL + 1
     end

     Fetch WhatIvanKnows into @SQLFact

End

Close WhatIvanKnows
Deallocate WhatIvanKnows

Print 'What Ivan knows about SQL fills ' + Cast(100 * @WhatIvanKnowsAboutSQL /  @Warehoue as varchar) + ' percent of a warehouse.'

GO

I'm afraid to run this.

That's funny and all, but I'd ban you from my server FOREVER for intentionally writing a cursor when there were much better options available to you.
Logged
I have come here to chew bubble gum and kick ass.  And, I'm all out of bubble gum.

ivan

  • Forum Moderator
  • Hacker
  • *
  • Coolio Points: +499/-50
  • Offline Offline
  • Posts: 4929
  • Not a Mod, nor a Rocker. A Mocker.
    • View Profile
Re: SQL versions and how to determine them.
« Reply #9 on: March 06, 2007, 06:11:50 PM »

That's funny and all, but I'd ban you from my server FOREVER for intentionally writing a cursor when there were much better options available to you.

Pfff. You're no fun anymore. Cursors are teh funnay!!!

But fine, here you go:

1:
Code: [Select]
Declare @Warehouse int
Declare @WhatIvanKnowsAboutSQL int

set @Warehouse = 2147483647
set @WhatIvanKnowsAboutSQL = 0

select     @WhatIvanKnowsAboutSQL = count(a1.SQLFact)
from       EverythingIvanKnows a1
where     a1.SQLFact <> ''
and        not exists (select a2.SQLFact from WhatEveryIdiotKnowsAboutSQL a2 where a2.SQLFact = a1.SQLFact)

Print 'What Ivan knows about SQL fills ' + Cast(100 * @WhatIvanKnowsAboutSQL /  @Warehoue as varchar) + ' percent of a warehouse.'

GO
Logged
"I TYPE 120 WORDS PER MINUTE, BUT IT'S IN MY OWN LANGUAGE!"  -Detta

xolik: WHERE IS OBAMA'S GIFT CERTIFICATE?
Demosthenes: Is that from the gifters movement?


Detta: Crappy old shorts and a tank top.  This is how I dress for work. Because my job is to get puked on.
Demosthenes: So is mine.  I work in IT.


bananaskittles: The world is 4chan and God is a troll.

ivan

  • Forum Moderator
  • Hacker
  • *
  • Coolio Points: +499/-50
  • Offline Offline
  • Posts: 4929
  • Not a Mod, nor a Rocker. A Mocker.
    • View Profile
Re: SQL versions and how to determine them.
« Reply #10 on: March 06, 2007, 06:13:58 PM »

(Not nearly as funny, but at least I won't get kicked off Vespertine's server!)
Logged
"I TYPE 120 WORDS PER MINUTE, BUT IT'S IN MY OWN LANGUAGE!"  -Detta

xolik: WHERE IS OBAMA'S GIFT CERTIFICATE?
Demosthenes: Is that from the gifters movement?


Detta: Crappy old shorts and a tank top.  This is how I dress for work. Because my job is to get puked on.
Demosthenes: So is mine.  I work in IT.


bananaskittles: The world is 4chan and God is a troll.

Vespertine

  • The VSUBjugator
  • Forum Moderator
  • Hacker
  • *
  • Coolio Points: +371/-38
  • Offline Offline
  • Posts: 1255
    • View Profile
Re: SQL versions and how to determine them.
« Reply #11 on: March 06, 2007, 06:42:36 PM »

Pfff. You're no fun anymore.
<snip>
I know.  I suck. 
[/dejected]
Logged
I have come here to chew bubble gum and kick ass.  And, I'm all out of bubble gum.

ivan

  • Forum Moderator
  • Hacker
  • *
  • Coolio Points: +499/-50
  • Offline Offline
  • Posts: 4929
  • Not a Mod, nor a Rocker. A Mocker.
    • View Profile
Re: SQL versions and how to determine them.
« Reply #12 on: March 07, 2007, 12:32:31 PM »

I know.  I suck. 
[/dejected]

Yes, you do.
Logged
"I TYPE 120 WORDS PER MINUTE, BUT IT'S IN MY OWN LANGUAGE!"  -Detta

xolik: WHERE IS OBAMA'S GIFT CERTIFICATE?
Demosthenes: Is that from the gifters movement?


Detta: Crappy old shorts and a tank top.  This is how I dress for work. Because my job is to get puked on.
Demosthenes: So is mine.  I work in IT.


bananaskittles: The world is 4chan and God is a troll.

ivan

  • Forum Moderator
  • Hacker
  • *
  • Coolio Points: +499/-50
  • Offline Offline
  • Posts: 4929
  • Not a Mod, nor a Rocker. A Mocker.
    • View Profile
Re: SQL versions and how to determine them.
« Reply #13 on: March 07, 2007, 12:33:12 PM »

IN THE WORLD WHERE EVERYTHING IS OPPOSITE!!!!
Logged
"I TYPE 120 WORDS PER MINUTE, BUT IT'S IN MY OWN LANGUAGE!"  -Detta

xolik: WHERE IS OBAMA'S GIFT CERTIFICATE?
Demosthenes: Is that from the gifters movement?


Detta: Crappy old shorts and a tank top.  This is how I dress for work. Because my job is to get puked on.
Demosthenes: So is mine.  I work in IT.


bananaskittles: The world is 4chan and God is a troll.

Pyrenus

  • Jail Bait
  • *
  • Coolio Points: +30/-4
  • Offline Offline
  • Posts: 115
    • View Profile
Re: SQL versions and how to determine them.
« Reply #14 on: March 22, 2007, 03:50:14 PM »

Using left outer joins will speed up your execution time by about 3x:




Declare @Warehouse int
Declare @WhatIvanKnowsAboutSQL int

set @Warehouse = 2147483647
set @WhatIvanKnowsAboutSQL = 0

select     @WhatIvanKnowsAboutSQL = count(a1.SQLFact)
from       EverythingIvanKnows a1
LEFT OUTER JOIN WhatEverIdiotKnowsAboutSQL A2 ON A2.SQLFact = a.SqlFact
where     a1.SQLFact <> ''
AND A2.SQLFact IS NULL

Print 'What Ivan knows about SQL fills ' + Cast(100 * @WhatIvanKnowsAboutSQL /  @Warehoue as varchar) + ' percent of a warehouse.'

GO
Logged