How To Move From One Column To Another Using Sql Query With Asp Programming

Aug 29, 2006

I have a table A
 
I have Five columns and Each consist of Five rows of text
column 1
column 2
column 3
column 4
column 5
Thru Sql coding i want to move from one column to another column - When Date Changes
I need ASp and sql code for this Or ATleast i need sql query for how to move one column to another

View 1 Replies


ADVERTISEMENT

How To Retrieve The Char(1) Column From SQL Server With Dbbind() Function In Windows C Programming?

May 10, 2007

I have used the following Windows C codes to retrieve records from the bus_newjob table in SQL server:



==========================================================

// construct command buffer to be sent to the SQL server
dbcmd( dbproc, ( char * )"select job_number, job_type," );
dbcmd( dbproc, ( char * )" disp_type, disp_status," );
dbcmd( dbproc, ( char * )" start_time, end_time," );
dbcmd( dbproc, ( char * )" pickup_point, destination," );
dbcmd( dbproc, ( char * )" veh_plate, remark," );
dbcmd( dbproc, ( char * )" customer, cust_contact_person," );
dbcmd( dbproc, ( char * )" cust_contact_number, cust_details" );
dbcmd( dbproc, ( char * )" from bus_newjob" );
dbcmd( dbproc, ( char * )" where disp_status = 0" );
dbcmd( dbproc, ( char * )" order by job_number asc" );

result_code = dbsqlexec( dbproc ); // send command buffer to SQL server

// now check the results from the SQL server
while( ( result_code = dbresults( dbproc ) ) != NO_MORE_RESULTS )
{
if( result_code == SUCCEED )
{
memset( ( char * )&disp_job, 0, sizeof( DISPATCH_NEWJOB ) );
dbbind( dbproc, 1, INTBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.job_number );
dbbind( dbproc, 2, NTBSTRINGBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.job_type );
dbbind( dbproc, 3, INTBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.disp_type );
dbbind( dbproc, 4, INTBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.disp_status );
dbbind( dbproc, 5, NTBSTRINGBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.start_time );
dbbind( dbproc, 6, NTBSTRINGBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.end_time );
dbbind( dbproc, 7, NTBSTRINGBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.pickup_point );
dbbind( dbproc, 8, NTBSTRINGBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.destination );
dbbind( dbproc, 9, NTBSTRINGBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.veh_plate );
dbbind( dbproc, 10, NTBSTRINGBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.remark );
dbbind( dbproc, 11, NTBSTRINGBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.customer );
dbbind( dbproc, 12, NTBSTRINGBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.cust_contact_person );
dbbind( dbproc, 13, NTBSTRINGBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.cust_contact_number );
dbbind( dbproc, 14, NTBSTRINGBIND, ( DBINT )0, ( LPBYTE )&disp_job.new_job.cust_details );

// now process the rows
while( dbnextrow( dbproc ) != NO_MORE_ROWS )
{
new_job = malloc( sizeof( DISPATCH_NEWJOB ) );
if( !new_job )
return( 0 );
memcpy( ( char * )new_job, ( char * )&disp_job, sizeof( DISPATCH_NEWJOB ) );
append_to_list( &Read_Job_List, new_job );
}
}
else
{
sprintf( str, "Results Failed, result_code = %d", result_code );
log_str( str );
break;
}
==========================================================



where the job_type columIn is of the char(1) type, NTBSTRINGBIND is the vartype argument in the dbbind() function.



However, what I have gotten is nothing more than a null string from the job_type column. I have alternatively changed the vartype argument to STRINGBIND, CHARBIND and even INTBIND, but the results are the same.



Who can tell me the tricks to retrieve a char(1) column from SQL server?



View 1 Replies View Related

Move Data From One Column To Another Column And Row

Aug 7, 2006

need some help converting a table which has one row for each year. Displaying the data so the each row will contain all of the information for the title and all of the years displayed in separate columns.

I have a SQL Querry which returns the data looking like this (the querry is grouping by Title and by year, then adding up the quantity of rows):

Basic Information needed for Life Insurance 25 2005
Basic Information needed for Life Insurance 45 2006
Ea Chairmans Conference 10 2005
EA Chairmans Conference Press Release 33 2005
EA Chairmans Conference Press Release 21 2006
EA Chairmans Inner Circle Press Release 16 2005
EA Chairmans Inner Circle Press Release 46 2006
EA Honor Ring Press Release 13 2005
EA Honor Ring Press Release 35 2006
EA National Conference Press Release 6 2005
EA National Conference Press Release 9 2006

I need this data displayed like this:

Title 2005 2006
Basic Information needed for Life Insurance 25 45
Ea Chairmans Conference 10 10
EA Chairmans Conference Press Release 33 21
EA Chairmans Inner Circle Press Release 16 46
EA Honor Ring Press Release 13 35
EA National Conference Press Release 6 9


What I want to do is to basically say:

If Row 1 Title = Row 2 Title and Row 1 Year = Row 2 (Year + 1)) Then

add to grid Row 1 Title, Row 1 Qty, Row 2 Qty

Skip Row 2 and go to Row 3 (repeat this step until end of data)

End

Is there any way in the SQL querry to retrieve this data in this format so that I can display it in a datagrid?

Is there any way to display the data in this pattern.

Below is the code I am using now, but since the moving of the data is done in code it is very slow.
****************** Global Variables

Dim dbName As String = "Region_Web_Page_Hits"
Dim ColumnCount As Integer




Function ReturnColumnHeaderAndHitsDataSet() As System.Data.DataSet
'******** This will bring back the column Headers and Gross Hits per Column
Dim ColumnHeaderAndHitsQueryString As String = "SELECT DISTINCT TOP 100 PERCENT " & _
"YEAR(dat_Date) AS str_Year, COUNT(str_PageName) AS int_YearHits " & _
"FROM dbo.tbl_web_page_hits " & _
"WHERE (str_URL LIKE N'%press_Release%') " & _
"GROUP BY YEAR(dat_Date) " & _
"HAVING (Not (Year(dat_Date) Is NULL)) " & _
"ORDER BY YEAR(dat_Date)"

Dim ColumnHeaderAndHitsDataSet = LoadDataArray(ColumnHeaderAndHitsQueryString, dbName)
Return ColumnHeaderAndHitsDataSet
End Function


Function ReturnTableDataSet() As System.Data.DataSet
'This query string will return the data needed to display the report.
Dim TableQueryString As String = "SELECT TOP 100 PERCENT " & _
"str_PageName, COUNT (str_PageName) AS int_Hits, YEAR(dat_Date) AS str_Year " & _
"FROM dbo.tbl_web_page_hits WHERE str_URL LIKE '%Press_Release%' " & _
"GROUP BY str_PageName, YEAR(dat_Date) ORDER BY str_PageName"
Dim TableDataSet = LoadDataArray(TableQueryString, dbName)
ColumnCount = TableDataSet.Tables(0).Columns.Count
Return TableDataSet
End Function

'******* Function to Load the Data Array
Function LoadDataArray(ByVal queryString, ByVal dbName) As System.Data.DataSet
Dim ConnectionString As String = ConnectionStr(dbName)
Dim sqlConnection As SqlConnection = New SqlConnection(ConnectionString)
Dim sqlCommand As SqlCommand = New SqlCommand(queryString, sqlConnection)
Dim dataAdapter As SqlDataAdapter = New SqlDataAdapter(sqlCommand)
Dim dataSet As DataSet = New DataSet
dataAdapter.Fill(dataSet)
sqlConnection.Close()
Return dataSet
End Function



Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

If Not Page.IsPostBack Then
Dim Sort_Field As String = ""
dg_Data.DataSource = QueryMethod(Sort_Field)
dg_Data.DataBind()
End If
End Sub

Currently I have a bunch of Classic ASP code which puts the data in to an array and then into a table with a series of if statments, but it is really slow.

I want to bind it to a data grid and if possible let the SQL statement format the data for me.

View 1 Replies View Related

Can I Move Some Column Position By Using SQL Command ?

Jun 1, 2007

I created SQL table follow by XSD fileAnd when any users added new column to XSD in ordinal position = 3 But after my program successfully created new column, its position is the last position  What can I do ???? I suspect  why I can't set it (I've looked for solution on MSDN already)even though We can see ordinal position bythis query  SELECT *FROM INFORMATION_SCHEMA.Columns   What can I do for solving ???? Help me please 

View 1 Replies View Related

Move Data From One Column To Another In Same Table

Sep 12, 2004

Okay, after I got everything imported, I found that a few thousand columns had "Shifted" on me. So now I am trying to "Shift them over" to where they need to be.

I did this:
INSERT INTO dbo.TABLENAME (COLUMN_NAME_TO_BE POPULATED)
SELECT COLUM_NAME_OF_INFO_TO_BE_MOVED
FROM dbo.TABLENAME
WHERE MFG = 'MANUFACTURER_NAME' AND PN LIKE '8888888888'
GO

I populated the PN column with 8888888888 to use as a reference point, and the MFG column already was populated with the correct name, so I was using those as my unique reference points.

Other columns that have the same MFG name are correct, so I have to use two unique identifiers to specify the actual data that needs to be moved.

It inserted 'NULL' in the whole table after I ran it in the Query Analyzer. It appeared to disregard the WHERE statement all together
Any ideas on what I am doing wrong here?

Is there a way to move the data from one column to the next one over by specifying other WHERE criterias?

View 1 Replies View Related

Move Data Basedn On X Amt Of Digits In Column

Nov 8, 2005

I am looking for a solution to move all Part Numbers for a specific manufacturer that is 9 digits long to a new column.

Let me explain............

I have a product table that has three columns of product codes associated with that product (Part Number as PN, Series as Series, and Industry Code as ICDE). I now want to create a fourth column (Manufacturer Code as MCDE) as my database has grown for another product specific numerical designator that is specific for one manufacturer.

Currently I have the specific 9 digit codes in the same column as the Part Numbers, though they all have their specific rows (Part Numbers & Manufacturer Codes are not in the same cell).

Now the Part Numbers have various numbers, letters, and special characters, but the specific 9 digit manufacturer codes are pure numbers.

So my question is............

How does one go about moving these specific 9 digit codes to their new column and out of the Part Number column?

They will all be exactly 9 digits, no special characters, no letters, no spaces.

Is there a way to tell MS SQL to just move anything for that specific manufacturer that has the 9 digit manufacturer numbers to the new column, bypassing anything with letters, special characters or any part number that is not a pure 9 digit number?

View 2 Replies View Related

Move Column Of Data To Another Table With A Join

Oct 12, 2013

I have two tables. They both have an identity field to join them together. One of the tables has a column of data that I want to put in the other table. I need to make sure the data is brought over using the join so it updates that column for the right record.

I am struggling with this. Should I use a update or an insert? I'm leaning toward update but I can't figure out how with the join.

This is what I have tried so far:

Update grpcon.GroupID = groups.GroupID
from grpcon Inner Join groups
on grpcon.GroupNum=groups.GroupNum

View 1 Replies View Related

Delete/Move Certain Info From Column - Leave The Rest?

Nov 10, 2005

I have a column that contains extra info that needs to be moved to another column or deleted alltogether. is there a way to select these items and move them to another column, leaving the rest of the data in the original column?

EXAMPLE

MYTABLE >COLUMN1
May have Data Like: ABCDE123 SER1 or XYZ12DEFSer1:1

WHAT I NEED TO DO IS
Move anything after the SER1 to a new column and retain the rest of the data in the original column. making it look something like this:

COL1 COL2
ABCDE123 SER1
XYZ12DEF Ser1:1

Another question is if there is a way to delete extra spaces? Like make all data that has two or more extra spaces, just single spaces and any additional spacing after a row of data, delete all additional spaces after the last letter/character/number.

One more question - What would be a great resource to learn MS SQL in more depth?

I am trying to learn ASP/VBScript/JavaScript/ and now MS SQL all at once b/c this is what my business depends on. Trying to be 5,000 hats at once can get confusing and overwhelming, so I am looking for any "Crash course" I can to learn as much, as fast as possible. Any direction or ideas?

Thank you.

View 4 Replies View Related

Does SQL Server Move Records Between Partitions When Updating The Partition Key Column?

Apr 4, 2007

If I run an UPDATE query on a table which is partitioned by the column I am updating - will the records be moved to another partition?



ie. I have a table where Historical bit column marks whether a particular record should go to Partition1 (=0) or Partition2 (=1). Now, I update a record in that table and change the Historical column value from 0 to 1. What happens with that record?

View 3 Replies View Related

Needed Query To Move Data....

Feb 7, 2008

Hi Guys,
I am having a table in a database.....and i need to write a query to move tht table to microsoft access.......
so is tht possible with a query???

Thanks

View 6 Replies View Related

Sql Programming

Mar 29, 2005

What I want to do is remove part of a result from a query. I am selecting the srvname from sysservers as follows.

SELECT srvname from sysservers
Where srvid ='0'

When the name is returned some times it might be like servernameinstance. What I need to do is cut off the and everything after that so that my result is just servername. I am then using this result in a cursor to go after server shares. The length of the servername varies. Any suggestions.

View 1 Replies View Related

Help DTS Job Programming

Mar 3, 2004

Hello:
I'm scheduling DTS packages to run as a job but when I do that, the job siply does not works, someone tolds me that it's a problem with the SQL and Windows NT authentication and security and he gaves me this URL http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q269074.
but it not so clear to me, i'm working with SQL Server 200 and Windows Server 2000.

What can I do?

View 5 Replies View Related

SQL Programming

Apr 2, 2008

I dont know how to write a SQL Programming code from the table to the table (As the photo)


Would it be possable to help me?

Thanks so much!

View 10 Replies View Related

RMO Programming In VB.net

Aug 17, 2007

Hi,

Currently I am using the BCP functionality to import/export tables between different SQL Server 2005 databases. The process is working ok, but it creates alot of manual work, when 70 or more tables need to be transferred, every week. I am new to RMO development and am interested if the following may be possible.

- I would like to build an interface in VB.net allowing users to select a source database, and select the tables that need to be transferred from the Source DB, to the Destination DB.

-Put in place RMO funtionality to replicate the source database tables into flat files.

-Within the Vb.net app transfer the created flat files into the destination database.


I would greatly appreciate any advice on this, or if there may be a better approach at replacing the BCP functionality.

Thanks,



View 4 Replies View Related

Programming Help?

Jul 24, 2007

Hi,



Need help from experts on web service (ReportingService class).



I am trying to change a datasourcereference of a report from one location to another location. I am kind of stuck at this point where i am able to get the location but only dataSource.Item, dataSource.Name are not enough items for me to solve this problem.





any possible help or any threads already answered these type, greatly appreciated.



thanks

kodru.





View 1 Replies View Related

Programming Databaseconnections?

May 6, 2007

Hi!I want some tutorials on how to actually program database applications. Everything seems so bound with the data controls provided by Visual Studio and coming from PHP I don't like to not have full control over my applications. So where can I learn about creating my own database applications without using repeater, gridview or formview?Thank you in advance! 

View 1 Replies View Related

Programming Databases

Mar 30, 2004

I need to create a database with one table and its column names.
I got this script from the query analyzer templates as a database basic template:
IF EXISTS (SELECT *
FROM master..sysdatabases
WHERE name = N'<database_name, sysname, test_db>')
DROP DATABASE <database_name, sysname, test_db>
GO

CREATE DATABASE <database_name, sysname, test_db>
GO

I am not sure what it all means, what I need to do it name the database a certain name each time. and then create one table with 6 column names.

can someone give me guidance please...

View 7 Replies View Related

Transact-SQL Programming

Aug 3, 2000

I have a table containing almost 700000 records. The table contains the following fields:

table_id, member#, car_eff_dt, car_term_dt, mbr_occur.

A member can occur more than one time and his effective date/termination date are sorted sequentially.

An example would look like this:

table_id member# car_eff_dt car_term_dt mbr_occur
1 12345678901 01/01/1995 12/31/1995 null
2 12345678901 01/01/1996 12/31/1996 null
3 12345678901 01/01/1997 12/31/1997 null
4 10987654321 07/15/1998 02/16/1999 null
5 10987654321 04/01/2000 12/31/9999 null

Using Transact-SQL, is it possible to generate a unique number for each occurance of a particular member#?

table_id member# car_eff_dt car_term_dt mbr_occur
1 12345678901 01/01/1995 12/31/1995 1
2 12345678901 01/01/1996 12/31/1996 2
3 12345678901 01/01/1997 12/31/1997 3
4 10987654321 07/15/1998 02/16/1999 1
5 10987654321 04/01/2000 12/31/9999 2

Currently, I am running the code in an Access/VBA module through an ODBC connection, but I would like to be able to run all my code directly on the server.

Thanks in advance for any help you might be able to provide.

View 1 Replies View Related

Programming Editor

Dec 16, 1999

Just curious,

What do all of you use to create and edit stored procedures? I am looking for a better way to code than to use the default window supplied with Enterprise Manager.

Do most of you use the Query Analyzer? Are there third party products you like using better?

Thanks for the info..

Eugene

View 2 Replies View Related

What Programming Language Is Behind SQL?

Dec 9, 2004

I am looking into a production geared software called MassGroup. (www.massgroup.com) It says that its FactoryServer builds are on a standardized SQL framework and web architecture for data collection, work order requests, reporting and asset management. My questions are:

1. Is SQL its own programming language? If not what is it?
Answer: After going thru several pages and reading the fine print I discovered they use VB, ASP, COM technology, and Crystal Reports.

2. How powerful do you think this would be at gathering data and does it have the capability of creating a number sequence automatically? (example: 0001; 0002; 0003...)

Any help would be appreciated.
Thank you in advance!!!!!

View 1 Replies View Related

Web Database Programming

Nov 22, 2004

hi to all,

What is the best language or compiler used in web database programming. Any have an idea pls help me.


Thankss.

View 2 Replies View Related

Help!! Hate Programming Sql

Mar 3, 2008

I have just started in Sql 6 months ago. I was an IT major in graduate school and am now in my late 30's (career change). It took me 4 years to finally get what I thought was my dream job. Well, I was promised training which I have yet to receive and bascially went from doing basic queries that I did in class in college to doing advance Sql - stored procs, etc. I completely hate it. I do not know if it is from the lack of training or if it just not for me. I am completely bored out of mind. I am also tired of struggling everyday to complete assignments. The first 2 assignments I received were way out of my league. I was told this by a project mgr who did a similiar assignment and they have years of sql experience and it took her 3 months with assistance to complete it. I have been with the company for almost 6 years. I am not sure if I should just complete my current assignments and ask if they can reassign me to a different IT department, look for a new job or just continue to struggle and pull my hair out. Please give me some feedback as to how you would handle this situation.

View 8 Replies View Related

Other Programming Skills- CLR

Mar 25, 2008

Guys ..Im a very very confused Jr DBA/Dev here !

