Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Monday, March 19, 2012

ahh fer the luvva...

With a ForEach container, configured to loop through files in a directory, if I have a problem with a file.. can I direct the loop to skip on to the next file?
I'm processing structured files, first record of each is some header info, body records are in the middle, and then the last record is a trailer containg a checksum
So, for each file in the directory, I split the records into three raw files, one for header rec(s) , one for body recs and one for trailer recs. (based on line numbers and using a conditional split to direct the records)
Then I start by processing the header recs in a dataflow.. if all goes well there I move on to the next dataflow to process the body recs from the DataRecs raw file.. etc...
I would like to do some validation at each processing step.. if a header rec fails validation say... then I'd like to just stop processing that file and move onto the next file...
Now, I don't see my validation throwing an exception... so its more that I'd decide (maybe using an Audit ) that the header doesn't pass validation.. then I'd like to put a record in an error table (with info about filename, source etc, not just content of the current data row)
But not sure what approach to take on this...
If there is an appropriate section in BOL please point me at it...
Thanks
PJ

OK, so a record could fail validation but won't necassarily cause an error, is that right?

If you can find a way of populating a boolean variable stating whether the validation was successful or not then you could put a conditional precedence constraint beween data-flow1 and data-flow2 to determine whether data-flow2 should execute or not.

-Jamie

|||

... and if data-flow2 shouldn't execute then the ForEach will just loop around?

PJ

|||

Ok... so have to figure out how to access global variables in a script task....

OR...

...could do a conditional split.. which carries out the validation checking...and has one output connected to an OLE DB Destination to store a valid header record.. the other output directed to a RowCount...

If the row count >0 then we have a validation failure.. so could set the global variable there... is there a way to send a row count to a package variable?

PJ

|||

PJFINTRAX wrote:

... and if data-flow2 shouldn't execute then the ForEach will just loop around?

PJ

Absolutely! (Unless you have any other OnSuccess precedence constraints from data-flow1). Once all work is done for that iteration then it'll go onto the next iteration.

|||

PJFINTRAX wrote:

a way to send a row count to a package variable?

PJ

Err yeah. That's exactly what it does (and the only thing it does). i.e. Store the rowcount in a variable :)

|||

Jamie Thomson wrote:

PJFINTRAX wrote:

a way to send a row count to a package variable?

PJ

Err yeah. That's exactly what it does (and the only thing it does). i.e. Store the rowcount in a variable :)

DOH! Well, we all know I'm only making this up as I go along :^)

Thanks

PJ

|||

sigh.. this is like pulling teeth... now another problem has reared its ugly head...

when i use the SQL Task to retrieve the ID of the FileHeader record (that I just inserted) into a package variable... I get a datatype error.. and can't figure out which bloomin data type to use...(for the variable)

In my DB table the ID is a bigint....

what on earth is the equivalent in SSIS datatypes.... I have literally tried em all.. only one that works is Object !!!

So, SQL Task is executing SQL query as follows "select MAX(ID) as ID from fileheader"

Table definition is :

CREATE TABLE [dbo].[FileHeader](
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[Source] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FileName] [varchar](500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[LoadDate] [datetime] NULL CONSTRAINT [DF_FileHeader_LoadDate] DEFAULT (getdate())
) ON [PRIMARY]

So what should my variable type be if its to hold the result of the query?

PJ....

|||

Ahh what they hell.. I'll just use String.. that works....

|||Guys, I have the bigint problem again, can't just use a string this time...
has anyone any idea what the SSIS datatype equivalent of a bigint is at all?
Thanks
PJ
|||Is this just so obvious that nobody is bothering to answer?
|||

Probably cos they don't know. And I'm afraid I include myself in that. I don't have a SSIS instance to hand but as and when I do I'll try and take a look OK.

-Jamie

|||

Thanks Jamie,

but I have been through every single datatype .. and if I try to wedge a bigint into anything other than a string I get an error...

I would have thought an INT64 would work.. but no...

the bigint is an identity column in a table in my db... I'm a result set (which includes it) into an object and using that as a recordset using a foreach.. and I need to compare the ID column numerically.. to decide which flow to go down (ie If FiletypeID >12 and FileTypeID > 4 )

i suppose since the presedence contstraint is an expression I could try casting to a int64 maybe...

bit awkward tho.... would have thought this would all be easier... (like most SSIS things, heh)

PJ

Aggregations...

Here is 2 different version's of practically the same aggregation.

See images below please.

Version 1.) Smaller aggregation file size.

Version 2.) Process Index is twice as fast.

Both version's queries take the same amount of time because it seems even though I create two versions of the aggregation, SSAS creates the same aggregation data set. Any idea whats going on here, there's plus and minus' to both versions...thanks.

Version1: http://img405.imageshack.us/img405/7673/vers1og4.jpg

Version2: http://img255.imageshack.us/img255/2488/vers2mo0.jpg

Hate to bump, but no one knows whats going on here? We are using version 2...it processes much faster so we can create more aggregations.

Tuesday, March 6, 2012

Aggregate Component very slow?

Does anyone know of a way to speed up an aggregation? I am pulling in a flat file that goes to an aggregate component. The flat file has approx 10m records and I am grouping by the first 14 columns, the input is sorted in that order. There are no more than 2 rows for each grouping and most have one. The problem is that it takes about 2 minutes to read in the flat file, but 30 min later the aggregation has only put out about 30k rows. I know that there will be around 9m rows after grouping so obviously it is going to take forever to get through all of them. Any ideas would be appreciated. We are doing a POC for SSIS and judging from the posts that I've seen sorting and aggregation seem to have a lot of perfomance issues, which surprizes me in an ETL tool. We are running on a dedicated Xeon box with two 3GHZ cpus and 4GB of ram, so the problem is not there.

Thank You!
Harry
GuideOne InsuranceHello.

Strange. I have had stunning performance on everything I have tried. Haven't tried dual 64-bit, though. Does the same happen on a 32-bit workstation? Have you tried to set processor affinity on the process so that it only uses one processor?

A humble suggestion: Minimize size of data flow tasks. Move functionality to SQL tasks.

I believe I have about the same amount of data you have (10M records, 10-20 columns of text which I pull via FTP and from some in-house systems, I have been running it on SQL 2005 for a years time)

I have found it to make sense to move much of my SSIS Data Flow based functionality into control flow SQL tasks, which I mirror as stored procedures for reference and testing.

This has a number of advantages
1. Any changes in structure is easier.
2. Documentation is easier (I find it easier to print stored procedures than data flow components)
3. Testing and iterativ development is easier.
4. Special needs are easier met. I have found writing CLR code to run inside the server much, much easier to develop than script-based tasks (I have used both). Writing custom data flow components were a real nightmare on the beta I tried it. An extra bonus has been the user defined aggregates, which makes my life easier.
5. Trust. I trust SQL "GROUP BY" more than data flow aggregate. Same goes for sorting.

Disadvantages with moving functionality from data flow to control flow has been
1. Keeping two identical sources is error prone (stored procedures that mimics SQL Server tasks)
2. Paralellism. Since a task needs to be finished before the next one can start, this should teoretically take more time. Still, the new engine is extremely performant, so I have met my requirements easily. Getting the data via FTP has been the bottleneck.
3. Storage. Obviously, saving temporary data along the way puts extra pressure on the storage system. I actually used to run defrag automatically before my dts package, don't know if it helped, but I don think it can hurt.

Just wanted to share some experiences.

Hope this is helpful.|||Gorm,

Thank you for the insights, they are very helpful. The data that I am trying to aggregate is from a flat file that has been ftp'ed from a z/os box. What I ended up doing is creating a "scratch" table, loading the flat file to there and grouping it with a query from the scratch table. That ran reasonably quick. I agree that SQL 2005 seems to do a great job on most things that I have tried. I does still bother me that SSIS has performance issues with sorts, aggregates and merges. I would think those would be the best performers in an ETL tool. That is going to hurt them in a lot of shops. I have managed to find work arounds for most of them doing it, as you it sounds like you are, in the SQL. We are currently running 32 bit. We originally had the 64 bit stood up, but there were a lot of issues there so we backed off. We are just evaluating the product for our warehousing which currently runs on DB2 7.2 on a z/os box. I really haven't tried much with the stored procedure route yet, but that is great thinking. Do you know of some good resource manual/tutorials for SP devlopment?

Once again thank you for your help and suggestions!!
Harry
GuideOne Insurance

Saturday, February 25, 2012

AgentMail Problem (SQL2K)

