SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Boolean Value in MS SQL Server.


Boolean Value in MS SQL Server.

Author
Message
ThomasH
ThomasH
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1191 Visits: 1

I've been following this thread... was thinking maybe some form of the following may be usable...

-- In T-SQL
Create Table TestTable (ID Int, TestF Bit)
-- Then change:
-- Insert into TestTable (ID, TestF) Values (10, True)
-- to something like:
Insert into TestTable (ID, TestF) SELECT 10, True -- Won't Work, but
Insert into TestTable (ID, TestF) SELECT 10, True From (Select 1 as True, 0 as False) DerivedTB
-- or
Insert into TestTable (ID, TestF) SELECT 10, False From (Select 1 as True, 0 as False) DerivedTB

where all but the new values are "constant" texts.





Once you understand the BITs, all the pieces come together
noeld
noeld
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22492 Visits: 2048

The problem is that the SQL CAN'T BE CHANGED




* Noel
ThomasH
ThomasH
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1191 Visits: 1

Yeh Noel, I hear ya. Just wanted to maybe give you some "ammo" or thoughts that might help.

Is the statement hard coded into an app some where, and is now being issued to SQLSrv. instead of Access?





Once you understand the BITs, all the pieces come together
noeld
noeld
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22492 Visits: 2048
What happened in this case is that Access is Smart Enough to convert True to 1 when sending the query to sql server


* Noel
noeld
noeld
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22492 Visits: 2048

I have no clue.

I didn't post the question




* Noel
Frank Kalis
Frank Kalis
SSCoach
SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)

Group: General Forum Members
Points: 19527 Visits: 289

Yes, would be interesting to hear why the statement can't be changed.

If that's a third party app, I wouldn't hesitate to contact the vendor.

Just a thought!

Would there be any gain when this front-end would fire the query against an ADP project with linked SQL Server tables? I don't know what ADP exactly does, but the statement wouldn't need to be changed.



--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search