I need to know what exactly other languages [C#/VB.net/ADO/XML/ASP.net..etc] that I should learn in order for me to be able to excel in SQL Development.

I started getting my hands dirty with some SSIS / SSRS & SSAS, but inorder for me to handle situations such as [Find if file exist in ftp before loading, Checking a certain row of a data file before processing/ Zipping and Unzipping data files and etc...] What should I need to know well in order for me to add more value to my skills?
I would like to learn 1 language and master it pretty well.What are your suggestions?

And what is this CLR that is being talked about ?Does it use other language besides SQL?

Do guide this lost JR .......

View 10 Replies View Related

C++ And SQL Server Programming

Dec 25, 2005

Are there any good resources (books, websites, etc) for programming SQLServer using Visual C++? I am currently using C# but I really want to learnhow to do it using C++, but it appears to be much more difficult using C++.Thanks

View 2 Replies View Related

.sdf Databasse And Programming

May 15, 2007

i need to access an .sdf database using microsfot visual forpro

what drivers/connection strings do i need?

View 1 Replies View Related

VB And SQL Programming Question

Apr 21, 2006

I currently have a table with the fields:

- StudentID as an Identity and is the Primary Key field (PK)

- FName as varchar(15)

- LName as varchar(20)

When I use a combo box, I place the information in it as follows:

- LName, FName/StudentID Ex: Rogers, James/4

In order to find our the student I want, I parse the above field for the StudentID.

Question:

How can I display the student's name only and still get to their StudentID?

Would I have to use an array holding/pointing to the StudentID? Or What?



Thanks In Advance.





View 3 Replies View Related

Programming With C#.NET And Variables

Jun 6, 2007

Hi all,

I know how to basically change SSIS variables from within a C#. NET winform application. But can anyone point me on how to change the contents of a connection manager SSIS connection from withing C#.net please. That is..how do i parameterize a connection manager connection to basically accept the connection information from within the winform app.

Thanks

View 9 Replies View Related

Programming SQL Express

Nov 15, 2006

Hey, i have an installer that places ms sql express onto a machine. thats is fine. i want to create a post setup application that runs after ms sql server is installed. what for example i want to do is be able to create a user and have the DB allow remote connections. i can provide instructions for a 'peon' to make the required post setup changes but i want to see if i can cover that with an application. thanks

Charles Rezsonya

View 10 Replies View Related

Programming In Ssis

Dec 5, 2006

Hi..

I am working on sql server integration services..New to this topic...I want to transfer data from flat file to sql database by doing it programatically.Creating source,destination and transform adapters

my basic question is should the source,transform and destination adapter be bulid for each file i am trying to transfer.

What is the advantage of this doing it this way.

Would anyone let me know about this..

Thanks

View 1 Replies View Related

SQL Programming Question

Jun 21, 2007

Not sure if this is right place to ask this. I have a table where I want a single field to show up in separate columns. (wow its hard to describe what I want. Here is an example

Store_Group_Product_Tbl
store, group id, product

Let's say we have these records:
Store 1 - group 1 - hats
Store 1 - group 1 - clothes
Store 1 - group 1 - shoes
Store 1 - group 2 - drink
Store 1 - group 2 - food

I want my select statement to return:

Store 1 - group 1 - hats - clothes - shoes
Store 1 - group 2 - drink - food - NULL

(and in this case I will be selecting on where store = a selected store)

Is there a way to join it back to itself to get the data I want? Or will I have to select everything into an array and then manipulate that array to get everything columned up correctly?

View 4 Replies View Related

OLE DB COMMAND Programming Help

Jan 18, 2006



Could some one please help in coding a OLE DB Command, to fire a stored procedure which takes 2 parameter's

Help me in the coding, by which I should be able to fire a SP that takes 2 parameters, by mapping 2 feilds from the source table to the SP parameter's

The Below sample fires a SP without any parameter's

ConnectionManager cm = package.Connections.Add("OLEDB"); cm.Name = "OLEDBConnection"; cm.ConnectionString = "Data Source=.;Initial Catalog=AdventureWorks;Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Auto Translate=False;"; // Create the source component.

IDTSComponentMetaData90 component = dataFlow.ComponentMetaDataCollection.New(); component.Name = "OLEDBSource";

component.ComponentClassID = "DTSAdapter.OleDbSource"; // Get the design time instance of the component.

CManagedComponentWrapper instance = component.Instantiate(); // Initialize the component

instance.ProvideComponentProperties(); // Specify the connection manager for Source.

if (component.RuntimeConnectionCollection.Count > 0) {

component.RuntimeConnectionCollection[0].ConnectionManagerID= package.Connections["OLEDBConnection"].ID;

component.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(package.Connections["OLEDBConnection"]); } // Set the custom properties. instance.SetComponentProperty("AccessMode", 2); instance.SetComponentProperty("SqlCommand", "Select * from HumanResources.Employee");

// Reinitialize the metadata. instance.AcquireConnections(null); instance.ReinitializeMetaData(); instance.ReleaseConnections();

IDTSComponentMetaData90 m_SQLCommand = null;

m_SQLCommand = dataFlow.ComponentMetaDataCollection.New(); m_SQLCommand.ComponentClassID = "DTSTransform.OLEDBCommand.1"; IDTSDesigntimeComponent90 oledbDesignTime = m_SQLCommand.Instantiate(); oledbDesignTime.ProvideComponentProperties();

if (m_SQLCommand.RuntimeConnectionCollection.Count > 0){m_SQLCommand.RuntimeConnectionCollection[0].ConnectionManagerID = package.Connections["OLEDBConnection"].ID; m_SQLCommand.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(package.Connections["OLEDBConnection"]);} oledbDesignTime.SetComponentProperty("SqlCommand", "Exec Test");

View 1 Replies View Related

SSIS Programming

Jun 15, 2007

Hello,



I am trying to bring the data from Oracle to SQL Server. And, I need to write this in C#. All that I have is a source table in Oracle and a source table in SQL Server. I need to have some samples.



Can you please guide in the right direction?



Your response will be helpful.



thx,

amrith

View 3 Replies View Related

Error In Programming DTS Using VB.net

Apr 10, 2007

Hi ,

i am using VS.NET 2003 for programming and SQL sever 2005 is my database.

while creating DTS packages,

i am using code as follows



Public Sub Task_Sub4(ByVal goPackage As Object)

Dim oTask As DTS.Task

Dim oLookup As DTS.Lookup

Dim oCustomTask4 As DTS.DataPumpTask2

oTask = CType(goPackage, DTS.Package).Tasks.New("DTSExecuteSQLTask")

oCustomTask4 = CType(oTask.CustomTask, DTS.DataPumpTask2)

oCustomTask4.Name = "Copy Data from contact_info to [content_shriya].[dbo].contact_info] Task"

oCustomTask4.Description = "Copy Data from contact_info to [content_shriya].[dbo].[contact_info] Task"

oCustomTask4.SourceConnectionID = 3

oCustomTask4.SourceSQLStatement = "select * from [Content_management].[dbo].[contact_info]"

oCustomTask4.DestinationConnectionID = 4

oCustomTask4.DestinationObjectName = "[content_shriya].[dbo].[contact_info]"

oCustomTask4.ProgressRowCount = 1000

oCustomTask4.MaximumErrorCount = 0

oCustomTask4.FetchBufferSize = 1

oCustomTask4.UseFastLoad = True

oCustomTask4.InsertCommitSize = 0

oCustomTask4.ExceptionFileColumnDelimiter = "|"

oCustomTask4.ExceptionFileRowDelimiter = vbCrLf

oCustomTask4.AllowIdentityInserts = False

oCustomTask4.FirstRow = 0

oCustomTask4.LastRow = 0

oCustomTask4.FastLoadOptions = 2

oCustomTask4.ExceptionFileOptions = 1

oCustomTask4.DataPumpOptions = 0

'Call oCustomTask4_Trans_Sub1(oCustomTask4)



goPackage.Tasks.Add(oTask)

oCustomTask4 = Nothing

oTask = Nothing

End Sub





But i am geeting error in line

oCustomTask4 = CType(oTask.CustomTask, DTS.DataPumpTask2)

giving error 'System.InvalidCastException'

Additional information: Specified cast is not valid.



i changed it with oCustomTask4 = oTask.CustomTask ,

then also similar error appear.



Please solve my problem, i need to create DTS Packages by using VS.NET 2003 and Database is SQL server 2005.



Thank you

View 3 Replies View Related







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