473,327 Members | 1,919 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,327 software developers and data experts.

how to specify the column name

Dear friends,

If i want to specify the column name as "acc_no" then it
total size is 6 it must get the first two letters as alphapets and the
remaining 4 as numbers for this how to write the query?. Please reply.

By,
Gobi S.

Jun 13 '06 #1
3 1404
what is the naming procedure i.e will you know what the letters and numbers
will be .
If you mean dynamically create the value then
DECLARE @number INT
SET @number = mynumber
'aa_'+convert(varchar(4),@number)

--
----
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
___________________________________
"gobiparthi" <go*******@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
Dear friends,

If i want to specify the column name as "acc_no" then it
total size is 6 it must get the first two letters as alphapets and the
remaining 4 as numbers for this how to write the query?. Please reply.

By,
Gobi S.

Jun 13 '06 #2
Hi Gobi

Not sure if you meant how to define the table or query it But here is how
you would define it.

Create table accountnums(
row_id int not null identity(1,1) Primary Key,
acc_no varchar(6))

alter table accountnums add CONSTRAINT CK_acc_no CHECK (acc_no LIKE
'[A-Z][A-Z][0-9][0-9][0-9][0-9]')

insert accountnums(acc_no) values('aa1234') --OK
insert accountnums(acc_no) values('AA1234') -ok
insert accountnums(acc_no) values('A11234') --Generates error.
--
-Dick Christoph

"gobiparthi" <go*******@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
Dear friends,

If i want to specify the column name as "acc_no" then it
total size is 6 it must get the first two letters as alphapets and the
remaining 4 as numbers for this how to write the query?. Please reply.

By,
Gobi S.

Jun 14 '06 #3
http://vyaskn.tripod.com/object_naming.htm

Madhivanan
gobiparthi wrote:
Dear friends,

If i want to specify the column name as "acc_no" then it
total size is 6 it must get the first two letters as alphapets and the
remaining 4 as numbers for this how to write the query?. Please reply.

By,
Gobi S.


Jun 14 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Thomas Jerkins | last post by:
When I write a create table SQL statement I want to add some information about the column heading of each column. How does the exact syntax for the create table look like (which includes this column...
1
by: unwiseone | last post by:
Hello, Does any know how to specify a value of a DTD element? For example, here's an external DTD that I have: ======================================= <!ELEMENT summercamps (Camp+)>...
3
by: Yeah | last post by:
I have an HTML table with two columns of text. Here's what it looks like: FIRST COLUMN (each cell is ID="date') Background orange, font Serif size 13px, aligned center SECOND COLUMN (each cell...
8
by: John Baker | last post by:
Hi: Access 2000 W98! I have a table with numerous records in it, and am attempting to delete certain records that have been selected from it. These are selected based on the ID number in a...
0
by: Grey | last post by:
i need to design a datagrid in asp.net. the column name of the grid is changing every time it generate. the column name should be get from the xml attribute. is it possible to do that ?? million...
37
by: Jan Wagner | last post by:
Hi, can't figure this one out, what's the CSS way to specify the language? In HTML it would be simply an lang="xx" attribute, or XHTML xml:lang="xx", but, how about in CSS? This would be...
0
by: 205210864 | last post by:
have to write page headings and column headings to a text file from vb.net. please send me a piece of code to illustrate this process. eg. heading = "heading" column name = "column 1" ,...
0
by: MeDontGetSomething | last post by:
The thing is I'm currently working with Infragistics NetAdvantage UltraGrid and I use DataSet with one table as DataSource. Since data dosen't come straigh from database i have to make columns of...
3
by: =?Utf-8?B?Q0QuU21hbGxleQ==?= | last post by:
Is there a command line switch available for the EventViewer which will allow me to specify which directory to view the available logs from? I will have multiple workstations writing to a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.