Friday, March 30, 2012

I hate this

I'm migrating a fu... dts to SSIS. That's fine. I've got a derived column task for stuff as cdbl(DTSSource("Col014") /100).

But how the source plain file have a lot of columns suddenly I find this:

Function Main()


Fecha=Right(DTSSource("Col014"),2) & "-" & Mid(DTSSource("Col014"),5,2) & "-" & left(DTSSource("Col014"),4)
If IsDate(Fecha) then
DTSDestination("FechaOp") =Fecha
Else
DTSDestination("FechaOp")=null
End IF
Main = DTSTransformStat_OK
End Function

So that 'Derived Column' is useless at all for to encompass this rule unless to anyone be able to tell me how to implement that conditional snippet inside...

I'll be to use a Script Component Task only for that dammed column when the rest ones already defined.

!!!!

Do y'know hare and tortoise tale? So here is the same but in reverse order. jezz|||

There is a conditional operator in the SSIS expression language. It will do what you need to do.

Here's the BOL topic on it: http://msdn2.microsoft.com/en-us/library/ms141680(SQL.90).aspx

-Jamie

|||Thanks Jamie. hurries doesn't provide us good advices..|||

OK.

I've taken as example this and then I've converted into this line:

'Fecha = Right(DTSSource("Col014"), 2) & "-" & Mid(DTSSource("Col014"), 5, 2) & "-" & Left (DTSSource("Col014"), 4)
'If IsDate(Fecha) Then
' = Fecha
'Else
'DTSDestination("FechaOp") = null
'End If

Isdate(Right([Column 13],2) & "/" & Mid([Column13],5,2) & "/" & Left([Column13],4)) ? [Column13] : Nothing

But fails:

Error at CargaModelo187 [Derived Column [10345]]: Attempt to find the input column named "Column13" failed with error code 0xC0010009. The input column specified was not found in the input column collection.

Error at CargaModelo187 [Derived Column [10345]]: Attempt to parse the expression "Isdate(Right([Column 13],2) & "/" & Mid([Column13],5,2) & "/" & Left([Column13],4)) ? [Column13] : Nothing" failed and returned error code 0xC00470A2. The expression cannot be parsed. It might contain invalid elements or it might not be well-formed. There may also be an out-of-memory error.

Error at CargaModelo187 [Derived Column [10345]]: Cannot parse the expression "Isdate(Right([Column 13],2) & "/" & Mid([Column13],5,2) & "/" & Left([Column13],4)) ? [Column13] : Nothing". The expression was not valid, or there is an out-of-memory error.

Error at CargaModelo187 [Derived Column [10345]]: The expression "Isdate(Right([Column 13],2) & "/" & M

id([Column13],5,2) & "/" & Left([Column13],4)) ? [Column13] : Nothing" on "input column "Column 13" (11693)" is not valid.

Error at CargaModelo187 [Derived Column [10345]]: Failed to set property "Expression" on "input column "Column 13" (11693)".


Let me know which is the next step or what guidelines must I follow on this issue.

|||

In your expression you refer to "Column13" but the SSIS error message shows that the column in the data flow is in fact named "Column 13"

Donald

|||

A couple other things:

The expression language does not have an IsDate() function. What exactly are you testing for with that? Itstill might be possible, depending what you are looking for...

There is also Left() function -- you should use Substring() for that.

Instead of "Nothing", you need to use the NULL() functions, which are strictly typed.

|||

Mark Durley wrote:

There is also Left() function -- you should use Substring() for that.

Another alternative to the lack of a LEFT() function is RIGHT(REVERSE())

-Jamie

|||Thanks a lot to all of you|||

Well, this follow failing:

Right([Column 13],2) & "/" & SubString([Column 13],5,2) & "/" & SubString([Column 13],1,4) ? [Column 13] : Nothing

Column 13 on the first row own this value:

20050214

TITLE: Microsoft Visual Studio

Error at CargaModelo187 [Derived Column [10345]]: Attempt to find the input column named "Nothing" failed with error code 0xC0010009. The input column specified was not found in the input column collection.

Error at CargaModelo187 [Derived Column [10345]]: Attempt to parse the expression "Right([Column 13],2) & "/" & SubString([Column 13],5,2) & "/" & SubString([Column 13],1,4) ? [Column 13] : Nothing" failed and returned error code 0xC00470A2. The expression cannot be parsed. It might contain invalid elements or it might not be well-formed. There may also be an out-of-memory error.

