Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Creating new sql table including java array!

Author  Topic 

Eithne
Starting Member

8 Posts

Posted - 2004-10-12 : 08:18:49
I'm creating a table something like this :

CREATE TABLE account
(account_id VARCHAR(8),
type VARCHAR(24),
description VARCHAR(30),
balance NUMERIC(10,2),
credit_line NUMERIC(10,2),
begin_balance NUMERIC(10,2),
begin_balance_time_stamp TIMESTAMP,
full_description VARCHAR(200),
comments VARCHAR(200),
number_bad_debts INTEGER,
interest_rate_credit NUMERIC(10,2),
interest_rate_debit NUMERIC(10,2),
dirt NUMERIC(10,2),



The next column I want to put in is an array in my java program, can I create a column of type array?? If so how ??

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-10-12 : 08:28:16
There is no array type in SQL Server, and storing an array in a column is an inefficient method. SQL is a set-based language, and would better store elements of an array as separate rows in a table.

You might be able to use these articles as a guideline for how to parse and store your array in a table:

http://www.sqlteam.com/item.asp?ItemID=637
http://www.sqlteam.com/item.asp?ItemID=2652
http://www.sqlteam.com/searchresults.asp?SearchTerms=csv
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-10-12 : 08:28:25
no you can't.
tables are kind of arrays.
so for your array use another table, or save the array in varchar column in csv format.

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -