Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4074044
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:06:43+00:00 2026-05-20T17:06:43+00:00

I have a sql server 2005 database that has a table with a column

  • 0

I have a sql server 2005 database that has a table with a column of data type bit. When I look at the data in sql server management studio I see the column value as 0 or 1, when i pull with SAS I see 0 or -1, is like SAS is negating the 1 value. Anyone have an explanation for this? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:06:44+00:00Added an answer on May 20, 2026 at 5:06 pm

    I reckon you must be using libname oledb to connect to SQL Server from SAS. I’m able to replicate your problem here:-

    SQL Server code to generate dummy data

    create table dbo.tbl (
        tblId           int identity(1,1)   not null
                        constraint pk_tbl_tblId primary key,
    
        bool        bit not null,
    )
    go
    
    insert into dbo.tbl(bool) values(0)
    insert into dbo.tbl(bool) values(1)
    

    SAS code using OLEDB

    libname imm oledb provider=sqloledb
            properties=(
                "Integrated Security"=SSPI
                "Persist Security Info"=False
                "Initial Catalog"=test
                "Data Source"=localhost
            );
    
    proc print data=imm.tbl; run;
    

    The print out is:-

    Obs          tblId    bool
    
    1              1      0
    2              2     -1
    

    SAS code using PROC SQL

    It seems like using PROC SQL should fix your problem.

    proc sql noprint;
        connect to sqlservr (
            server='localhost' 
            database='test' 
            'Integrated Security'='SSPI' 
            'Persist Security Info'='False'
        );
    
        create table test as
        select *
        from connection to sqlservr (
            select * from dbo.tbl
        );
    
        disconnect from sqlservr;
    quit;
    
    proc print data=test; run;
    

    The print out is:-

    Obs          tblId    bool
    
    1              1      0
    2              2      1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a column in the database (SQL Server 2005) that has data with
I have a table in SQL Server 2005 database that has following columns: Id,ProductName,Year,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec
I have a table in a SQL Server 2005 database with a trigger that
I have a SQL Server 2005 database that stores data for multiple users. Each
I have a MS SQL Srver 2005 Database, that has a table with a
I have a SQL Server 2005 database that is suffering from lock starvation because
I have a SQL Server 2005 database that I'm trying to access as a
I have a SQL Server 2005 database that is linked to an Oracle database.
We have a Microsoft SQL Server 2005 database that needs to be converted back
I have a 'reference' SQL Server 2005 database that is used as our global

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.