Error at CargaModelo187 [Derived Column [10345]]: Cannot parse the expression "Right([Column 13],2) & "/" & SubString([Column 13],5,2) & "/" & SubString([Column 13],1,4) ? [Column 13] : Nothing". The expression was not valid, or there is an out-of-memory error.

Error at CargaModelo187 [Derived Column [10345]]: The expression "Right([Column 13],2) & "/" & SubString([Column 13],5,2) & "/" & SubString([Column 13],1,4) ? [Column 13] : Nothing" on "input column "Column 13" (12091)" is not valid.

Error at CargaModelo187 [Derived Column [10345]]: Failed to set property "Expression" on "input column "Column 13" (12091)".


ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC0204006 (Microsoft.SqlServer.DTSPipelineWrap)


BUTTONS:

OK

|||

I was wrong although this new line-version fails too...

[Derived Column 1] == Right([Column 13],2) & "/" & SubString([Column 13],5,2) & "/" & SubString([Column 13],1,4)

Thanks in advance,

|||

It's already solved.

Instead of & you must use + and drop '[Derived Column 1] =='

RIGHT([Column 13],2) + "/" + SUBSTRING([Column 13],5,2) + "/" + SUBSTRING([Column 13],1,4)

IsDate function is not necessary because of I saw concretly in that file that all of them have the same structure yyyymmdd

|||In any case what function is intented do the same that ISDATE?|||

There is no function that can do IsDate. As Mark suggested there may be possibilities using other functions - checking that a string has certain characters and that substrings, can be cast to valid integers - but that expression would likely be rather complex.

Script component does all this really nicely, of course.

Donald

I hate the maintenance CleanUp task :=)


I have a backup database task that runs at 4 am.

I added a maintenance CleanUp task pointing to the right folder
I checked the include first-level subfolder box, and delete files based on the age of the file at task run time

I specified "delete files older than " 1 day


But the cleanup task is not working, I have to manually go a delete the files myself.

Am I missing something? should I run the maintenance task first?
and then the backup task?

make sure that your system is upgraded to SP2 and also you have installed SSIS.

Refer these links for more info

http://support.microsoft.com/default.aspx/kb/933508

http://blogs.msdn.com/sqlrem/

Madhu

|||Also you make sure to apply SP2 for the client tools as they also willbe updated with bug fixes.|||

I'm having this problem, too. I have a Maintenance Cleanup Task to remove old maintenance plan text reports that seems to "refuse" to delete the old files. The system I'm trying this on has had the GDR 3054 update applied to all components, including the clients. I've even recreated the entire maintenance plan new, and it still doesn't work. The interesting thing is that my Cleanup Task that removes old backup files is working correctly!

|||

This has been confirmed as a bug

See http://support.microsoft.com/kb/936305

Maybe by SQL Server 2008 SP2 the Maintenace Plans may have got back to being usable and reliable

Regards

Nadreck

|||

This is not a solution or an answer to what Armando is asking.

What he says (and what Nadreck and I am experiencing) is the complete refusal of the maintenance cleanup task to delete the files...at *any* time.

Your links, as well as the other replies to this topic refer to a bug where existing maintenance tasks, created before SP2 being applied, are mis-timed after SP2 is applied. In my situation, the maintenance plan was created after SP2 was applied.

By not being able to automate the cleanup of the older backup files, it makes the entire backup task (as a scheduled process) nearly worthless.

Jeff

|||

Ok, after doing a lot of searching around the net I found out a workaround (sort of).

To get the maintenance plan to actually delete files in the first level subfolders, change the extension for it to delete (in the maintenance cleanup task dialoge) to *.*

I know this isn't ideal if you store files other than your backups in some of these folders (or rename old backups a different extension to always keep them around), but it did work for me. You just need to be careful what is put in those folders.

Jeff

I hate the maintenance CleanUp task :=)


I have a backup database task that runs at 4 am.

I added a maintenance CleanUp task pointing to the right folder
I checked the include first-level subfolder box, and delete files based on the age of the file at task run time

I specified "delete files older than " 1 day


But the cleanup task is not working, I have to manually go a delete the files myself.

