473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

constructing varchar computed column , using bit fields

Shashi Sadasivan
1,435 Expert 1GB
Hi,
Due to a certain circumstance i have to add a field to my table, which would be a varchar type. this varchar contructs istfel using 4 fields of type bit

so if the table def goes as
isA(bit), isB(bit), isC(bit), isD(bit), ABCD(varchar(4))

the value of the field ABCD should be constructued from the 4 bit fields
if isA,isC is checked then ABCD should be AC
if isA,isB,isD is checked then ABCD should be ABD
is there a way i could achieve it using computed columns or would i have to make a trigger..(which i am also not sure on how to go about it)

Sorry for the trouble, but i couldnt get my head around with starting it either !

thankyou
Nov 7 '07 #1
1 1411
Shashi Sadasivan
1,435 Expert 1GB
Hi,
Updating on what i have done
Created a trigger on insert,update
and with a series of IF statements i contructed the varchar field based on if the bit fields were set to true.
Nov 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: BCR | last post by:
I created a index on a computed column. I did not see any improvement in performance with a join to this column and also my inserts and updates to this table are failing. Any ideas? Chender
9
by: DMAC | last post by:
If i want to split a computed column into two or more columns based on the the length (its a varchar) of the computed column, how often will sql server determine what the computed column is?...
0
by: Jim Heavey | last post by:
Hello, I have created a computed column which concatenates a name and date. My problem is that if the 10 is not 10 characters, I get an extra character placed into the computed column. Here is the...
4
by: Bill Todd | last post by:
Is there any way to display the RowState of each row in a computed column in the DataTable? -- Bill
7
by: Han Holl | last post by:
Hi, Can anyone explain to me what I'm doing wrong: (The first select is to show that the function rubriek exists, and does work). I want to create an index on a computed column: palga=>...
6
by: jim_geissman | last post by:
Can I create an index on a variation of a column that isn't actually in the table? I have a ParcelNumber column, with values like 123 AB-670 12345ABC 000-00-040 12-345-67 AP34567890
2
by: Dot Net Daddy | last post by:
Hello, I want to assign a column a computed value, which is the multiplication of a value from the table within and a value from another table. How can I do that?
2
by: garridor | last post by:
I am working on a DB I created for a small employee scheduling software (in VB 2005) - to be used my parents in their non profit business. I would like to capture a time span between TimeIn and...
1
by: coder1234 | last post by:
I'm trying to create a computed column in a table in SQL Server 2005 and can't get the syntax right for the Formula. I want the computed column to be a bit data type which resolves to 1/0...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.