Convert Table Data Into Array Or Maybe Something Else?!?

I am using vs2008 with c#.
I have table in my database that has email addresses stored in a column.  I would like somehow to take each email address from every row and paste them into a textbox that can be copied and pasted with a comma delimiter into outlook so I can send a mass email.
I have no idea how I can accomplish this task. 



ADVERTISEMENT

Creating A Stored Procedure That Will Summarize Data In A Table Into A Table Reflecting Period Data Using An Array Type Field

I am attempting to create a stored procedure that will launch at report runtime to summarize data in a table into a table that will reflect period data using an array type field.  I know how to execute one line but I am not sure how to run the script so that it not only summarizes the data below but also creates and drops the table.
 
Any help would be greatly appreciated.
 
Current Table
 
Project   |  Task      | Category |  Fiscal Year | Fiscal Month | Total Hours
---------------------------------------------------------------------------------------------------------
Proj 1     |  Task 1   | Cat 1      |  2007           |  01                |   40
Proj 1     |  Task 1   | Cat 2      |  2007           |  02                |   20
Proj 1     |  Task 1   | Cat 3      |  2007           |  03                |   35
Proj 1     |  Task 1   | Cat 1      |  2008           |  01                |   40
Proj 1     |  Task 1   | Cat 2      |  2008           |  02                |   40
Proj 1     |  Task 1   | Cat 3      |  2008           |  03                |   40
 
Proposed Table
 
Project   | Task      | Category   | Fiscal Month 01   | Fiscal Month 02   | Fiscal Month 03 | Fiscal Year
---------------------------------------------------------------------------------------------------------------------------------------------------
Proj 1     |  Task 1  | Cat 1        |          40              |           0               |         0              |    2007
Proj 1     |  Task 1  | Cat 2        |           0               |         20               |         0              |    2007Proj 1     |  Task 1  | Cat 3        |           0               |           0               |        35             |    2007
Proj 1     |  Task 1  | Cat 1        |         40               |           0               |          0             |    2008

Proj 1     |  Task 1  | Cat 2        |           0               |         40               |          0             |    2008
Proj 1     |  Task 1  | Cat 3        |           0               |           0               |        40             |    2008
 
Thanks,
Mike Misera

View Replies View Related

Import And Convert Table Data

Hi everyone,I have some data in a CSV file, and I have to import it into a table. For some reason, I am supposed to import this data into a temp table and then move it to the original table and I have to convert it to the right data types while I do this. Is there a better way to do this and how can I give custom error messages saying, for e.g., the data type cannot be converted, the right number of records are not present etc.
Thanks for the help.

View Replies View Related

Convert SQL Table Data To XML Format

Hello,

I need to convert a SQL table or SQL table data to XML format. I tried using the Import Export Wizard in SQL 2005 (used SQLXMLOLEDB and SQLXMLOLEDB 4.0 as the source). However, it didn't work. Any way you know how I can convert and obtain data in XML format?

Thanks all in advance,
Saurav

View Replies View Related

Convert To Uppercase The Data In Table

Hi

I am trying to output the data in the table to uppercase. I am using bcp to output as text file.Any possible solution to convert the data to uppercase from the table.Any tsql code for this


Thanks in advance

View Replies View Related

Convert .txt File With Ebcdic Data Type To SQL Table Via DTS

A text file can be imported to SQL table through DTS service, however all the fields with Ebcdic data type can't be converted. I know that I must need to to include a VBScript function with this DTS process to convert those fields. The following Foxpro function works fine in converting Ebcdic data type to a decimal type, as I now do a two step process to accomplish this task. Since I'm new in VB world, how can you create this function in VBScript and include it within DTS process?

function DblNum
************************************************** **********************
* Convert from a DBL number string into a regular number
************************************************** **********************
parameter string,decimal
*
dime decpos(4)
decpos(1) = 10
decpos(2) = 100
decpos(3) = 1000
decpos(4) = 10000
*
string = trim(string)
slen = len(string)
sign = 1
if !empty(string)
if !isdigit(substr(string,slen,1))
string = left(string,slen-1) + chr(asc(right(string,1)) - asc('p') + asc('0'))
sign = -1
endif
endif
if Decimal # 0
return sign*val(string)/decpos(decimal)
else
return sign*val(string)
endif

View Replies View Related

RS2005: Export To Excel Error: Destination Array Was Not Long Enough. Check DestIndex And Length, And The Array's Lower Bounds.

All,

I am using Reporting Services 2005.  One of my reports is getting the following error when I try to export to Excel.  It will export to .CSV though.

"Destination array was not long enough. Check destIndex and length, and the array's lower bounds."

Any suggestions would be greatly appreciated.  Please copy me at machelle.a.chandler@intel.com.

Machelle

 

View Replies View Related

How Would I Send A String Array As A Integer Array?

I have a stored procedure that has a paramter that accepts a string of values. At the user interface, I use a StringBuilder to concatenate the values (2,4,34,35,etc.) I would send these value to the stored procedure. The problem is that the stored procedure doesn't allow it to be query with the parameter because the Fieldname, "Officer_UID" is an integer data type, which can't be query against parameter string type.
What would I need to do to convert it to an Integer array?
@OfficerIDs as varchar(200) 
Select Officer_UID From Officers Where Officer_UID in (@OfficerIDs)
 Thanks

View Replies View Related

Inserting And Updating And Array Into An SQL Table

I have an asp.net project that displays a timesheet based on a fortnightly system.

It has a Y and X axis, i.e. Sun-Mon, Sun-Mon across the top and Categories of hour types accross the Y axis, i.e. Holidays, Overtime, Maintenance.

I was using a datagrid to gather the rows, but I need to have the whole grid in edit mode which is something that requires more coding. So I have swapped to a datalist.

It will take me 240 fields to store all the data in their corresponding fields. So I basically need to know if there is an easier way to store two dimensional array type data into an SQL table using a minimum of fields.

View Replies View Related

Array / Table As Return Type

Hello All,I have a scenario in which my stored procedure has to return fewvariables with their value and also the collection. Now in SQL their isno such as array, so the best is to return the table in place of.I am execting the stored procedure by having sql command in place.and created the various parameters(variables) those i need the valuesof and secondly wondering how should i be creating the parameter as atable returntype.Any help on this would be a million worth useful.I can excerpt the code if required.RegardsSandesh Kadam

View Replies View Related

Converting Array Into Table In SSRS

I am getting a array (multiple columns of similar information) from my Oracle stored procedure and need to put that in a table. I think I may to write some code, and I am no expert, any thought. Thanks

View Replies View Related

Passing An Array To Query In A Table Adapter

I'm looking for a way to pass an array of values as a parameter to a query in a table adapter.  For example I want to run a query something like:SELECT * FROM menu WHERE menu_role IN (@roles)And I could pass something like 'RegisteredUser, SuperUser, OtherUser' to the @roles parameter.For some reason I can't figure out a way to do this.  Any help would be greatly appericated.Thanks,Ryan. 

View Replies View Related

Array Like Data Type Ins Sql7 -- Please Help!!

Hi, all


Please help

Is it possible to create or use an array field type in sql 7/2000 as can be acheived in databases such as Oracle and Progress.


For example can the following or similar be done.

