Showing posts with label via. Show all posts
Showing posts with label via. Show all posts

Tuesday, March 27, 2012

Copy Excel sheet to SQL 2005(Dev Edit X64) via SSIS

Ok...

This worked on the laptop I had last week. That laptop has ceased to be. I have a new one, which may be my problem.

I have a package that takes an Excel Sheet, makes a couple of conversions via the Data Conversion object, and places the rows into my SQL 2005 X64 database.

Here are the major exceptions:

1. [Excel Source [2479]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed. (THERE WERE NOT)

2. [Connection manager "Excel Connection Manager"] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040154. An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered".

Here is the rub... I am running Vista(Weeeee), and Office 2007(Double Weeeeee). Last week I was running XP, and Office 2003.

Is this a wierd Vista permission problem? The "Class not Registered" message is worrying me. Does SSIS work with Excel 2007 installed?

Xig

Xig,

Here is a link to considerations for SSIS on 64-bit computers: http://msdn2.microsoft.com/en-us/library/ms141766.aspx.

One of the things to note is that there is no 64-bit Jet driver, so connections to Access and Excel don't work in 64-bit mode. You can however run your packages in 32-bit mode. The link provided above has additional details.

Thanks,
Patrik

Tuesday, March 20, 2012

copy database via tapefile no SQL 2005

Hello,

if you got a tape file how can you restore the contained database onto a
newly installed server? I choose Restore Database From Device then I choose
DB and select same DB in combobox "To Database" but error occured:

TITLE: Microsoft SQL Server Management Studio
Restore failed for Server '...'. (Microsoft.SqlServer.Smo)
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: Directory lookup for the file "C:\Program
Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\KidDatabase.mdf" failed with
the operating system error 3(error not found). (Microsoft.SqlServer.Smo)

what can I do to handle this problem?

regards
MarkMark (Scollop027@.gmx.net) writes:

Quote:

Originally Posted by

if you got a tape file how can you restore the contained database onto a
newly installed server? I choose Restore Database From Device then I
choose DB and select same DB in combobox "To Database" but error
occured:
>
TITLE: Microsoft SQL Server Management Studio
Restore failed for Server '...'. (Microsoft.SqlServer.Smo)
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: Directory lookup for the file "C:\Program
Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\KidDatabase.mdf" failed with
the operating system error 3(error not found). (Microsoft.SqlServer.Smo)
>
what can I do to handle this problem?


First do

RESTORE FILELISTONLY FROM TAPE = 'tapedevice'

this will give you the logical names of the files of the database. Then
do:

RESTORE DATABASE db FROM TAPE = 'tapedevice' WITH
MOVE 'datafile' TO
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\KidDatabase.mdf',
MOVE 'logfile' TO
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\KidDatabase.ldf',
REPLACE

Here I've used the path from your error message. Howver, the error message
indicates that this is a non-existing path, so you may have to examine
where there is place on the server to put the databases.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hello Erland,
good tip, thank you very much !
I havent seen it :-/
regards Mark

"Erland Sommarskog" <esquel@.sommarskog.seschrieb im Newsbeitrag
news:Xns98203142E059Yazorman@.127.0.0.1...

Quote:

Originally Posted by

Mark (Scollop027@.gmx.net) writes:

Quote:

Originally Posted by

if you got a tape file how can you restore the contained database onto a
newly installed server? I choose Restore Database From Device then I
choose DB and select same DB in combobox "To Database" but error
occured:

TITLE: Microsoft SQL Server Management Studio
Restore failed for Server '...'. (Microsoft.SqlServer.Smo)
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: Directory lookup for the file


"C:\Program

Quote:

Originally Posted by

Quote:

Originally Posted by

Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\KidDatabase.mdf" failed


with

Quote:

Originally Posted by

Quote:

Originally Posted by

the operating system error 3(error not found). (Microsoft.SqlServer.Smo)

what can I do to handle this problem?


>
First do
>
RESTORE FILELISTONLY FROM TAPE = 'tapedevice'
>
this will give you the logical names of the files of the database. Then
do:
>
RESTORE DATABASE db FROM TAPE = 'tapedevice' WITH
MOVE 'datafile' TO
C:\Program Files\Microsoft SQL


Server\MSSQL.1\MSSQL\DATA\KidDatabase.mdf',

Quote:

Originally Posted by

MOVE 'logfile' TO
C:\Program Files\Microsoft SQL


Server\MSSQL.1\MSSQL\DATA\KidDatabase.ldf',

Quote:

Originally Posted by

REPLACE
>
Here I've used the path from your error message. Howver, the error message
indicates that this is a non-existing path, so you may have to examine
where there is place on the server to put the databases.
>
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
>
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Monday, March 19, 2012

Copy database from an Sql server to another

How to copy a database from one server to another?
Regards
Pedestrian
Message posted via http://www.webservertalk.comThe easiest way is just to do a backup of the database, copy the file
created by the backup to the other server, and restore the database in the
second server.
Ben Nevarez, MCDBA, OCP
Database Administrator
"pedestrian via webservertalk.com" wrote:

> How to copy a database from one server to another?
> Regards
> Pedestrian
> --
> Message posted via http://www.webservertalk.com
>|||How to move databases between computers that are running SQL Server
http://support.microsoft.com/defaul...kb;en-us;314546
How to move SQL Server databases to a new location by using Detach and
Attach functions in SQL Server
http://support.microsoft.com/defaul...kb;en-us;224071
AMB
"pedestrian via webservertalk.com" wrote:

> How to copy a database from one server to another?
> Regards
> Pedestrian
> --
> Message posted via http://www.webservertalk.com
>|||Some options:
1. Backup the database on server1 and restore it on Server2
2. Detach the database from server1 then attach it on Server2
3. In SQL Server 2000 Enterprise Manager Go to the Tools menu -> Wizards->
Management-> Copy database Wizard
Nathan H. Omukwenyi
"pedestrian via webservertalk.com" <u16758@.uwe> wrote in message
news:60c0a605d490f@.uwe...
> How to copy a database from one server to another?
> Regards
> Pedestrian
> --
> Message posted via http://www.webservertalk.com|||Database backups from one SQL Server (server1) could be used to create
a copy of the database on another SQL Server (server2). But you do need
to take into account the existing user logins as the login mappings
from server1 are not restored correctly even if same logins exists on
server2. This article will help you to migrate those logins:
http://www.databasejournal.com/feat...cle.php/2228611
Regards, Alejandro Navia C=E1rdenas|||Thanks for all replies... I got the ideas...
Regards,
Pedestrian
alejo wrote:
>Database backups from one SQL Server (server1) could be used to create
>a copy of the database on another SQL Server (server2). But you do need
>to take into account the existing user logins as the login mappings
>from server1 are not restored correctly even if same logins exists on
>server2. This article will help you to migrate those logins:
>http://www.databasejournal.com/feat...cle.php/2228611
>Regards, Alejandro Navia Crdenas
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Forum...amming/200605/1

Thursday, March 8, 2012

Copy data to another server via XML?

Hello...
I have to transfer/copy data from our SQL 2005 server to another server that
is NOT part of our domain. I was figuing to use XML to do this...but we hav
e
some image data types in some of our tables and I cannot figure out how to
include that data in the XML.
Does anyone know of a way to do this..or an article explaining it?
thanks for any help
- willHello dw,
If you are using SQL Server 2005, take a look at Integration Services.
Thanks!
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||Thanks for the advice. I just found out that the customer requirements do
not include a need for image/binary data...so I am now thinking of using the
HTTP Endpoints stuff...not really sure as I don't know too much about it
yet. But it looks promising.
"Kent Tegels" wrote:

> Hello dw,
> If you are using SQL Server 2005, take a look at Integration Services.
> Thanks!
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>|||dw wrote:
> Thanks for the advice. I just found out that the customer requirements do
> not include a need for image/binary data...so I am now thinking of using t
he
> HTTP Endpoints stuff...not really sure as I don't know too much about it
> yet. But it looks promising.
For the record, XML itself is designed for text information, so it
cannot hold binary (image) data direct: it has to be encoded into
text characters first or referenced externally (like HTML).
But as Kent has pointed out, suppliers provide built-in ways to do
this for you.
///Peter
--
XML FAQ: http://xml.silmaril.ie/
> "Kent Tegels" wrote:
>

Sunday, February 19, 2012

Converting Traceid issue

Hi,

I am trying to automate a SQL Trace via a stored procedure and a job. The job
executes the stored procedure to start the trace and every 15 minutes, the
job is supposed to stop the trace, clear it from memory, rename the trace
file, and start a new trace so I can select the average duration for this
process. I am getting the following error message:

Procedure expects parameter '@.traceid' of type 'int'

When I try to run this portion of the script (@.traceid is declared as an INT
at the beginning of the job):

Set @.traceid = (select distinct(convert(int,traceid)) from ::fn_trace_getinfo
(default) where value = 'D:\MSSQL\JOBS\HCMDB_RequestQueue_Trace.trc')-- the
name of my trace file

print 'Stop current trace'
exec sp_trace_setstatus @.traceid,0

print 'Erase current trace from memory'
exec sp_trace_setstatus @.traceid,2

print 'Moving file to _1'
exec master..xp_cmdshell 'move D:\MSSQL\JOBS\HCMDB RequestQueue Trace.trc D:\
MSSQL\JOBS\HCMDB_RequestQueue_Trace1.trc',
NO_OUTPUT

I know I must be missing something obvious, but I haven't been able to figure
it out. Any assistance is greatly appreciated.

Thanks,
Michael

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forum...eneral/200602/1michael via SQLMonster.com (u13012@.uwe) writes:
> I am trying to automate a SQL Trace via a stored procedure and a job.
> The job executes the stored procedure to start the trace and every 15
> minutes, the job is supposed to stop the trace, clear it from memory,
> rename the trace file, and start a new trace so I can select the average
> duration for this process. I am getting the following error message:
> Procedure expects parameter '@.traceid' of type 'int'
> When I try to run this portion of the script (@.traceid is declared as an
> INT at the beginning of the job):
> Set @.traceid = (select distinct(convert(int,traceid)) from
> ::fn_trace_getinfo> (default) where value =
> 'D:\MSSQL\JOBS\HCMDB_RequestQueue_Trace.trc') -- the
> name of my trace file
> print 'Stop current trace'
> exec sp_trace_setstatus @.traceid,0
>...
> I know I must be missing something obvious, but I haven't been able to
> figure it out. Any assistance is greatly appreciated.

Obvious and obvious... First a hint. Try this:

DECLARE @.traceid int
exec sp_trace_setstatus @.traceid,0

This give the same error as you get. sp_trace_setstatus does not
like the NULL value.

So presumably, you fail to set @.traceid. The value column of
fn_get_tracestatus is sql_variant. Per the conversion rules in
SQL Server, the string literal is converted to sql_variant. I believe
that for to sql_variant values to be equal, they must have the same
base type. But value for the file name, is surely nvarchar.

So adding an N before string literal to make it nvarchar may work.
I would recommand to explicitly convert value to nvarchar(4000).
is sql_variaamt

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thanks for your response. I think I might not have stated the issue clearly
or am not understanding your response. My issue is that the traceid is not
being returned as an INT. There is no problem with the file name and the
nvarchar.

Of the PRINT statements in my code below, I get everything up to and
including 'Stop current trace'. My SET does return the traceid, but not in
integer format.

I'll do further research on the sql_variant though and see if I can get
further with that.

Thanks

Erland Sommarskog wrote:
>> I am trying to automate a SQL Trace via a stored procedure and a job.
>> The job executes the stored procedure to start the trace and every 15
>[quoted text clipped - 17 lines]
>> I know I must be missing something obvious, but I haven't been able to
>> figure it out. Any assistance is greatly appreciated.
>Obvious and obvious... First a hint. Try this:
> DECLARE @.traceid int
> exec sp_trace_setstatus @.traceid,0
>This give the same error as you get. sp_trace_setstatus does not
>like the NULL value.
>So presumably, you fail to set @.traceid. The value column of
>fn_get_tracestatus is sql_variant. Per the conversion rules in
>SQL Server, the string literal is converted to sql_variant. I believe
>that for to sql_variant values to be equal, they must have the same
>base type. But value for the file name, is surely nvarchar.
>So adding an N before string literal to make it nvarchar may work.
>I would recommand to explicitly convert value to nvarchar(4000).
>is sql_variaamt

--
Message posted via http://www.sqlmonster.com|||Okay, looks like I've got it working now. I needed to use CAST instead of
CONVERT for the traceid to get it to read as an INT.

Thanks again for the feedback.

michael wrote:
>Thanks for your response. I think I might not have stated the issue clearly
>or am not understanding your response. My issue is that the traceid is not
>being returned as an INT. There is no problem with the file name and the
>nvarchar.
>Of the PRINT statements in my code below, I get everything up to and
>including 'Stop current trace'. My SET does return the traceid, but not in
>integer format.
>I'll do further research on the sql_variant though and see if I can get
>further with that.
>Thanks
>>> I am trying to automate a SQL Trace via a stored procedure and a job.
>>> The job executes the stored procedure to start the trace and every 15
>[quoted text clipped - 19 lines]
>>I would recommand to explicitly convert value to nvarchar(4000).
>>is sql_variaamt

--
Message posted via http://www.sqlmonster.com

Converting to Hex

Hi All,

I'm needing to take a value inputted by a user via html form and convert it to a hex value upon inserting into SQL2000 db. I only need to store the 8 chars after "0x". Is there any T-SQL that can pull this off? CAST or CONVERT? Sorry if this is a silly question and hope I supplied enough info...

Thx,
Mike
Check this post (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=386406&SiteID=1) for Umachandar's solution (which are always great!)