Showing posts with label temp. Show all posts
Showing posts with label temp. Show all posts

Monday, March 26, 2012

Import from sql 2000 to sql 2005

We keep running out of space due to the temp file getting so large on the
source server. Is there any way to prevent this ?
ThanksWhat exactly are you doing?
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
"Ray Brown" <RayBrown@.discussions.microsoft.com> wrote in message
news:A52B9428-5F2C-4DC9-8447-F6B6B440D5F1@.microsoft.com...
We keep running out of space due to the temp file getting so large on the
source server. Is there any way to prevent this ?
Thankssql

Import from sql 2000 to sql 2005

We keep running out of space due to the temp file getting so large on the
source server. Is there any way to prevent this ?
ThanksWhat exactly are you doing?
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
"Ray Brown" <RayBrown@.discussions.microsoft.com> wrote in message
news:A52B9428-5F2C-4DC9-8447-F6B6B440D5F1@.microsoft.com...
We keep running out of space due to the temp file getting so large on the
source server. Is there any way to prevent this ?
Thanks

Monday, March 12, 2012

Import Data from Excel problem

I got a table which got over 50 fields from an excel files.
Now I can import them into a temp.dbf file . I found that the field type
defined as nvarchar 255.
I use SP to write a insert these data to another real table. (some field is
char20, . 50. 20...etc)
The problem is As I run the insert statment .I will got [String or binary
data would be truncated] <-- error
I don't want to modify the structure of temp.dbf.
Any method that I can ignore That error and import the data ?
Thanks
you can put 'trims' around the fields in your select
look up ltrim and rtrim in BOL
"Agnes" <agnes@.dynamictech.com.hk> wrote in message
news:u43g$QvLFHA.732@.TK2MSFTNGP12.phx.gbl...
>I got a table which got over 50 fields from an excel files.
> Now I can import them into a temp.dbf file . I found that the field type
> defined as nvarchar 255.
> I use SP to write a insert these data to another real table. (some field
> is char20, . 50. 20...etc)
> The problem is As I run the insert statment .I will got [String or binary
> data would be truncated] <-- error
> I don't want to modify the structure of temp.dbf.
> Any method that I can ignore That error and import the data ?
> Thanks
>

Friday, February 24, 2012

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.

I'm guessing the "for some reason" is something like... While your little import routine is busy farting around trying to import some data, that may or may not actually load into the original table, some other processes may actually want to use the original table without it being locked for long periods of time. Some people get a wee bit upset when the company websites go down because some newbie decided it'd be a good idea to try and do bulk imports from external sources because it's easy.

And sounds like you are looking for a DTS package to import from a CSV file into a temp table, then launching a stored procedure to merge changes in after it's complete.

import accessfiles with stored procedures

Hi,
Could somebody tell me how to import access-files to a sql server database?
I would like to import all tables from access to the temp, do some
data-manipulation and then insert into a database. I know that dts can
import, but i want to address the tempdb so i don't have to create
temptables in my databases.
I hope someone can help me.Jason
One option is
INSERT INTO .....
SELECT *
FROM OPENDATASOURCE(
'Microsoft.Jet.OLEDB.4.0',
'Data Source="d:\northwind.mdb";
User ID=Admin;Password='
)...Customers
"Jason" <jasonlewis@.hotrmail.com> wrote in message
news:esocaw2EFHA.3416@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Could somebody tell me how to import access-files to a sql server
database?
> I would like to import all tables from access to the temp, do some
> data-manipulation and then insert into a database. I know that dts can
> import, but i want to address the tempdb so i don't have to create
> temptables in my databases.
> I hope someone can help me.
>|||Hi Uri,
I've tried to use your example, but i'm getting errors which says that it
cannot find the path, but i'm sure the file is there?
Here's the statement:
SELECT *
FROM OPENDATASOURCE( 'Microsoft.Jet.OLEDB.4.0','Data
Source="D:\klient.mdb";User ID=Admin;Password=')...sysdata
And here's the error:
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
[OLE/DB provider returned message: Could not find file 'D:\klient.mdb'.]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
IDBInitialize::Initialize returned 0x80004005: ].
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:etAE$62EFHA.2568@.TK2MSFTNGP10.phx.gbl...
> Jason
> One option is
> INSERT INTO .....
> SELECT *
> FROM OPENDATASOURCE(
> 'Microsoft.Jet.OLEDB.4.0',
> 'Data Source="d:\northwind.mdb";
> User ID=Admin;Password='
> )...Customers
>
> "Jason" <jasonlewis@.hotrmail.com> wrote in message
> news:esocaw2EFHA.3416@.TK2MSFTNGP09.phx.gbl...
> database?
>|||Jason
Have you ran on the server or client machine?
Where is the file's location on the server?
"Jason" <jasonlewis@.hotrmail.com> wrote in message
news:OY5T7zAFFHA.1564@.TK2MSFTNGP09.phx.gbl...
> Hi Uri,
> I've tried to use your example, but i'm getting errors which says that it
> cannot find the path, but i'm sure the file is there?
> Here's the statement:
> SELECT *
> FROM OPENDATASOURCE( 'Microsoft.Jet.OLEDB.4.0','Data
> Source="D:\klient.mdb";User ID=Admin;Password=')...sysdata
> And here's the error:
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
> [OLE/DB provider returned message: Could not find file 'D:\klient.mdb'.]
> OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
> IDBInitialize::Initialize returned 0x80004005: ].
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:etAE$62EFHA.2568@.TK2MSFTNGP10.phx.gbl...
>|||Hi Uri,
The files resides on a client pc.
Greetings,
J
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eU3lf$AFFHA.2156@.TK2MSFTNGP10.phx.gbl...
> Jason
> Have you ran on the server or client machine?
> Where is the file's location on the server?
>
> "Jason" <jasonlewis@.hotrmail.com> wrote in message
> news:OY5T7zAFFHA.1564@.TK2MSFTNGP09.phx.gbl...
it
can
>|||Then you need to specify an UNC path for the file, and the share need to acc
essible to SQL Server
and the account that SQL Server is using need to have permissions on the sha
re.
SQL Server is a *server* product, the queries are executed on the server, no
t the client. :-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jason" <jasonlewis@.hotrmail.com> wrote in message news:Oub81JCFFHA.3940@.tk2msftngp13.phx.g
bl...
> Hi Uri,
> The files resides on a client pc.
> Greetings,
> J
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:eU3lf$AFFHA.2156@.TK2MSFTNGP10.phx.gbl...
> it
> can
>