create table MarriedWomen(firstname char(20), surnames array(Name char(20), isMaidenName integer(1));


I have a work around at the moment which uses a comma seperated value type approach to store the array elements but this requires string processing to retreive individual values.


e.g surname "james 1, brown "

Is there an easier way to do this?

I would appreciate any comments from other who have had similar problems.





Thanks is advance,

Adrian

View Replies View Related

Store Data Into Temp Array

How can you loop over a data reader and save the current row to a temp array of some sort and return this array back to the caller?



SqlDecimal total = 0;
SqlConnection conn = new SqlConnection("Context Connection=true");
SqlCommand cmd = new SqlCommand(@"SELECT column1, column2, column3
FROM table ", conn);

conn.Open();

SqlDataReader rdr = cmd.ExecuteReader();


while (rdr.Read())
{
if (rdr.GetSqlString(1) == "01")
{
// ADD the current record to a temp list
total = total + rdr.GetSqlDecimal(2);
}

}

SqlContext.Pipe.Send(total.ToString());


// RETURN the temp list

rdr.Close();
conn.Close();

View Replies View Related

SSRS Using Xml Data And Array Properties: Is It Possible?

i'm using a vanilla XmlSerializer to write out a class structure to xml.
 
the class contains an array property something like this:
 
[Serializable]
class MyClass
{
 private long id;
 public long Id
 {
  get { return id; }
  set { id = value; }
 }
 private decimal[] monthValues = new decimal[12];
 public decimal[] MonthValues
 {

  get { return monthValues; }
  set { monthValues = value; }
 }
}

 
writing this out to xml gives a bizarre but consistent structure:
 
<?xml...?>
<DataTables>
 <MyClass ...>
  <Id>1</Id>
  <MonthValues>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
  </MonthValues>
 </MyClass...>
 <MyClass ...>
  <Id>2</Id>
  <MonthValues>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
   <decimal>0</decimal>
  </MonthValues>
 </MyClass...>
</DataTables>
 
reading this into SSRS gives not the two rows with an indexed property i was expecting, but twenty four rows with each decimal value in a separate row.

 
is this something i just have to live with? how do i make SSRS see this as two objects?

View Replies View Related

Index Was Outside The Bounds Of The Array - When Table Columns Deleted

 

Hi
 
If I delete 5 or more columns from a table I get the error "Index was outside the bounds of the array", OK is the only response.  I then have to close the report and then open it again.
 
Easy fix is don't delete more than 5 columns, but my template is setup with 15 columns as it's far quicker to delete them as it is to add them 1 by 1 each time.  I've finally got around to looking for a hotfix or something similar but can find no mention of this exact error relating to table column deleting.
 
Anyone else experience this or know if there is a hotfix for it?
 

Thanks

View Replies View Related

How To Convert A Table Containing Timetable Data Into A Proper Timetable Format

Using SQL Server 2005, I have set up a database for a school to provide timetables for students, teachers etc. The data is currently displayed in this form:
 
DAY   LESSON  YR    SUBJ    GRP    STAFF  ROOM
Mon    1              7       PE        T        Da        Gym
Mon    2              7       PE        T        Da        Gym
Mon    3              7       Ma        A        Pr         5
Mon    4              7       Ma        A        Pr         5
Mon    5              7       Ma        A        Pr         5
Mon    6              7       Dr        T        Fn        36
Mon    7              7       Dr        T        Fn        36
Mon    8              7       En        T        Bn        21
Mon    9              7       En        T        Bn        21
Tue     1              7      De        T        Df         27
Tue     2              7      De        T        Df         27

etc.
 
I would like to display this as timetable with DAYS as row headings and LESSON numbers as column headings, with the remaining column info. in the above table combined into one value:
 
                        1                             2                             3                             4         etc         

MON    (7 PE T Da Gym)      (7 PE T Da Gym)         (7 Ma A Pr 5)                (7 Ma A Pr 5)
TUE       (7 De T Df 27)            (7 De T Df 27)    etc.
WED
THU
FRI
 Should I be doing this with PIVOT (scares the life out of me ...) or is there some other solution? Many thanks.

View Replies View Related

Parse Array Data Type To Rows

Hi,

 

We're importing data from a progress db. Some of the columns contain arrays or delimited values which represent accounting periods.

 

Currently I'm passing the arrays row by row to a stored  procedure which parses and inserts each value as a row for the applicable accounting period, it works but is very slow.

 

Any Ideas?

 

Thanks

 

Emilio

View Replies View Related

Array Data Type In SQL Server 2005

Hi,

I was migrating from Oracle to SQL Server 2005 using SSMA (SQL Server Migration Assistant) but i`ve found an issue, i can´t find how to fix it. In my stored procedure in PL/SQL exists this lines:

  TYPE  T_ARRAY_COL IS    VARRAY  (1000 ) OF  VARCHAR2 (50);
  A_COLUMNS T_ARRAY_COL := T_ARRAY_COL();

Somebody know how can i simulate this data type ARRAY.  I was reading http://msdn.microsoft.com/msdnmag/issues/04/02/TSQLinYukon/ but some things are not clear for me.... please help me, give me one hand.

Thank you

David


 
 

View Replies View Related

Array Data Type In SQL Server Stored Procedures?

Is there any array data type in SQL Server 7.0. I am using VB 6.0 with ADO 2.1. I am populating a MSFlexGrid with values that I pass to SQL Server one at a time and insert into the database. What I would like to do is pass the entire contents of the Grid at once to a stored procedure and let SQL do the processing so my routine is not going back and forth to the client. I did not find any documentation on any array data types in SQL. What is my best approach to this problem?
Thanks,
Dan Collins

View Replies View Related

User Defined Function: Convert String Value Of Table To Table Object

Does anyone know where to find or how to write a quick user defined fucntionthat will return a table object when passed the string name of the tableobject. The reason why I want dynamicallly set the table name in a storedprocudue WITHOUT using concatination and exec a SQL String.HenceIf @small_int_parameter_previous = 1 then@vchar_tablename = "sales_previous"else@vchar_tablename = "sales"Endselect * from udf_TableLookup(@vchar_tablename )So if I pass 1, that means I want all records from "sales_previous"otherwise give me all records from "sales" (Sales_Previous would last yearssales data for example).udf_TableLookup would I guess lookup in sysobjects for the table name andreturn the table object? I don't know how to do this.I want to do this to avoid having 2 stored procedures..one for current andone for previous year.Please respond to group so others may benfiit from you knowledge.ThanksErik

View Replies View Related

Array Of Array - IRR Function

Hi, I am using the IRR function in a report. I have created the following code so it creates an array:
 
Public GroupIRRArray(-1) As Double
Public Function addToIRRArray(ByVal BMV As Decimal, ByVal BAB As Decimal, ByVal EMV As Decimal, ByVal EAB As Decimal, ByVal CFB As Decimal)
Dim g As Integer
g = uBound(GroupIRRArray) + 1
ReDim Preserve GroupIRRArray(g)
if g=0 then
 GroupIRRArray(g) =  (CFB+EAB-BAB+BMV)*-1
else if g=1 then
 GroupIRRArray(g) = (BAB-CFB-EAB+EMV)
else
 GroupIRRArray(g-1)= GroupIRRArray(g-1)-(BMV)
 GroupIRRArray(g) =  (BAB-CFB-EAB+EMV)
end if
End Function
 


It works fine but now I want to create multiple groups within my report. How can I change the code so it loops on another parameter? What I had in mind was to create an initial array with the parameter value that I want to use for grouping and a dynamic array based on the name of each group. So I would end up with one array containing the group name plus x number of arrays with the raw data. Alternatively, is there a way to use the IRR function without creating a custom code? Like a conversion parameter that would make my floating field a one dimensional array?
 
Thanks,
Jam

View Replies View Related

How To Convert To Regular Text, Data Stored In Image Data Type Field ????

Hi,This is driving me nuts, I have a table that stores notes regarding anoperation in an IMAGE data type field in MS SQL Server 2000.I can read and write no problem using Access using the StrConv function andI can Update the field correctly in T-SQL using:DECLARE @ptrval varbinary(16)SELECT @ptrval = TEXTPTR(BITS_data)FROM mytable_BINARY WHERE ID = 'RB215'WRITETEXT OPERATION_BINARY.BITS @ptrval 'My notes for this operation'However, I just can not seem to be able to convert back to text theinformation once it is stored using T-SQL.My selects keep returning bin data.How to do this! Thanks for your help.SD

View Replies View Related

How To Convert Foxpro Table In To MSSQL Table

Hi
I am trying to convert foxpro database table example mytable.dbf in to MSSQL Database table. I have created odbc connection to foxpro database, Then i have created an data set in which i have fill the mytable (stucture and data) by odbc adapter. Now i want to import this Data Set in to the sql database. My table (stucture and data) is in memory and my proble is that how i can write to sql data set or create data table which i can see in MSSQL Database.
Please Suggest
Thanks in Advance.
 
 

View Replies View Related

How To Convert Verical Table To Horizontal Table?

I’ve a vertical table as follows: CMDATA

IDFormIDRecordCountFieldNameValue
15251204 Name John
25881204 OrganizationGE
35251257 Name Peter
45881257 OrganizationIntel
55251272 Name Rita

And a horizontal table as follows: CMFORM

IDFormIDRecordCount
15251204
25251257
35251272
45881204
55881257

Where
CMDATA.FormID = CMFORM.FormID and
CMDATA.RecordCount = CMFORM.RecordCount

Now I want select records as follows:

RecordCountNameOrganization
1204 JohnGE
1257 Peter Intel
1272 RitaNULL

I’ve written following query for that but it works properly only if all the record count has similar fieldnames.

SELECTCMCF.RecordCount,
CMD1.VALUE AS Name,
CMD2.VALUE AS Organization
FROMCMDATA CMD1
JOIN CMFORMS CMCF ON CMD1.FORMID = CMCF.FORMID AND CMD1.RECORDCOUNT = CMCF.RECORDCOUNT
JOIN CMDATA CMD2 ON CMD2.FORMID = CMCF.FORMID AND CMD2.RECORDCOUNT = CMCF.RECORDCOUNT
WHERECMD1.FIELDNAME = 'Name'
AND CMD2.FIELDNAME = 'Organization'
AND CMCF.RecordCount in(1204,1257,1272)

Is there any other way to handle this?

View Replies View Related

How To Convert Verical Table Into Horizontal Table

I’ve a vertical table as follows: CMDATA

IDFormIDRecordCountFieldNameValue
15251204 Name John
25881204 Organization GE
35251257 Name Peter
45881257 OrganizationIntel
55251272 Name Rita

And a horizontal table as follows: CMFORM

IDFormIDRecordCount
15251204
25251257
35251272
45881204
55881257

Where
CMDATA.FormID = CMFORM.FormID and
CMDATA.RecordCount = CMFORM.Record Count

Now I want select records as follows:

RecordCountNameOrganization
1204 JohnGE
1257 PeterIntel
1272 RitaNULL

I’ve written following query for that but it works properly only if all the record count has similar fieldnames.

SELECTCMCF.RecordCount,
CMD1.VALUE AS Name,
CMD2.VALUE AS Organization
FROMCMDATA CMD1
JOIN CMFORMS CMCF ON CMD1.FORMID = CMCF.FORMID AND CMD1.RECORDCount = CMCF.RECORDCount
JOIN CMDATA CMD2 ON CMD2.FORMID = CMCF.FORMID AND CMD2.RECORDCount = CMCF.RECORDCount
WHERECMD1.FIELDNAME = 'Name'
AND CMD2.FIELDNAME = 'Organization'
AND CMCF.RecordCount in(1204,1257,1272)

Is there any other way to handle this?

View Replies View Related

Could Anybody Tell Me How To Convert Vertical Data Into Horizontal Data?

Could anybody tell me how to convert vertical data into horizontal data?I have a one-to-many relationship in sql server 2KProduct, ProductAccessory, one Product has many ProductAccessories.My Table design is like this:Table Product{   ProdId int,   ProdNameId int,   ....}Table ProductAccessory{   ProdId int,   AccNameId int,   AccUnitId int,   ....}Because one Production has at most 4 ProductAccessoryI want to use a SELECT statement OR function to return ProdId, ProdNameId, AccNameId1, AccUnitId1, AccNameId2, AccUnitId2, AccNameId3, AccUnitId3, ....Any help will be appreciated! Thanks a lotJoseph

View Replies View Related

Convert Table Using DTS

Hi,how to:using dts convert row in table to column.i have table:col1,col2b1 , 1b2 , 2b1 , 4b3 , 3b2 , 5and i want using dts convert/rewrite this table to another table:b1,b2,b31,null,nullnull,2,null4,null,nullnull,null,3null,5,null

View Replies View Related

Convert Table

I have the following table:
 
 
RecordKey             MonthYear       SD1          SD2         SD3
    1                         Jan 2008             6             AA             0
    2                         Feb 2008            10            BB             3
    3                         Mar 2008            12            CC             8
 
etc....
 

 
I need to transform it to this:
 
 
        1                    2                   3

  Jan 2008         Feb 2008       Mar 2008
       6                     10                12
       AA                  BB                CC
       0                     3                  8

 
 
Can this be done in SQL?

View Replies View Related

Convert A Table Into Tree

Hi..I have a table  register..in this fields are username,parent id,downline ; I have to determine all the child of a particular parent.
suppose table is like this.  username   parentid        downline
                                         B                A                left
                                         C               A                 right
                                         D                B               left
                                         E                B               right....
I have to also determine the level in the tree....please help...

View Replies View Related

Convert Foxpro 3.0 Table

Hi,

I've got about 6000 tables in foxpro 3.0 and a database in sql srv 2000.

now i've to convert the data of these 6000 tables into the database. the problem is that i have to convert all the tables seperatly!

is there a tool where i can convert these tables automatically?

i know it can with DTS, but the 6000 tables are divided over 1400 directories. So with DTS i can't convert them automatically.

does anyone know a solution?

View Replies View Related

Convert Row Of Table To Column

tblname rowno colname colvalue
emp 1 Title Mr
emp 1 firstname XYZ
emp 1 lastname M
I want to get as

title first_name lastname
Mr XYZ M

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved