Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS SQL Server






SuperbHosting.net & Arvixe.com have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for BigResource.com.







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. 


View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
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
DTS - Convert Data
 I have :
OLE DB data source -> Data Conversion->Excel destination
 
and when I run my packet I have error
 
TITLE: Package Validation Error------------------------------
Package Validation Error
------------------------------ADDITIONAL INFORMATION:
Error at SAP_WF [Excel Destination [150]]: Columns "kpi_code" and "KPI " cannot convert between unicode and non-unicode string data types.
Error at SAP_WF [Excel Destination [150]]: Columns "kpi_desc" and "Desc" cannot convert between unicode and non-unicode string data types.
Error at SAP_WF [Excel Destination [150]]: Columns "com_code" and "CC" cannot convert between unicode and non-unicode string data types.
Error at SAP_WF [Excel Destination [150]]: Columns "com_group" and "PD" cannot convert between unicode and non-unicode string data types.
Error at SAP_WF [Excel Destination [150]]: Columns "kpi_value" and "Value" cannot convert between unicode and non-unicode string data types.
Error at SAP_WF [DTS.Pipeline]: "component "Excel Destination" (150)" failed validation and returned validation status "VS_ISBROKEN".
Error at SAP_WF [DTS.Pipeline]: One or more component failed validation.
Error at SAP_WF: There were errors during task validation.
 (Microsoft.DataTransformationServices.VsIntegration)
------------------------------BUTTONS:
OK------------------------------

View Replies !   View Related
Convert Data
Hello!
Please help me to convert datatype from one type to another.
Now I have date as yyyymmdd, I need convert it to yy/mm/dd.
Thank you.
Alona

View Replies !   View Related
Convert Data
Hello!
Can I convert character data (20000307070200)which is yyyymmddhhmmss to
smalldatetime and how?
Thank you very much.
Anny

View Replies !   View Related
Convert Some Data To XML
 

Hi all,
I have some data that I want to pass to a proc using an XML parameter.
 
Data looks like this:
 
ElementName |  ElementType
=================
Jim        |  Male
Henry    |  Male
Sarah    |  Female
 
I want the XML to look like this:
 



Code Block
<Elements>
  <Element>
    <ElementName>Jim</ElementName>
    <ElementType>Male</ElementType>
  </Element>
  <Element>
    <ElementName>Henry</ElementName>
    <ElementType>Male</ElementType>
  </Element>
  <Element>
    <ElementName>Sarah</ElementName>
    <ElementType>Female</ElementType>
  </Element>
</Elements>
 
 


 
 
Is that possible using T-SQL? Any help would be much apreciated.
 
Regards
Jamie
 
 

View Replies !   View Related
Convert Table In Stored Procedure
I have a flat table from 1 of the clients with a lot of fields (more then 100) like this

Item F1 F2 F3 .... F(N)
---------------------------------------------
100 X X
101 X

There are more 10000 records , X is the data inside the field.

I need to quickly convert it to this table

Item FieldNumber Value
----------------------------
100 1 X
100 2 X
101 1 X

Any ideas ?

Thanks

Mikhail

View Replies !   View Related
How To Convert From CHAR To Numeric In The Table
I have imported some data to sql2k from my old system. Somehow, it importedinvoice amount to char type.I just created another column called invamt2 type NUMERIC so I can copy orconvert content of invamt which is type CHAR. There are about 50,000records.How can I convert/cast from char type to numeric type ?Thanks

View Replies !   View Related
How To Convert Sp_who In A Table/query.
Hi

I would like to convert sp_who into a table/query. Please help

Thanks

View Replies !   View Related
How To Convert Sp_who In A Table/query.
Hi

How to convert a sp_who in into a table/query

Please help



Raj.

View Replies !   View Related
Convert Single Record To Table
Hi all!
 
I have imported a table into SQL Server from a legacy program.  Each record has a repeating sequence of similar fields. (Ex. Accnt1, Assesed1, Paid1, Accnt2, Assesed2, Paid2, etc.)  I would like to take a single record and put data from these fields into a table that has the columns Accnt, Assesed, and Paid.  I am doing this for easier use in a program I am developing in VB 2005.  Can this be done in SQL or do I need to have help from some VB code?  If it's possible, what might the SQL look like?
 
Thanks.

View Replies !   View Related
Easy Way To Convert SQL Data To XML?
Hi to all :

Does anyone know how convert easily the SQL Records into XML?

Ocinx

View Replies !   View Related
Convert Data To Currency
I have a column - datatype 'money' and my price variable is (for instance)
8450
how do I put this value into the money column without getting this error?

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC SQL Server Driver][SQL Server]Disallowed implicit conversion from data type varchar to data type money, table 'db196009544.dbo196009544.vehicles', column 'price'. Use the CONVERT function to run this query.

ASP VBScript
I am using this syntax:

price = Upload.Form("price") '---this gives 8450---

SQL="UPDATE vehicles SET price='" & price & "' WHERE id=" & request.queryString("linkID") & ""

Thanks
mark

View Replies !   View Related
Can't Convert Data Into Char
if i use the query

SELECT iditem, CONVERT(char(20), dt, 105) FROM planeamento

it works just fine.. but in this case the dt (date) field is not recognised..

SELECT planeamento.iditem, idmodelo, item_planeamento.idproduto, item_planeamento.idpele, cor, ordemfabrico, qtd, CONVERT(char(20), dt, 105) FROM produto INNER JOIN item_planeamento ON produto.idproduto = item_planeamento.idproduto INNER JOIN planeamento ON item_planeamento.iditem = planeamento.iditem WHERE planeamento.idfabrica = 51 AND alterado = 'FALSE' AND estado = NULL GROUP BY planeamento.iditem, produto.idModelo, item_planeamento.idProduto, item_planeamento.idPele, item_planeamento.cor, item_planeamento.ordemFabrico, item_planeamento.qtd, planeamento.dt

before, id just had "id" where "CONVERT(char(20), dt, 105)" is, but the date was printed in a unwanted format..

can you help me?

thanks a lot!

View Replies !   View Related
Convert Row Data Into Column
Hi members

I got the result set as shown below (By executing another query i got this).

Month   Status   Count
===== ======  =====
April   I   129
April   O   4689
April   S   6
July   I   131
July   O   4838
July   S   8
June   I   131
June   O   4837
June   S   8
May   I   131
May   O   4761
May   S    7

But, I need the same result set as below


Month   I        O       S
=====  =       =       =
April    129    4689    6
July     131    4838    8
June    131    4837    8
May     131    4761    7 
 

Can anyone provide me the tips/solution.

View Replies !   View Related
How To Convert SQL Server Table To CSV File Format?
 i have 12 different sql server tables. all are binded to one gridview. i have kept one admin user to view the details of the 12 tables in a gridview (pagesize=5). now the admin wants to generate 12 CSV files from the 12 tables (that is, he has to choose the table name from a dropdown and then has to click "Generate" button. CSV file name should be like this "<table_name>_<date>" ). also want to put links(dynamically [after generation of those csv files]) in a separate page to download those csv files. how to do this in asp.net (C#)? its urgent.

View Replies !   View Related
Convert Foxpro Memo Field To SQL Table
Hello All,

Does anyone know how to convert data in a Memo field from Foxpro into a Text field in SQL table? Straight import via DTS package seems to entirely ignore this memo field and result in blank.
Thanks in advance for your reply.

Koann

View Replies !   View Related
Does Cursor Convert Table To Read/write?
Hello,

Any help here much appreciated.

I am using sql server 2000 to perform address cleansing. there is a point in my scripting when a table i pass values to becomes read/write.

i suspect this is when i run a cursor through the table.

Is anyone able to confirm for me whether running a cursor changes a table's properties?

Many thanks.

Tim

Ps as the table seems to be read/write it is harder to tell if NULLs are in the table and this is messing with joins I have further down the track.

View Replies !   View Related
Wanna Convert Rows Of A Table As Columns
i want to convert the rows of one table to be the column of another table in run time......i have two tables one having student id and name and in another table there are student id, marks and subject as english. hindi and maths in rows...i want to make another a third table which contains student id , name , marks as english, hindi, maths as the column....tried a lot but didnt get the right way...do we have to do it through Join or is there some other technique by which we can solve the query........i dont know wheather i am really informative or not..but am sitting online if incase you wanna know something else even..........

View Replies !   View Related
SQL Server 2005 - How To Convert A Query Into A Table?
I'm going through and restructuring a database scheme and was wondering if, after I make a query (view), how can I convert that into a table?

Thanks

View Replies !   View Related
Convert Txt To Money Data Type
Hi,
I'm using the data type "money" in my SQL database and want to convert what's in txtPrice_textBox to the "money" format. I'm currently using the following code:
' objectCym.price = Convert.ToInt16(txtPrice_textBox.Text) '
Will this work?  Is there any reason I should stay away from the "Money" data type?
 
Thanks,
David
 
 

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved