Showing posts with label select. Show all posts
Showing posts with label select. Show all posts

Friday, March 23, 2012

Import from adaptive server anywhere 9

Hi,

I'm trying to import data into sql 2005 from sybase sql anywhere 9
(9.0.2.3320) using DTS (using the asademo db). I can select the tables I
want to import but during the actual import on Setting Source Connection I
always get an OLE DB Error :

Could not connect source component.

Error 0xc0202009: Source - contact[1]: An OLE DB error has occured. Error
code : 0x80040E21

Error 0xc020204a: Source - contact[1]: Unabtle to retrieve column
information from the data source.
Make sure your target table in the database is available.

Does anybody have an idea of what is going wrong here ?
Is there another way of accessing sybase that will work and where I can select all tables I need ?

thanx

Did you install the actual OLE DB Provider on your box and is it configured correctly?

Does your login has the appropriate permissions to access the database?

Do you have only asademo.db running? Did you specify the instance name (I think -n in the startup parameter is the right one for naming the instance. You can have several databases running under one instance name in ASA)

If this is not a regular job, you can quickly transport the data by defining a linked server for this database instance and doing a insert into ... select ... from linked.server.databaase.owner.table

Regards

Norbert

|||

Did you install the actual OLE DB Provider on your box and is it configured correctly?
I have a complete installation of Sybase ASA 9.02 and it is configured correctly.

Does your login has the appropriate permissions to access the database?
yep.

Do you have only asademo.db running? Did you specify the instance name (I think -n in the startup parameter is the right one for naming the instance. You can have several databases running under one instance name in ASA)
yep.

If this is not a regular job, you can quickly transport the data by defining a linked server for this database instance and doing a insert into ... select ... from linked.server.databaase.owner.table
What do you mean ? That I connect to sybase from SQL Server Management Studio ?

Regards

Norbert

|||You can define a linked server in Manangement Studio for the ASA database. Then you can start the query insert into ... select ... from the query window. This should create a table and should move the data via the OLE DB Providersql

Import export wizard

In sql2k i can select bunch of tables in EM and export to a different db also I can schedule this activity.

How to do the same in SQL2K5?

Right-click on the database

Point to Tasks-->Export Data

Go thru the wizard, selecting the tables that you need.

You will be prompted to save the resultant SSIS package somewhere. Once you have saved it you can schedule it thru SQL Server Agent.

-Jamie

Monday, March 12, 2012

Import data from excel into tables

hi
I want to import data from excel into table in sql server
while execution this statement
select *
into SQLServerTable FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\testing.xls;HDR=YES',
'SELECT * FROM [Sheet1$]')
i got this error
[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB provider
'Microsoft.Jet.OLEDB.4.0' reported an error. ERROR [01000]
[Microsoft][ODBC SQL Server Driver][SQL Server][OLE/DB provider returned
message:
Could not find installable ISAM.
Any one find me solution and reply where it went wrongHi
It is better practice to create the table and then using INSERT...SELECT
rather than SELECT.. INTO.
I think you should be using datasource and not database therefore (this is
untested!) try:
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'DataSource=D:\testing.xls;Extended Properties=Excel 8.0;HDR=YES', Sheet1$)
John
"Chinnappa" <Chinnappa@.discussions.microsoft.com> wrote in message
news:99E608C6-BBBF-43A4-B7AE-DF2D0318C79D@.microsoft.com...
> hi
>
> I want to import data from excel into table in sql server
> while execution this statement
> select *
> into SQLServerTable FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
> 'Excel 8.0;Database=D:\testing.xls;HDR=YES',
> 'SELECT * FROM [Sheet1$]')
> i got this error
>
> [Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB provider
> 'Microsoft.Jet.OLEDB.4.0' reported an error. ERROR [01000]
> [Microsoft][ODBC SQL Server Driver][SQL Server][OLE/DB provider returned
> message:
> Could not find installable ISAM.
> Any one find me solution and reply where it went wrong
>

Friday, March 9, 2012

Import data from about 50 different servers to a local database ta

Hello all,
First of all thank you very much for all your help.
Can you please tell me what is the best way to import data (select
@.@.version, exec xp_fixeddrives, sp_helpdb and other) from about 50 different
servers to a local database table. I would be great if job itself would enter
location name into
the table so it will look like data came from different location and not
from one.
I would think first I will need to create Remote servers under local SQL
server
database so my job will recognize different locations. And then ...
Thanks,
-DHi
If you have all the servers as linked servers you would need to use dynamic
SQL to change the name of the linked server in your code (without repeating
the code 50 times!). If your code inserted the output into a staging table,
then you could use the variable holding the server name whilst inserting the
data into the destination table.
e.g.
-- Destination table
CREATE TABLE ALLServerDrives ( servername sysname, drive char(1), size
bigint )
DECLARE @.linkedServer sysname
SET @.linkedServer = 'RemoteServer'
CREATE TABLE #drives ( drive char(1), size bigint )
EXEC ('INSERT INTO #drives ( drive, size )
EXEC ' + @.linkedServer + '.master.dbo.xp_fixeddrives' )
INSERT INTO ALLServerDrives ( servername, drive, size )
select @.linkedServer, Drive, size FROM #drives
drop table #drives
SELECT * FROM ALLServerDrives
John
"D''Animal" wrote:
> Hello all,
> First of all thank you very much for all your help.
> Can you please tell me what is the best way to import data (select
> @.@.version, exec xp_fixeddrives, sp_helpdb and other) from about 50 different
> servers to a local database table. I would be great if job itself would enter
> location name into
> the table so it will look like data came from different location and not
> from one.
> I would think first I will need to create Remote servers under local SQL
> server
> database so my job will recognize different locations. And then ...
> Thanks,
> -D|||John,
How do I generate unique value (such as date and/or automatically generated
numbers 1,2,3,4...) as new column so it will not overwrite old entries
when it executes?
Thanks
-D
"John Bell" wrote:
> Hi
> If you have all the servers as linked servers you would need to use dynamic
> SQL to change the name of the linked server in your code (without repeating
> the code 50 times!). If your code inserted the output into a staging table,
> then you could use the variable holding the server name whilst inserting the
> data into the destination table.
> e.g.
> -- Destination table
> CREATE TABLE ALLServerDrives ( servername sysname, drive char(1), size
> bigint )
> DECLARE @.linkedServer sysname
> SET @.linkedServer = 'RemoteServer'
> CREATE TABLE #drives ( drive char(1), size bigint )
> EXEC ('INSERT INTO #drives ( drive, size )
> EXEC ' + @.linkedServer + '.master.dbo.xp_fixeddrives' )
> INSERT INTO ALLServerDrives ( servername, drive, size )
> select @.linkedServer, Drive, size FROM #drives
> drop table #drives
> SELECT * FROM ALLServerDrives
>
> John
> "D''Animal" wrote:
> > Hello all,
> >
> > First of all thank you very much for all your help.
> > Can you please tell me what is the best way to import data (select
> > @.@.version, exec xp_fixeddrives, sp_helpdb and other) from about 50 different
> > servers to a local database table. I would be great if job itself would enter
> > location name into
> > the table so it will look like data came from different location and not
> > from one.
> > I would think first I will need to create Remote servers under local SQL
> > server
> > database so my job will recognize different locations. And then ...
> >
> > Thanks,
> >
> > -D|||Hi
As the example as an insert then it will only add to the table providing
there was no unique key violations. You may want to either add a column with
a rowversion data type, or a datetime column with a default of getdate() or
and identity column.
CREATE TABLE ALLServerDrives ( id int not null identity(1,1),
servername sysname, drive char(1), size bigint )
The identity column will increment for each row inserted and you do not need
to reference it in the insert statement. You may need to order the
information when you insert it into the desination table to make sure the
order is more meaningful! More information on all of these datatypes is in
books online.
John
"D''Animal" wrote:
> John,
> How do I generate unique value (such as date and/or automatically generated
> numbers 1,2,3,4...) as new column so it will not overwrite old entries
> when it executes?
> Thanks
> -D
> "John Bell" wrote:
> > Hi
> >
> > If you have all the servers as linked servers you would need to use dynamic
> > SQL to change the name of the linked server in your code (without repeating
> > the code 50 times!). If your code inserted the output into a staging table,
> > then you could use the variable holding the server name whilst inserting the
> > data into the destination table.
> >
> > e.g.
> >
> > -- Destination table
> > CREATE TABLE ALLServerDrives ( servername sysname, drive char(1), size
> > bigint )
> >
> > DECLARE @.linkedServer sysname
> >
> > SET @.linkedServer = 'RemoteServer'
> > CREATE TABLE #drives ( drive char(1), size bigint )
> >
> > EXEC ('INSERT INTO #drives ( drive, size )
> > EXEC ' + @.linkedServer + '.master.dbo.xp_fixeddrives' )
> >
> > INSERT INTO ALLServerDrives ( servername, drive, size )
> > select @.linkedServer, Drive, size FROM #drives
> >
> > drop table #drives
> >
> > SELECT * FROM ALLServerDrives
> >
> >
> > John
> >
> > "D''Animal" wrote:
> >
> > > Hello all,
> > >
> > > First of all thank you very much for all your help.
> > > Can you please tell me what is the best way to import data (select
> > > @.@.version, exec xp_fixeddrives, sp_helpdb and other) from about 50 different
> > > servers to a local database table. I would be great if job itself would enter
> > > location name into
> > > the table so it will look like data came from different location and not
> > > from one.
> > > I would think first I will need to create Remote servers under local SQL
> > > server
> > > database so my job will recognize different locations. And then ...
> > >
> > > Thanks,
> > >
> > > -D

Import Data and Identity fields

When i run the "Import Data" task from SQL 2005 Managment Studio and select the "Copy data from one or more tables or views" option, I notice the task does not re-create the "Identity" field definitions on the destination table. (SQL 2000 EM did this.) Is there a way to tell the import task to include the identity field definition when creating the destiination tables?

The only work around i've found in SQL Mgmt Studio takes multiple steps:

1) run Generate scripts on the source database, and select all tables to create the table scripts (this includes the identity field on each table)

2) run the script on the destination database to created the tables

3) run the import task, edit mappings and select "enable identity insert".

this is really a pain since i could accomplish this all in 1 step in SQL 2000 EM.

Any suggestions? Please help!

Microsoft? You there? Anybody?|||

You might get more traction on this in the SSIS forum, but I'll give it a try. By the way, this is an all-volunteer forum, so if you need immediate support, see http://microsoft.com/support. It's not only us Microsoft working folks in here, we just maintain the forum and try to help as much as we can.

This series of posts might help:

http://www.developerdotstar.com/community/node/727#comment-8456

Basically it involves the "FAST LOAD" option.

Buck Woody

SQL Server Team

Import Data and Identity fields

When i run the "Import Data" task from SQL 2005 Managment Studio and select the "Copy data from one or more tables or views" option, I notice the task does not re-create the "Identity" field definitions on the destination table. (SQL 2000 EM did this.) Is there a way to tell the import task to include the identity field definition when creating the destiination tables?

The only work around i've found in SQL Mgmt Studio takes multiple steps:

1) run Generate scripts on the source database, and select all tables to create the table scripts (this includes the identity field on each table)

2) run the script on the destination database to created the tables

