Showing posts with label transfer. Show all posts
Showing posts with label transfer. Show all posts

Thursday, March 29, 2012

datatype problem

how can i transfer incoming data from flat file which would be a string to my sql table of column int...

i have a problem with datatype can i conver string to int how should i do it...new to it

please help!!

This is what the Data Conversion Task is for. U could also use the Derived Column Task. Place it between source and destination, convert your column there.

What more can I say?

Pipo1

|||Use a derived column transformation.

This is one example of an expression you could use: (DT_I4)[Your_Column]sql

Thursday, March 22, 2012

dataset to sql server

How to transfer data in a table in dataset to a table in sql server ?

i.e. I want to transfer the table values in excel to a table in sql server. I have populated the excel table in a dataset. I just want to know how to transfer from dataset to sql server.

Thanks

You can use the INTO clause to move the data into SQL Server because it creates a new table on destination or use the code below to load the data into SQL Server then load that table into a dataset. The reason is Excel since XP/2003 can use sql statements. Hope this helps.

/* Excel as a linked server */
/* Assuming we have an Excel file 'D:\testi\Myexcel.xls'
with following data in the first sheet:
id name
1 a
2 b
3 c
*/

EXEC sp_addlinkedserver 'ExcelSource',
'Jet 4.0',
'Microsoft.Jet.OLEDB.4.0',
'D:\testi\Myexcel.xls',
NULL,
'Excel 5.0'

EXEC sp_addlinkedsrvlogin 'ExcelSource', 'false'

EXEC sp_tables_ex ExcelSource
EXEC sp_columns_ex ExcelSource

SELECT *
FROM ExcelSource...Sheet1$

CREATE TABLE test_excel
(id int,
name varchar(255))
GO

INSERT INTO test_excel
SELECT *
FROM ExcelSource...Sheet1$

SELECT *
FROM test_excel

/* Now define two ranges in Excel on the 2nd sheet as tables */
/* Select the range, Insert->Name->Define */
/* Note: sp_tables_ex does not recognize the defined tables */
/* We can still refer to the tables explicitly */

EXEC sp_tables_ex ExcelSource
EXEC sp_columns_ex ExcelSource

SELECT *
FROM ExcelSource...Table1

SELECT *
FROM ExcelSource...Table2

http://msdn2.microsoft.com/en-us/library/ms188029.aspx

|||

I cant understand ur code. Kindly explain it.

I want to export the data in excel to sql server table. I have fetched the data from excel and stored in dataset. Then i want to export it to sql server. How to do that?

|||That code is to insert Excel into SQL Server table before you put the table into a dataset, if you don't want that then use the link and create a SELECT INTO statement it create a table for you and now that I think about it you can create a SQL Server Table with ExecuteNonQuery in ADO.NET run a search in the forums you should find some links with code. Hope this helps.

Monday, March 19, 2012

DataPump performance problem

I'm using an SSIS under SQL 2005; i transfer data with a DataFlow Component:

DataSource = OLEDB Source;

Destination = OLEDB Destination

The source is a View returning about 100000 records; if i execute it in query analyser it takes few seconds. But if i use it as DataPump Source it takes HOURS to execute it...

I've noticed that If i modify the SELECT query inserting a "TOP 10000000000", it takes few seconds..

Why? Am i missing something?

Could I ask what would be wrong with just always using Select TOP 100% in your query? If adding the TOP 100% explicitly speeds things up that much, then that is what I would do.|||

Netoblivion wrote:

I'm using an SSIS under SQL 2005; i transfer data with a DataFlow Component:

DataSource = OLEDB Source;

Destination = OLEDB Destination

The source is a View returning about 100000 records; if i execute it in query analyser it takes few seconds. But if i use it as DataPump Source it takes HOURS to execute it...

I've noticed that If i modify the SELECT query inserting a "TOP 10000000000", it takes few seconds..

Why? Am i missing something?

Read this article:

SELECT *... or select from a dropdown in an OLE DB Source component?
(http://blogs.conchango.com/jamiethomson/archive/2006/02/21/2930.aspx)

as this could well be the problem.

Let us know!!

Thanks

-Jamie

|||Thanks Jamie that really helped me to solve this problem!!!

Tuesday, February 14, 2012

Database Transfermation from SQL 2000 to SQL 2005

Hello
We have two SQL server installation. SQL server 2000 with sp4 and SQL server
2005 sp2. We want tp transfer 2 data bases from SQL 2000 to SQL 2005. how can
we update or transfer Databse from one old version to new version?
best regards,
Thor
Thor
I'd go with BACKUP/RESTORE , however you are able to detach/attach those
databases as well. See the explanation in the BOL
"Thor" <Thor@.discussions.microsoft.com> wrote in message
news:DEE2E28A-2EA8-4532-A2B2-E8F31CB85B3B@.microsoft.com...
> Hello
> We have two SQL server installation. SQL server 2000 with sp4 and SQL
> server
> 2005 sp2. We want tp transfer 2 data bases from SQL 2000 to SQL 2005. how
> can
> we update or transfer Databse from one old version to new version?
> best regards,
> Thor

Database Transfermation from SQL 2000 to SQL 2005

Hello
We have two SQL server installation. SQL server 2000 with sp4 and SQL server
2005 sp2. We want tp transfer 2 data bases from SQL 2000 to SQL 2005. how can
we update or transfer Databse from one old version to new version?
best regards,
ThorThor
I'd go with BACKUP/RESTORE , however you are able to detach/attach those
databases as well. See the explanation in the BOL
"Thor" <Thor@.discussions.microsoft.com> wrote in message
news:DEE2E28A-2EA8-4532-A2B2-E8F31CB85B3B@.microsoft.com...
> Hello
> We have two SQL server installation. SQL server 2000 with sp4 and SQL
> server
> 2005 sp2. We want tp transfer 2 data bases from SQL 2000 to SQL 2005. how
> can
> we update or transfer Databse from one old version to new version?
> best regards,
> Thor|||"Thor" <Thor@.discussions.microsoft.com> wrote in message
news:DEE2E28A-2EA8-4532-A2B2-E8F31CB85B3B@.microsoft.com...
> Hello
> We have two SQL server installation. SQL server 2000 with sp4 and SQL
> server
> 2005 sp2. We want tp transfer 2 data bases from SQL 2000 to SQL 2005. how
> can
> we update or transfer Databse from one old version to new version?
> best regards,
> Thor
Hi Thor
If you are wanting to upgrade check out other posts regarding this such as
http://tinyurl.com/4uzmyl, running the upgrade advisor will show up most of
the potential problems, rebuilding indexes, stats and usage will reduce the
risk of poorly performing queries. If you do have performance issues check
the query plan.
John

Database Transfer Services

Does SQL Express support Database Transfer services? If not does it have something like that. I am trying to transfer data from my database to a web server but cannot seem to find the 2005 equivalent to SQL 2000 Database Transfer Services

Express does byde fault support Data Transformation Services or its replacement Integration Services. Some people ahve been able to get it to work by downloading the Advanced Express pack. However thats not really going to help you with the webs erver problem as much.

You can just detach the database and copy it, you could also search for the database publishing wizard on the Microsoft site and also on http://www.codeplex.com

|||

I just got some more information. apparently a database dump gets done at night on to an SQL 2000 server. What sort of conversion needs to be done to make the database compatible with 2000?

So SQL Express is dumping a database on to a 2000SQL server.

|||There is not an easy way of taking a SQL2005 database and loading it onto a SQL2000 Server with express. SSIS is your best shot, there are some threads from a while back on import/export with express.