Hi,
I use Microsoft outlook as MAPI client. On my own computer, when the outlook
is open, both SQL Mail and Agent Mail can use the file of mail profile to
send email. But on one of client's computer, when outlook is open, it locks
the file of profile and both SQL Mail and Agent Mail fail when try to
connect to profile. When I close outlook, they can access profile. This is
strange behavior that I had never seen elsewhere.
Any help would be greatly appreciated.
Leila
I believe this behavior can depend on your version of Outlook (I prefer Outlook 2000, I've seen the
strange behavior with later versions). It might also be related to whether all users use the same
Windows account.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Leila" <Leilas@.hotpop.com> wrote in message news:uMzUEcNjHHA.4872@.TK2MSFTNGP03.phx.gbl...
> Hi,
> I use Microsoft outlook as MAPI client. On my own computer, when the outlook is open, both SQL
> Mail and Agent Mail can use the file of mail profile to send email. But on one of client's
> computer, when outlook is open, it locks the file of profile and both SQL Mail and Agent Mail fail
> when try to connect to profile. When I close outlook, they can access profile. This is strange
> behavior that I had never seen elsewhere.
> Any help would be greatly appreciated.
> Leila
>
|||> It might also be related to whether all users use the same Windows
> account.
If this is the case, then closing the outlook must not solve the problem I
think
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%234lZSjNjHHA.680@.TK2MSFTNGP06.phx.gbl...
>I believe this behavior can depend on your version of Outlook (I prefer
>Outlook 2000, I've seen the strange behavior with later versions). It might
>also be related to whether all users use the same Windows account.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Leila" <Leilas@.hotpop.com> wrote in message
> news:uMzUEcNjHHA.4872@.TK2MSFTNGP03.phx.gbl...
>
|||I think that some versions of MAPI (Outlook) doesn't like several Windows accounts using mail at the
same time. Say that Agent and SQL Server uses the same service account. They might not conflict, but
if you are logged in interactively using some other account, you might be in for some problems.
Anyhow, I recommend Outlook 2000. Or actually, I don't recommend SQL Mail at all
(http://www.karaszi.com/SQLServer/info_no_mapi.asp), since it causes so many of these problems...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Leila" <Leilas@.hotpop.com> wrote in message news:OLQuVxOjHHA.2552@.TK2MSFTNGP06.phx.gbl...
> If this is the case, then closing the outlook must not solve the problem I think
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:%234lZSjNjHHA.680@.TK2MSFTNGP06.phx.gbl...
>

AgentMail Problem (SQL2K)

Hi,
I use Microsoft outlook as MAPI client. On my own computer, when the outlook
is open, both SQL Mail and Agent Mail can use the file of mail profile to
send email. But on one of client's computer, when outlook is open, it locks
the file of profile and both SQL Mail and Agent Mail fail when try to
connect to profile. When I close outlook, they can access profile. This is
strange behavior that I had never seen elsewhere.
Any help would be greatly appreciated.
LeilaI believe this behavior can depend on your version of Outlook (I prefer Outl
ook 2000, I've seen the
strange behavior with later versions). It might also be related to whether a
ll users use the same
Windows account.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Leila" <Leilas@.hotpop.com> wrote in message news:uMzUEcNjHHA.4872@.TK2MSFTNGP03.phx.gbl...[v
bcol=seagreen]
> Hi,
> I use Microsoft outlook as MAPI client. On my own computer, when the outlo
ok is open, both SQL
> Mail and Agent Mail can use the file of mail profile to send email. But on
one of client's
> computer, when outlook is open, it locks the file of profile and both SQL
Mail and Agent Mail fail
> when try to connect to profile. When I close outlook, they can access prof
ile. This is strange
> behavior that I had never seen elsewhere.
> Any help would be greatly appreciated.
> Leila
>[/vbcol]|||> It might also be related to whether all users use the same Windows
> account.
If this is the case, then closing the outlook must not solve the problem I
think
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%234lZSjNjHHA.680@.TK2MSFTNGP06.phx.gbl...
>I believe this behavior can depend on your version of Outlook (I prefer
>Outlook 2000, I've seen the strange behavior with later versions). It might
>also be related to whether all users use the same Windows account.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Leila" <Leilas@.hotpop.com> wrote in message
> news:uMzUEcNjHHA.4872@.TK2MSFTNGP03.phx.gbl...
>|||I think that some versions of MAPI (Outlook) doesn't like several Windows ac
counts using mail at the
same time. Say that Agent and SQL Server uses the same service account. They
might not conflict, but
if you are logged in interactively using some other account, you might be in
for some problems.
Anyhow, I recommend Outlook 2000. Or actually, I don't recommend SQL Mail at
all
(http://www.karaszi.com/SQLServer/info_no_mapi.asp), since it causes so many
of these problems...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Leila" <Leilas@.hotpop.com> wrote in message news:OLQuVxOjHHA.2552@.TK2MSFTNGP06.phx.gbl...[v
bcol=seagreen]
> If this is the case, then closing the outlook must not solve the problem I
think
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:%234lZSjNjHHA.680@.TK2MSFTNGP06.phx.gbl...
>[/vbcol]

AgentMail Problem (SQL2K)

Hi,
I use Microsoft outlook as MAPI client. On my own computer, when the outlook
is open, both SQL Mail and Agent Mail can use the file of mail profile to
send email. But on one of client's computer, when outlook is open, it locks
the file of profile and both SQL Mail and Agent Mail fail when try to
connect to profile. When I close outlook, they can access profile. This is
strange behavior that I had never seen elsewhere.
Any help would be greatly appreciated.
LeilaI believe this behavior can depend on your version of Outlook (I prefer Outlook 2000, I've seen the
strange behavior with later versions). It might also be related to whether all users use the same
Windows account.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Leila" <Leilas@.hotpop.com> wrote in message news:uMzUEcNjHHA.4872@.TK2MSFTNGP03.phx.gbl...
> Hi,
> I use Microsoft outlook as MAPI client. On my own computer, when the outlook is open, both SQL
> Mail and Agent Mail can use the file of mail profile to send email. But on one of client's
> computer, when outlook is open, it locks the file of profile and both SQL Mail and Agent Mail fail
> when try to connect to profile. When I close outlook, they can access profile. This is strange
> behavior that I had never seen elsewhere.
> Any help would be greatly appreciated.
> Leila
>|||> It might also be related to whether all users use the same Windows
> account.
If this is the case, then closing the outlook must not solve the problem I
think
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%234lZSjNjHHA.680@.TK2MSFTNGP06.phx.gbl...
>I believe this behavior can depend on your version of Outlook (I prefer
>Outlook 2000, I've seen the strange behavior with later versions). It might
>also be related to whether all users use the same Windows account.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Leila" <Leilas@.hotpop.com> wrote in message
> news:uMzUEcNjHHA.4872@.TK2MSFTNGP03.phx.gbl...
>> Hi,
>> I use Microsoft outlook as MAPI client. On my own computer, when the
>> outlook is open, both SQL Mail and Agent Mail can use the file of mail
>> profile to send email. But on one of client's computer, when outlook is
>> open, it locks the file of profile and both SQL Mail and Agent Mail fail
>> when try to connect to profile. When I close outlook, they can access
>> profile. This is strange behavior that I had never seen elsewhere.
>> Any help would be greatly appreciated.
>> Leila
>|||I think that some versions of MAPI (Outlook) doesn't like several Windows accounts using mail at the
same time. Say that Agent and SQL Server uses the same service account. They might not conflict, but
if you are logged in interactively using some other account, you might be in for some problems.
Anyhow, I recommend Outlook 2000. Or actually, I don't recommend SQL Mail at all
(http://www.karaszi.com/SQLServer/info_no_mapi.asp), since it causes so many of these problems...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Leila" <Leilas@.hotpop.com> wrote in message news:OLQuVxOjHHA.2552@.TK2MSFTNGP06.phx.gbl...
>> It might also be related to whether all users use the same Windows account.
> If this is the case, then closing the outlook must not solve the problem I think
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:%234lZSjNjHHA.680@.TK2MSFTNGP06.phx.gbl...
>>I believe this behavior can depend on your version of Outlook (I prefer Outlook 2000, I've seen
>>the strange behavior with later versions). It might also be related to whether all users use the
>>same Windows account.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Leila" <Leilas@.hotpop.com> wrote in message news:uMzUEcNjHHA.4872@.TK2MSFTNGP03.phx.gbl...
>> Hi,
>> I use Microsoft outlook as MAPI client. On my own computer, when the outlook is open, both SQL
>> Mail and Agent Mail can use the file of mail profile to send email. But on one of client's
>> computer, when outlook is open, it locks the file of profile and both SQL Mail and Agent Mail
>> fail when try to connect to profile. When I close outlook, they can access profile. This is
>> strange behavior that I had never seen elsewhere.
>> Any help would be greatly appreciated.
>> Leila
>>
>

Friday, February 24, 2012

AFTER TRIGGER

I would like to create a trigger that after a DML event, let's say an
INSERT, will call an external exe file using xp_cmdshell and pass to the exe
the @.@.identity which resulted by the INSERT.
Is there a way to achieve this?Yan,
Doing this will compromise the transaction (i.e. if the external program
hang up, then the transaction will remain open for a long time). Also take i
n
mind that the statement that activated the trigger could have affected
multiple rows. May be if you tell the group what are you trying to
accomplish, somebody can come with a better approach.
AMB
"Yan" wrote:

> I would like to create a trigger that after a DML event, let's say an
> INSERT, will call an external exe file using xp_cmdshell and pass to the e
xe
> the @.@.identity which resulted by the INSERT.
> Is there a way to achieve this?
>
>|||Hi Yan
This trigger runs for me. "Kuku" is a table with an IDENTITY column. I hope
it helps.
CREATE TRIGGER TRG_KUKU_ON_INSERT ON [dbo].[Kuku]
FOR INSERT
AS
DECLARE @.idd int
DECLARE @.cmd NVARCHAR(100)
SET @.idd = @.@.identity
SET @.cmd = 'CommandToExecute ' + CAST(@.idd AS NVARCHAR)
exec master..xp_cmdshell @.cmd
Boaz Ben-Porat
Milestone Systems
Denmark
"Yan" <yanive@.rediffmail.com> wrote in message
news:OSQOgBTmGHA.2372@.TK2MSFTNGP04.phx.gbl...
>I would like to create a trigger that after a DML event, let's say an
>INSERT, will call an external exe file using xp_cmdshell and pass to the
>exe the @.@.identity which resulted by the INSERT.
> Is there a way to achieve this?
>|||Yan wrote:
> I would like to create a trigger that after a DML event, let's say an
> INSERT, will call an external exe file using xp_cmdshell and pass to the e
xe
> the @.@.identity which resulted by the INSERT.
> Is there a way to achieve this?
>
I would take a different approach, for a couple of reasons:
1. An insert doesn't always involve a single record, multiple records
can be inserted at once, thus you won't have a single ID to work with.
2. Involving an external process in a transaction is introducing a
point of failure. If the external process fails, or performs poorly,
your transaction will as will, causing the insert to fail or perform poorly.
I would instead write the trigger to insert all new ID's into a
"staging" table, and create a scheduled job that monitors that staging
table for new records. When new records are found, then run your
external process.|||Thank you Tracy for this post and I thank all other answeres as well.
I have some logic in my trigger to ensure we work just on a single record as
we expect.
I adopt your approach to have the trigger insert the Ids to another table on
which we can make what we need and not in the context of a transaction
(inside the trigger).
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:uV6ShYTmGHA.4716@.TK2MSFTNGP04.phx.gbl...
> Yan wrote:
> I would take a different approach, for a couple of reasons:
> 1. An insert doesn't always involve a single record, multiple records can
> be inserted at once, thus you won't have a single ID to work with.
> 2. Involving an external process in a transaction is introducing a point
> of failure. If the external process fails, or performs poorly, your
> transaction will as will, causing the insert to fail or perform poorly.
> I would instead write the trigger to insert all new ID's into a "staging"
> table, and create a scheduled job that monitors that staging table for new
> records. When new records are found, then run your external process.

Sunday, February 19, 2012

After server rename, xp_cmdshell problem

I have a job which runs a SP containing a xp_cmdshell call to
wzunzip.exe to unzip a file. This has worked for over a year without
a glitch. I recently renamed the server, following the proper steps I
think, and now this SP hangs at the unzip command. I can't even
cancel the job, when I try I see that the server is doing a rollback,
but it never finishes, and I have no idea what it would be rolling
back. I end up stopping the agent and restarting. I am probably
missing something easy but I can't figure it out. This same script
has always worked and continues to work on other servers, the only
change being the server rename. Any ideas on what I am missing?
Thanks,
Charles
Are you using the command-line versions of winzip (separate download)?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Charles Sands" <z666z@.yahoo.com> wrote in message news:1f9df651.0408140754.3047b6a@.posting.google.co m...
> I have a job which runs a SP containing a xp_cmdshell call to
> wzunzip.exe to unzip a file. This has worked for over a year without
> a glitch. I recently renamed the server, following the proper steps I
> think, and now this SP hangs at the unzip command. I can't even
> cancel the job, when I try I see that the server is doing a rollback,
> but it never finishes, and I have no idea what it would be rolling
> back. I end up stopping the agent and restarting. I am probably
> missing something easy but I can't figure it out. This same script
> has always worked and continues to work on other servers, the only
> change being the server rename. Any ideas on what I am missing?
> Thanks,
> Charles
|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message news:<O2t6qnigEHA.2928@.TK2MSFTNGP10.phx.gbl>...
> Are you using the command-line versions of winzip (separate download)?
Yes I am using the command-line version. I just uninstalled and
reinstalled winzip and the command-line add-on. It is working fine
from the command line. But when I try to run it from QA it just
hangs, no indication of anything. I can see from taskmanager that
wzunzip.exe is running, but nothing happens.
[vbcol=seagreen]
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Charles Sands" <z666z@.yahoo.com> wrote in message news:1f9df651.0408140754.3047b6a@.posting.google.co m...
|||Perhaps it is waiting form some type of input? I believe that there are silent switches and stuff for the
command-line versions. Might be worth trying out? I haven't unzipped from xp_cmdshell, but I have zipped...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Charles Sands" <z666z@.yahoo.com> wrote in message news:1f9df651.0408151256.29d1aded@.posting.google.c om...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
news:<O2t6qnigEHA.2928@.TK2MSFTNGP10.phx.gbl>...[vbcol=seagreen]
> Yes I am using the command-line version. I just uninstalled and
> reinstalled winzip and the command-line add-on. It is working fine
> from the command line. But when I try to run it from QA it just
> hangs, no indication of anything. I can see from taskmanager that
> wzunzip.exe is running, but nothing happens.
>

After server rename, xp_cmdshell problem

I have a job which runs a SP containing a xp_cmdshell call to
wzunzip.exe to unzip a file. This has worked for over a year without
a glitch. I recently renamed the server, following the proper steps I
think, and now this SP hangs at the unzip command. I can't even
cancel the job, when I try I see that the server is doing a rollback,
but it never finishes, and I have no idea what it would be rolling
back. I end up stopping the agent and restarting. I am probably
missing something easy but I can't figure it out. This same script
has always worked and continues to work on other servers, the only
change being the server rename. Any ideas on what I am missing?
Thanks,
CharlesAre you using the command-line versions of winzip (separate download)?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Charles Sands" <z666z@.yahoo.com> wrote in message news:1f9df651.0408140754.3047b6a@.posting.
google.com...
> I have a job which runs a SP containing a xp_cmdshell call to
> wzunzip.exe to unzip a file. This has worked for over a year without
> a glitch. I recently renamed the server, following the proper steps I
> think, and now this SP hangs at the unzip command. I can't even
> cancel the job, when I try I see that the server is doing a rollback,
> but it never finishes, and I have no idea what it would be rolling
> back. I end up stopping the agent and restarting. I am probably
> missing something easy but I can't figure it out. This same script
> has always worked and continues to work on other servers, the only
> change being the server rename. Any ideas on what I am missing?
> Thanks,
> Charles|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message news:<O2
t6qnigEHA.2928@.TK2MSFTNGP10.phx.gbl>...
> Are you using the command-line versions of winzip (separate download)?
Yes I am using the command-line version. I just uninstalled and
reinstalled winzip and the command-line add-on. It is working fine
from the command line. But when I try to run it from QA it just
hangs, no indication of anything. I can see from taskmanager that
wzunzip.exe is running, but nothing happens.
[vbcol=seagreen]
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Charles Sands" <z666z@.yahoo.com> wrote in message news:1f9df651.040814075
4.3047b6a@.posting.google.com...|||Perhaps it is waiting form some type of input? I believe that there are sile
nt switches and stuff for the
command-line versions. Might be worth trying out? I haven't unzipped from xp
_cmdshell, but I have zipped...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Charles Sands" <z666z@.yahoo.com> wrote in message news:1f9df651.0408151256.29d1aded@.posting
.google.com...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in messag
e
news:<O2t6qnigEHA.2928@.TK2MSFTNGP10.phx.gbl>...[vbcol=seagreen]
> Yes I am using the command-line version. I just uninstalled and
> reinstalled winzip and the command-line add-on. It is working fine
> from the command line. But when I try to run it from QA it just
> hangs, no indication of anything. I can see from taskmanager that
> wzunzip.exe is running, but nothing happens.
>

After server rename, xp_cmdshell problem

I have a job which runs a SP containing a xp_cmdshell call to
wzunzip.exe to unzip a file. This has worked for over a year without
a glitch. I recently renamed the server, following the proper steps I
think, and now this SP hangs at the unzip command. I can't even
cancel the job, when I try I see that the server is doing a rollback,
but it never finishes, and I have no idea what it would be rolling
back. I end up stopping the agent and restarting. I am probably
missing something easy but I can't figure it out. This same script
has always worked and continues to work on other servers, the only
change being the server rename. Any ideas on what I am missing?
Thanks,
CharlesAre you using the command-line versions of winzip (separate download)?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Charles Sands" <z666z@.yahoo.com> wrote in message news:1f9df651.0408140754.3047b6a@.posting.google.com...
> I have a job which runs a SP containing a xp_cmdshell call to
> wzunzip.exe to unzip a file. This has worked for over a year without
> a glitch. I recently renamed the server, following the proper steps I
> think, and now this SP hangs at the unzip command. I can't even
> cancel the job, when I try I see that the server is doing a rollback,
> but it never finishes, and I have no idea what it would be rolling
> back. I end up stopping the agent and restarting. I am probably
> missing something easy but I can't figure it out. This same script
> has always worked and continues to work on other servers, the only
> change being the server rename. Any ideas on what I am missing?
> Thanks,
> Charles|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message news:<O2t6qnigEHA.2928@.TK2MSFTNGP10.phx.gbl>...
> Are you using the command-line versions of winzip (separate download)?
Yes I am using the command-line version. I just uninstalled and
reinstalled winzip and the command-line add-on. It is working fine
from the command line. But when I try to run it from QA it just
hangs, no indication of anything. I can see from taskmanager that
wzunzip.exe is running, but nothing happens.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Charles Sands" <z666z@.yahoo.com> wrote in message news:1f9df651.0408140754.3047b6a@.posting.google.com...
> > I have a job which runs a SP containing a xp_cmdshell call to
> > wzunzip.exe to unzip a file. This has worked for over a year without
> > a glitch. I recently renamed the server, following the proper steps I
> > think, and now this SP hangs at the unzip command. I can't even
> > cancel the job, when I try I see that the server is doing a rollback,
> > but it never finishes, and I have no idea what it would be rolling
> > back. I end up stopping the agent and restarting. I am probably
> > missing something easy but I can't figure it out. This same script
> > has always worked and continues to work on other servers, the only
> > change being the server rename. Any ideas on what I am missing?
> >
> > Thanks,
> > Charles|||Perhaps it is waiting form some type of input? I believe that there are silent switches and stuff for the
command-line versions. Might be worth trying out? I haven't unzipped from xp_cmdshell, but I have zipped...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Charles Sands" <z666z@.yahoo.com> wrote in message news:1f9df651.0408151256.29d1aded@.posting.google.com...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
news:<O2t6qnigEHA.2928@.TK2MSFTNGP10.phx.gbl>...
> > Are you using the command-line versions of winzip (separate download)?
> Yes I am using the command-line version. I just uninstalled and
> reinstalled winzip and the command-line add-on. It is working fine
> from the command line. But when I try to run it from QA it just
> hangs, no indication of anything. I can see from taskmanager that
> wzunzip.exe is running, but nothing happens.
>
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://www.solidqualitylearning.com/
> >
> >
> > "Charles Sands" <z666z@.yahoo.com> wrote in message news:1f9df651.0408140754.3047b6a@.posting.google.com...
> > > I have a job which runs a SP containing a xp_cmdshell call to
> > > wzunzip.exe to unzip a file. This has worked for over a year without
> > > a glitch. I recently renamed the server, following the proper steps I
> > > think, and now this SP hangs at the unzip command. I can't even
> > > cancel the job, when I try I see that the server is doing a rollback,
> > > but it never finishes, and I have no idea what it would be rolling
> > > back. I end up stopping the agent and restarting. I am probably
> > > missing something easy but I can't figure it out. This same script
> > > has always worked and continues to work on other servers, the only
> > > change being the server rename. Any ideas on what I am missing?
> > >
> > > Thanks,
> > > Charles

Thursday, February 16, 2012

After MSDE upgrade to SQL 2005, MDF is not found

After upgrading an MSDE 2000 instance to SQL 2005, the database appears to be intact - according to the log file:

2007-08-28 13:51:13.78 spid11s Starting up database 'HysterSuiteMainSQL'.

Then after a system shutdown:

2007-08-28 13:57:43.57 Server SQL Server is terminating because of a system shutdown. This is an informational message only. No user action is required.

It appears the MDF file disappeared mysteriously:

2007-08-28 14:03:11.84 spid51 Starting up database 'HysterSuiteMainSQL'.
2007-08-28 14:03:11.85 spid51 Error: 17207, Severity: 16, State: 1.
2007-08-28 14:03:11.85 spid51 FCB:Surprisepen: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'C:\PROGRAM FILES\HYSTER SUITE\MSDE\Data\MSSQL$HS2000\Data\Hyster.mdf'. Diagnose and correct the operating system error, and retry the operation.

Has anyone encountered this issue? Any ideas on what might have gone wrong?

Thanks,

Mike

After upgrading to sql 2005 did you change the startup account of sql 2005 ? if yes may be the startup account might not have modify privilege to the path where the mdf and ldf resides........as the error is explicit that its related to permission.....

Sunday, February 12, 2012

After export to flat file, all records are in one line, help!?

I created a package that exports contents from a table to a flat file but all my records are being displayed in a single record. where do i configure it to where each record has its own line. the columns in the flat file are fixed.Did you specify a row delimiter? If you did, and specified a LF as the delimiter, you may need to view the file in Wordpad or something. Otherwise, I'd guess there is no row delimiter chosen.|||You should pick fixed width with ragged right for the flat file type if you want a row delimiter, or in line with Phil's suggestions, you can set the column delimiter on your last column to {CR}{LF}.|||THANKS PHIL AND JWELCH, BOTH YOUR INPUT WAS VERY HELPFULL...THINGS ARE WORKING NOW.

After DBCC SHRINKFILE

After DBCC SHRINKFILE(dbname_Log,10)
The message:
“Cannot shrink log file 2 (dbname_Log) because all logical log files are i
n
use.”
had been appeared.
How to decrease the log file size ?Did you backup the transaction log before trying to shrink it?
AMB
"Alur" wrote:

> After DBCC SHRINKFILE(dbname_Log,10)
> The message:
> “Cannot shrink log file 2 (dbname_Log) because all logical log files are
in
> use.”
> had been appeared.
> How to decrease the log file size ?
>|||... and sometimes you have to do this several times (backup, shrink, backup
, shrink...) Check out
DBCC LOGINFO (Google etc).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:67DA0AAF-F3F6-4AA4-8C55-4F86F916A02E@.microsoft.com...
> Did you backup the transaction log before trying to shrink it?
>
> AMB
> "Alur" wrote:
>|||I could not backup the transaction log.
"Alejandro Mesa" wrote:
> Did you backup the transaction log before trying to shrink it?
>
> AMB
> "Alur" wrote:
>|||What error are you getting when trying to backup the transaction log?
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Alur" <Alur@.discussions.microsoft.com> wrote in message
news:3B228137-B620-408E-9F8A-435F00286FAA@.microsoft.com...
>I could not backup the transaction log.
> "Alejandro Mesa" wrote:
>|||Something about insufficient disk space. And I cannot increase the space now
.
"Mike Epprecht (SQL MVP)" wrote:

> What error are you getting when trying to backup the transaction log?
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Alur" <Alur@.discussions.microsoft.com> wrote in message
> news:3B228137-B620-408E-9F8A-435F00286FAA@.microsoft.com...
>
>

After attaching database it is in Read only mode

Hi,
I detached a database from Server1 and took MDF file to Server2.
After that I re-attached the database on Server1.
When I tried to attached database using EM, sp_attach_db and also
sp_Attach_single_file, i was getting error msg 1813.
So I detached database again from Server1 and used the LDF on Server2.
It recognizes and LDF file and attaches the database. However, the
database is in read-only mode. I can go to properties and uncheck
"Read-Only" but when I try to save the changes it gives me Error 5105
- Deactivation Error...
I don't have access to new MDF file after I detached it again.
Any help will be greatly appreciated.
Divyesh
Check the file properties for the mdf and ldf at the
operating system level and make sure the files themselves
are not set to read only for the file properties.
-Sue
On 1 Dec 2004 13:53:26 -0800, divyeshkhatri@.hotmail.com
(Divyesh) wrote:

>Hi,
>I detached a database from Server1 and took MDF file to Server2.
>After that I re-attached the database on Server1.
>When I tried to attached database using EM, sp_attach_db and also
>sp_Attach_single_file, i was getting error msg 1813.
>So I detached database again from Server1 and used the LDF on Server2.
> It recognizes and LDF file and attaches the database. However, the
>database is in read-only mode. I can go to properties and uncheck
>"Read-Only" but when I try to save the changes it gives me Error 5105
>- Deactivation Error...
>I don't have access to new MDF file after I detached it again.
>Any help will be greatly appreciated.
>Divyesh

After attaching database it is in Read only mode

Hi,
I detached a database from Server1 and took MDF file to Server2.
After that I re-attached the database on Server1.
When I tried to attached database using EM, sp_attach_db and also
sp_Attach_single_file, i was getting error msg 1813.
So I detached database again from Server1 and used the LDF on Server2.
It recognizes and LDF file and attaches the database. However, the
database is in read-only mode. I can go to properties and uncheck
"Read-Only" but when I try to save the changes it gives me Error 5105
- Deactivation Error...
I don't have access to new MDF file after I detached it again.
Any help will be greatly appreciated.
DivyeshCheck the file properties for the mdf and ldf at the
operating system level and make sure the files themselves
are not set to read only for the file properties.
-Sue
On 1 Dec 2004 13:53:26 -0800, divyeshkhatri@.hotmail.com
(Divyesh) wrote:

>Hi,
>I detached a database from Server1 and took MDF file to Server2.
>After that I re-attached the database on Server1.
>When I tried to attached database using EM, sp_attach_db and also
>sp_Attach_single_file, i was getting error msg 1813.
>So I detached database again from Server1 and used the LDF on Server2.
> It recognizes and LDF file and attaches the database. However, the
>database is in read-only mode. I can go to properties and uncheck
>"Read-Only" but when I try to save the changes it gives me Error 5105
>- Deactivation Error...
>I don't have access to new MDF file after I detached it again.
>Any help will be greatly appreciated.
>Divyesh

After attaching database it is in Read only mode

Hi,
I detached a database from Server1 and took MDF file to Server2.
After that I re-attached the database on Server1.
When I tried to attached database using EM, sp_attach_db and also
sp_Attach_single_file, i was getting error msg 1813.
So I detached database again from Server1 and used the LDF on Server2.
It recognizes and LDF file and attaches the database. However, the
database is in read-only mode. I can go to properties and uncheck
"Read-Only" but when I try to save the changes it gives me Error 5105
- Deactivation Error...
I don't have access to new MDF file after I detached it again.
Any help will be greatly appreciated.
DivyeshCheck the file properties for the mdf and ldf at the
operating system level and make sure the files themselves
are not set to read only for the file properties.
-Sue
On 1 Dec 2004 13:53:26 -0800, divyeshkhatri@.hotmail.com
(Divyesh) wrote:
>Hi,
>I detached a database from Server1 and took MDF file to Server2.
>After that I re-attached the database on Server1.
>When I tried to attached database using EM, sp_attach_db and also
>sp_Attach_single_file, i was getting error msg 1813.
>So I detached database again from Server1 and used the LDF on Server2.
> It recognizes and LDF file and attaches the database. However, the
>database is in read-only mode. I can go to properties and uncheck
>"Read-Only" but when I try to save the changes it gives me Error 5105
>- Deactivation Error...
>I don't have access to new MDF file after I detached it again.
>Any help will be greatly appreciated.
>Divyesh