Showing posts with label equivalent. Show all posts
Showing posts with label equivalent. Show all posts

Thursday, March 29, 2012

Boolean in SQL Server 2005

What is the boolean equivalent for TRUE and FALSE in SQL Server 2005?

In Access true = -1 and false = 0
What should I use in SQL Server bit values?0 = false; 1 = true|||Can I write statements like Match='TRUE' instead of Match=1?|||

No, you need to use 0 and 1. SQL Server has no knowledge of true and false. This is only possible by creating custom data type via .NET.

Greetz,

Geert

Geert Verhoeven
Consultant @. Ausy Belgium

My Personal Blog

|||Hi,

but this is not recommended, you should really use the internal used data types for this simple operations. Your application should transfer the value to refelect the appropiate SQL Statements and present the data types the way you want the users to see them.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||why you want to do this. Do you have requirment to write a one code for both SQL Server and Access

Friday, February 10, 2012

Bitmap index in sql server

Hi
I was using bitmap index in Oracle and now moving to SQL Server 2000. Is there any "equivalent" of bitmap index in sql server ? Any help / links ?
Thanks,
SamIf I'm not mistaken a bitmap index also indexes null values. As far as I know, sqlserver does not have special indexes (not) considering specific null values. A regular index will work. Lookup Indexes in Books Online (BOL).

In the analyzer (turn on execution plan):
use monkey
go

set nocount on

create table tab1 (myint integer null, myval integer not null)
go

create index idx_tab1_myint on tab1 (myint)
go

insert into tab1 (myint, myval) values (1,1)
insert into tab1 (myint, myval) values (null,2)
go

select myint from tab1

go

drop table tab1
go|||A bitmap index is an index that can be used on columns with little different values in it (eg sexe: values male, female and unknown/null), for example in Oracle. This type of index is not available in SQL Server.

If I'm not mistaken a bitmap index also indexes null values.
In SQL Server you can also create indexes that allow null values