Am I missing something? should I run the maintenance task first?
and then the backup task?

make sure that your system is upgraded to SP2 and also you have installed SSIS.

Refer these links for more info

http://support.microsoft.com/default.aspx/kb/933508

http://blogs.msdn.com/sqlrem/

Madhu

|||Also you make sure to apply SP2 for the client tools as they also willbe updated with bug fixes.|||

I'm having this problem, too. I have a Maintenance Cleanup Task to remove old maintenance plan text reports that seems to "refuse" to delete the old files. The system I'm trying this on has had the GDR 3054 update applied to all components, including the clients. I've even recreated the entire maintenance plan new, and it still doesn't work. The interesting thing is that my Cleanup Task that removes old backup files is working correctly!

|||

This has been confirmed as a bug

See http://support.microsoft.com/kb/936305

Maybe by SQL Server 2008 SP2 the Maintenace Plans may have got back to being usable and reliable

Regards

Nadreck

|||

This is not a solution or an answer to what Armando is asking.

What he says (and what Nadreck and I am experiencing) is the complete refusal of the maintenance cleanup task to delete the files...at *any* time.

Your links, as well as the other replies to this topic refer to a bug where existing maintenance tasks, created before SP2 being applied, are mis-timed after SP2 is applied. In my situation, the maintenance plan was created after SP2 was applied.

By not being able to automate the cleanup of the older backup files, it makes the entire backup task (as a scheduled process) nearly worthless.

Jeff

|||

Ok, after doing a lot of searching around the net I found out a workaround (sort of).

To get the maintenance plan to actually delete files in the first level subfolders, change the extension for it to delete (in the maintenance cleanup task dialoge) to *.*

I know this isn't ideal if you store files other than your backups in some of these folders (or rename old backups a different extension to always keep them around), but it did work for me. You just need to be careful what is put in those folders.

Jeff

sql

I HATE Management Studio, how about you?

