Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Script Library
 If statement depending sql version (32 or 64 bit)

Author  Topic 

atletico
Starting Member

6 Posts

Posted - 2011-11-16 : 10:15:03
Hi all,

I need to execute a statement in case that the sql server is 64bit and another statement in case that is 32 bit.
This will be like below:

IF 64bit version (of SQL server) then
BEGIN
…Some statements
END
ELSE -- 32 bit version
BEGIN
…Some statements
END

In order to get this info I am using the ‘@@version’ statement but I don’t know how to handle this on a script mode.

Does anybody do this before?

Thanks,
GK

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-11-16 : 10:27:53
if (select @@version) like '%x64%'
begin
...

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

atletico
Starting Member

6 Posts

Posted - 2011-11-16 : 10:54:24
Finally it was so easy :( ...thanks a lot nigelrivett
Go to Top of Page
   

- Advertisement -