3) run the import task, edit mappings and select "enable identity insert".

this is really a pain since i could accomplish this all in 1 step in SQL 2000 EM.

Any suggestions? Please help!

Microsoft? You there? Anybody?|||

You might get more traction on this in the SSIS forum, but I'll give it a try. By the way, this is an all-volunteer forum, so if you need immediate support, see http://microsoft.com/support. It's not only us Microsoft working folks in here, we just maintain the forum and try to help as much as we can.

This series of posts might help:

http://www.developerdotstar.com/community/node/727#comment-8456

Basically it involves the "FAST LOAD" option.

Buck Woody

SQL Server Team

Wednesday, March 7, 2012

Import and Export Wizard throws errors when theres alot of tables

I’m trying to copy data from production to my local machine using the SQL Server 2005 import and export wizard. It works fine if I select a small number of tables but throws errors

When there’s a lot of tables. Have you ever experienced problems using it? Is there a better way to transfer the data?

the data source is SQL Server 2000 and the target is 2005. I have the optimize for many tables and transaction options selected

Here’s the errors I get

Execute the transfer with the TransferProvider. (Error)

Messages

· ERROR : errorCode=-1073451000 description=The package contains two objects with the duplicate name of "output column "ErrorCode" (49)" and "output column "ErrorCode" (14)".
helpFile=dtsmsg.rll helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

· ERROR : errorCode=-1073451000 description=The package contains two objects with the duplicate name of "output column "ErrorCode" (31)" and "input column "ErrorCode" (52)".
helpFile=dtsmsg.rll helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

· ERROR : errorCode=-1073451000 description=The package contains two objects with the duplicate name of "output column "ErrorCode" (49)" and "output column "ErrorCode" (14)".
helpFile=dtsmsg.rll helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