I really dislike the Management Studio in SQL Server 2005. Having tabs
is nice but everything else about it really sucks. What don't you like
about it? Maybe someone at M$ will read this and actually make some
changes -- for the better (sigh, I wish but I won't hold my breath).

For all the $$$$$ Microsoft spends you think they could do better. It
seems every 'new and improved' version has a worse UI than the one
before. I can hardly stand to use Visio any more. Word has so many
damned annoying features that I spend most of time trying to figure out
how to turn them off rather than getting real work down.

Living in the shadow of the evil empire I run into M$ dweebs all the
time. One of the biggest problems M$ has is arrogance. They 'know
better' than the whole user community.

Microsoft get a clue. Trying listening once in a while.Hi JJ,

It would help if you actually list things you dislike instead of just
ranting it doesn't do very much for your credibility, you simply come across
as probably one of those anti-MS whatever they do people - aka the linux
fanbregade.

I agree there are aspects of Management Studio that I dislike but those are
being addressed by Microsoft and believe those guys do listen to what WE as
the people who use the tools and product need.

So, lets try again - please list aspects of MAnagement Studio you dislike.

--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials

"jj" <jj@.no_spam.netwrote in message news:e8tt3n$fnl$1@.lists.fhcrc.org...

Quote:

Originally Posted by

>I really dislike the Management Studio in SQL Server 2005. Having tabs is
>nice but everything else about it really sucks. What don't you like about
>it? Maybe someone at M$ will read this and actually make some changes --
>for the better (sigh, I wish but I won't hold my breath).
>
For all the $$$$$ Microsoft spends you think they could do better. It
seems every 'new and improved' version has a worse UI than the one before.
I can hardly stand to use Visio any more. Word has so many damned annoying
features that I spend most of time trying to figure out how to turn them
off rather than getting real work down.
>
Living in the shadow of the evil empire I run into M$ dweebs all the time.
One of the biggest problems M$ has is arrogance. They 'know better' than
the whole user community.
>
Microsoft get a clue. Trying listening once in a while.
>
>
>

|||jj (jj@.no_spam.net) writes:

Quote:

Originally Posted by

I really dislike the Management Studio in SQL Server 2005. Having tabs
is nice but everything else about it really sucks. What don't you like
about it? Maybe someone at M$ will read this and actually make some
changes -- for the better (sigh, I wish but I won't hold my breath).
>
For all the $$$$$ Microsoft spends you think they could do better. It
seems every 'new and improved' version has a worse UI than the one
before. I can hardly stand to use Visio any more. Word has so many
damned annoying features that I spend most of time trying to figure out
how to turn them off rather than getting real work down.
>
Living in the shadow of the evil empire I run into M$ dweebs all the
time. One of the biggest problems M$ has is arrogance. They 'know
better' than the whole user community.
>
Microsoft get a clue. Trying listening once in a while.


Management Studio is definitely not the part of SQL 2005 that I am most
impressed by. There are some nice improvements from Query Analyzer, but
there are too many features that have been dropped from the old tools.

If you go http://connect.microsoft.com/feedba...aspx?SiteID=68
you can submit suggestions for improvements. Such suggestions would
have to be a little more nuanced than "get a clue" to be meaningful. :-)
I would also encourage you to search among the existing bugs. There
are already plenty of entries for Mgmt Studio filed. And fact is,
MS have been listening. It looks that some of the issues will be
mended by SP2 already.

--
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|||I like Management Studio. I've replaced the old Query Analyzer and
Enterprise Manager with this one. I used it for both SQL 2005 and SQL
2000; they are fine. Except one thing though; if I edit a table, the
default column has to be filled in; otherwise it will be filled with
NULL, eventhough the table is defined as NOT NULL DEFAULT something;

regards,
Radzi.

jj wrote:

Quote:

Originally Posted by

I really dislike the Management Studio in SQL Server 2005. Having tabs
is nice but everything else about it really sucks. What don't you like
about it? Maybe someone at M$ will read this and actually make some
changes -- for the better (sigh, I wish but I won't hold my breath).
>
For all the $$$$$ Microsoft spends you think they could do better. It
seems every 'new and improved' version has a worse UI than the one
before. I can hardly stand to use Visio any more. Word has so many
damned annoying features that I spend most of time trying to figure out
how to turn them off rather than getting real work down.
>
Living in the shadow of the evil empire I run into M$ dweebs all the
time. One of the biggest problems M$ has is arrogance. They 'know
better' than the whole user community.
>
Microsoft get a clue. Trying listening once in a while.

I has problem to run EXEC in MSDE 8.00.760

I used the MSDE 8.00.760. I try to run EXEC from the command line, but it is
not recognized as a command ... I can run the osql in the command line. Does
someone knows what is the problem?
Thanks in advance.
hi,
LittlePlane wrote:
> I used the MSDE 8.00.760. I try to run EXEC from the command line,
> but it is not recognized as a command ... I can run the osql in the
> command line. Does someone knows what is the problem?
>
AFAIK, "EXEC" only is a Transact-SQL keyword that is of course not
recognized by the underlying OS but only from applications that can send it
to a SQL Server instance...
is it a particular application?
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Hi, thanks, I am new with SQL. I know how to do it now.
"Andrea Montanari" wrote:

> hi,
> LittlePlane wrote:
> AFAIK, "EXEC" only is a Transact-SQL keyword that is of course not
> recognized by the underlying OS but only from applications that can send it
> to a SQL Server instance...
> is it a particular application?
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
>

I had set my Windows service's Startup Type as Automatic but it is not starting up Automaticall

Hello,

I had created a windows service using C#. I set its Startup Type as Automatic but it is not getting started automatically when my System Starts.

I checked the Event Viewer and it has the following message related to the Windows Service :

Service cannot be started. The service process could not connect to the service controller.

What Does This mean am I missing something.

|||I think the C# forums might be more useful for answering this particular question unless you have a SQL Server Question related to this?|||

Thanks John Gordon,

I had posted it again to the C# Section. By Mistake I had posted it in this section.

Thanks and Regards

Sunil Dutt

i had a problem in inserting data in a table with foriegn key

i hav following 2 tables n i am able to insert data into the second table having a foriegn key

create table Customer_Details(
Customer_ID integer primary key,
Customer_First_Name varchar(75),
Customer_Last_Name varchar(75),
Address varchar(100))

create table Account_Details(
Account_No integer primary key,
Customer_ID integer foreign key references
Customer_Details(Customer_ID),
Debit float,Credit float,Balance float )hi
can u please put ur insert and also when a column is PK it cant be null. when u do not put any think then that means it also can be a null value but pk can't be null at all.