· ERROR : errorCode=-1073451000 description=The package contains two objects with the duplicate name of "output column "ErrorCode" (31)" and "input column "ErrorCode" (52)".
helpFile=dtsmsg.rll helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

· ERROR : errorCode=-1073451000 description=The package contains two objects with the duplicate name of "output column "ErrorCode" (49)" and "output column "ErrorCode" (14)".
helpFile=dtsmsg.rll helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

· ERROR : errorCode=-1073451000 description=The package contains two objects with the duplicate name of "output column "ErrorCode" (31)" and "input column "ErrorCode" (52)".
helpFile=dtsmsg.rll helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

· ERROR : errorCode=-1073451000 description=The package contains two objects with the duplicate name of "output column "ErrorCode" (49)" and "output column "ErrorCode" (14)".
helpFile=dtsmsg.rll helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC} (Microsoft.SqlServer.DtsTransferProvider)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

Umm, do you have existing tables that have a column named, ErrorCode?|||very possible..if so what am i supposed to do to fix the problem ?|||Rename the columns in the tables... Really, not many options to do here.

I have created a Connect bug in relation to this:
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=252471

You should go there and vote, with comments, to help give more weight to the bug. Also "validate" it.

Thanks,
Phil|||

Thx, Didn;t see the siginficance of the fact that the column was called ErrorCode Right awy. I've been trying to use Import and Export to load data from production 2000 to local 2005 for several days now and I'm pretty burnt out. The vote does not seem enabled at the moment I'll look at it again tomorrow

|||

Mike C wrote:

Thx, Didn;t see the siginficance of the fact that the column was called ErrorCode Right awy. I've been trying to use Import and Export to load data from production 2000 to local 2005 for several days now and I'm pretty burnt out. The vote does not seem enabled at the moment I'll look at it again tomorrow

You have to sign into Connect before you can vote.

Friday, February 24, 2012

Import Access Reports

I had been successfully importing Access reports into SQL Reporting Services.
Now all of sudden when I go to the Project menu to select the Import option,
it's no longer there. I can't find it anywhere now. The only thing that I've
done since I was able to import is, load XPsp2. Am I missing something? Any
suggestions?Please see the following KB article:
Some programs seem to stop working after you install Windows XP Service Pack
2
http://support.microsoft.com/default.aspx?kbid=842242
You may have encountered this situation.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Huey" <Huey@.discussions.microsoft.com> wrote in message
news:A712782F-CC81-453C-92A3-E4FA99FEC197@.microsoft.com...
> I had been successfully importing Access reports into SQL Reporting
Services.
> Now all of sudden when I go to the Project menu to select the Import
option,
> it's no longer there. I can't find it anywhere now. The only thing that
I've
> done since I was able to import is, load XPsp2. Am I missing something?
Any
> suggestions?

Sunday, February 19, 2012

Import

Importing data using
Insert into...
Select from....
Problem is triggers fire only once. Cannot change triggers. Is there any
way to import data so triggers fire for each record?
The trigger has a bug. Triggers fire once for each modification *statement*, not once per row. Seems
like your trigger doesn't handle multi-row modifications (there's a chapter about this in Books
Online). One option is to write a cursor to loop the table and for each row do a single row insert.
It will perform horribly, btw...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"docsql" <docsql@.noemail.nospam> wrote in message news:OZMhCiAUFHA.2820@.tk2msftngp13.phx.gbl...
> Importing data using
> Insert into...
> Select from....
> Problem is triggers fire only once. Cannot change triggers. Is there any way to import data so
> triggers fire for each record?
>
>

Implimenting additional export types

Is it possible to add additional export types to the list, link to sample
code would be nice.
Select a format (Export)
XML file with report data
CSV (somma delimited)
TIFF file
Acrobat (PDF) file
Web archive
Excel
-- MY NEW TYPE --
Regards,
JohnGuess not :(
"John J. Hughes II" <no@.invalid.com> wrote in message
news:eOwBwc1pGHA.4760@.TK2MSFTNGP05.phx.gbl...
> Is it possible to add additional export types to the list, link to sample
> code would be nice.
> Select a format (Export)
> XML file with report data
> CSV (somma delimited)
> TIFF file
> Acrobat (PDF) file
> Web archive
> Excel
> -- MY NEW TYPE --
> Regards,
> John
>