Showing posts with label line. Show all posts
Showing posts with label line. Show all posts

Sunday, March 11, 2012

Bug in the SSIS?

When viewing the flat file through the viewer , certain rows showing up as a small black square where there is a line feed and these rows are getting concatenated and being counted as one row.

Anybody knows why this is happening?

Thanks

Karthika

Make sure you have the correct row delimiter chosen. Unix files, for instance, typically only have a LF as the row delimiter. Windows files typically have a CR/LF as the row delimiter. Try choosing different values.

Thursday, March 8, 2012

bug in exception handling (begin try... begin catch...)?

begin try
-- insert ...
select * from nonexistingtableorfunction;
end try
begin catch
print 'catch me if you can'; -- line will not be printed
end catch;
begin try
exec doNotExitingprocedure;
end try
begin catch
print 'this line is printed :-)';
end catch;
Why this different behaviour?
If you wrap 1. example in anthother proc with exception handling
(begin try... begin catch...),
the wrapping proc will catch the error.
The above behaviour is not what I would expect compared with other
languages such as Java, C#, PL/SQL...
Greetings
B. D. JensenI think this is one of numerous reasons I have noticed a distinct lack of
uptake on the new TRY mechanism. Until it really does catch errors I won't
use it, nor advise my clients to.
"B D Jensen" <bjorn.d.jensen@.gmail.com> wrote in message
news:1191585968.457460.319780@.o80g2000hse.googlegroups.com...
> begin try
> -- insert ...
> select * from nonexistingtableorfunction;
> end try
> begin catch
> print 'catch me if you can'; -- line will not be printed
> end catch;
>
> begin try
> exec doNotExitingprocedure;
> end try
> begin catch
> print 'this line is printed :-)';
> end catch;
>
> Why this different behaviour?
> If you wrap 1. example in anthother proc with exception handling
> (begin try... begin catch...),
> the wrapping proc will catch the error.
>
> The above behaviour is not what I would expect compared with other
> languages such as Java, C#, PL/SQL...
> Greetings
> B. D. Jensen
>|||B D,
I believe that what is happening here is that in your first example, the
batch is failing with a syntax error:
Msg 208, Level 16, State 1, Line 1
Invalid object name 'nonexistingtableorfunction'.
This means that it failed at compile time and never executed. Since it
never executed, the try / catch had no chance to do anything.
In your second example, the called routine got the same error as above and
never executed.
However, in this case the calling routine is running just fine and the try /
catch sees that the called routine got an error.
At least, that is what it looks like to me.
RLF
"B D Jensen" <bjorn.d.jensen@.gmail.com> wrote in message
news:1191585968.457460.319780@.o80g2000hse.googlegroups.com...
> begin try
> -- insert ...
> select * from nonexistingtableorfunction;
> end try
> begin catch
> print 'catch me if you can'; -- line will not be printed
> end catch;
>
> begin try
> exec doNotExitingprocedure;
> end try
> begin catch
> print 'this line is printed :-)';
> end catch;
>
> Why this different behaviour?
> If you wrap 1. example in anthother proc with exception handling
> (begin try... begin catch...),
> the wrapping proc will catch the error.
>
> The above behaviour is not what I would expect compared with other
> languages such as Java, C#, PL/SQL...
> Greetings
> B. D. Jensen
>|||Take a look at the BOL here:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/3a5711f5-4f6d-49e8-b1eb-53645181bc40.htm
In your first case, the missing object caused the batch to terminate, and
TRY/CATCH won't help if the batch is terminated. In your second case, the
batch is not terminated and TRY/CATCH works.
Yuu can place a PRINT statement at the end of each batch to see whether the
batch is terminated before it reaches the end.
Linchi
"B D Jensen" wrote:
> begin try
> -- insert ...
> select * from nonexistingtableorfunction;
> end try
> begin catch
> print 'catch me if you can'; -- line will not be printed
> end catch;
>
> begin try
> exec doNotExitingprocedure;
> end try
> begin catch
> print 'this line is printed :-)';
> end catch;
>
> Why this different behaviour?
> If you wrap 1. example in anthother proc with exception handling
> (begin try... begin catch...),
> the wrapping proc will catch the error.
>
> The above behaviour is not what I would expect compared with other
> languages such as Java, C#, PL/SQL...
> Greetings
> B. D. Jensen
>

Wednesday, March 7, 2012

Bug in a Stored Procedure [sys].[sp_dbmmonitorupdate]

Hi guys,

I found an annoying bug in the system sproc [sys].[sp_dbmmonitorupdate]. There in line
308 : set @.database_name = db_name( @.database_id )
it should basically state
set @.database_name = QUOTENAME(db_name( @.database_id ))
because if a database has a space or point in the name this causes the sproc to fail with the error:
"Incorrect syntax near '.'."

has someone any idea how to change this sys sproc?
or an idea for a workaround?

thanks...
darkook, let me ask the other way around:

i cannot change the sys sproc, can I? in that case I need a sproc which is deployed in the msdb (there is a check in the sp_dbmmonitorupdate which says it must be executed in the context of the msdb). how ever, I understand that no sprocs should be deployed in msdb. any ideas how to solve this problem?

thx!

Tuesday, February 14, 2012

Breaking out data from a text field type

In my database there is a text field type that is used to enter street
address. This address could be a few lines long, each line with a
carriage return at the end.
Is there a way to search for these carriage returns and break out what
is in each line seperately?

Thanks.
Mike[posted and mailed, please reply in news]

Mike (mrea@.ohiotravelbag.com) writes:
> In my database there is a text field type that is used to enter street
> address. This address could be a few lines long, each line with a
> carriage return at the end.
> Is there a way to search for these carriage returns and break out what
> is in each line seperately?

Is that really the datatype text? That seems a bit over kill for a street
address. They would very rarely be over 8000 bytes. Or even 4000 if you
are using varchar.

The functions to use are substring and charindex. And char(13) for the
CRs. Or char(13) + char(10) if it's actually CR + LF. charindex does not
handle text beyond the varchar limit, but I don't think this would be
an issue.

You could also do:

SELECT @.adr = adr FROM tbl WHERE ..
SELECT str
FROM iter_charlist_to_table(@.adr, char(13))
ORDER BY listpos

You find this function on
http://www.sommarskog.se/arrays-in-...list-of-strings

Note that if you need to use char(13) + char(10) as delimiter, you
will have to change the function. (And not only the length of delimiter.)

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Breaking data into 1500 byte chunks

Hi,

I have a text file (5 MB). It appears as a single line in a text editor. But actually it has records of 1500 byte length each.

I want to strip it down to 1500 byte records. So 1500*3500 = 5 MB (approx). The record size is always 1500 bytes.

Does anyone have a script that I can run on this file to achieve this break.

ThanksYou have 1 row of 5,000,000 bytes?

There is no CR LF chars?

Are there any delimiters?|||No there are no delimiters. All I know is they are 1500 byte records. Each record has fixed column length. But all on a single line.|||Where did the file come from?

An lrecl of 5mb?

Tell them to fix the file...

I guess you would need to write a pearl script or something...

Break line inside print statement

Hello,
I need to break one line that im printing inside one script. The line is very large and i don=B4t know how to do it.
Best RegardsNot sure exactly what you mean, but perhaps below?
SELECT 'Hello' + CHAR(13) + CHAR(10) + 'there'
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message news:9c5101c43422$e3448ef0$a101280a@.phx.gbl...
Hello,
I need to break one line that im printing inside one
script. The line is very large and i don´t know how to do
it.
Best Regards|||I'm not sure I understand correctly but
select "Hello" + char(13) + char(10) + "World"
will come out as
Hello
World
rgds
Paul
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message
news:9c5101c43422$e3448ef0$a101280a@.phx.gbl...
Hello,
I need to break one line that im printing inside one
script. The line is very large and i don´t know how to do
it.
Best Regards

Break line inside print statement

Hello,
I need to break one line that im printing inside one=20
script. The line is very large and i don=B4t know how to do=20
it.
Best Regards
Not sure exactly what you mean, but perhaps below?
SELECT 'Hello' + CHAR(13) + CHAR(10) + 'there'
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message news:9c5101c43422$e3448ef0$a101280a@.phx.gbl...
Hello,
I need to break one line that im printing inside one
script. The line is very large and i dont know how to do
it.
Best Regards
|||I'm not sure I understand correctly but
select "Hello" + char(13) + char(10) + "World"
will come out as
Hello
World
rgds
Paul
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message
news:9c5101c43422$e3448ef0$a101280a@.phx.gbl...
Hello,
I need to break one line that im printing inside one
script. The line is very large and i dont know how to do
it.
Best Regards

Break line inside print statement

Hello,
I need to break one line that im printing inside one=20
script. The line is very large and i don=B4t know how to do=20
it.
Best RegardsNot sure exactly what you mean, but perhaps below?
SELECT 'Hello' + CHAR(13) + CHAR(10) + 'there'
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message news:9c5101c4
3422$e3448ef0$a101280a@.phx.gbl...
Hello,
I need to break one line that im printing inside one
script. The line is very large and i dont know how to do
it.
Best Regards|||I'm not sure I understand correctly but
select "Hello" + char(13) + char(10) + "World"
will come out as
Hello
World
rgds
Paul
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message
news:9c5101c43422$e3448ef0$a101280a@.phx.gbl...
Hello,
I need to break one line that im printing inside one
script. The line is very large and i dont know how to do
it.
Best Regards

Friday, February 10, 2012

Border missing when exported to PDF

When exporting to PDF some of the columns have the border line missing
although the border line is visible when exported as HTML or web
archiveI have the same issue. Cell borders on tables (0.5 pt gray) randomly
disappear in the PDF rendering, but look perfect in HTML4.0. Some are there,
some are not. I tried increasing the resolution of the PDF to no avail.
Is this a bug with the PDF rendering? Is there a workaround? This is a big
issue for us.
-David
"Sush" wrote:
> When exporting to PDF some of the columns have the border line missing
> although the border line is visible when exported as HTML or web
> archive
>|||I did a search on the forums on the Adobe site and found a related issue.
Apparently several people have reported Acrobat 6.x has issues with borders
on text boxes and other thin horizontal lines. It was unclear if the issue
was the in the PDF format itself (distiller problem) or if the rendering was
messed up in the Reader.
Has anyone tried looking at this with Reader 5.x?
Microsoft, can you confirm that this is an issue with Acrobat Reader 6.x
rather than the PDF rendering extension for Reporting services?
Much thanks, David
"David Swanson" wrote:
> I have the same issue. Cell borders on tables (0.5 pt gray) randomly
> disappear in the PDF rendering, but look perfect in HTML4.0. Some are there,
> some are not. I tried increasing the resolution of the PDF to no avail.
> Is this a bug with the PDF rendering? Is there a workaround? This is a big
> issue for us.
> -David
> "Sush" wrote:
> > When exporting to PDF some of the columns have the border line missing
> > although the border line is visible when exported as HTML or web
> > archive
> >

border line not displaying properly

hi,

when i preview a report in report manager, i am not able to view borderline (right side), but when i take a print out, it is printing properly all the border lines.

i am uisng a subreport and placing it in a table.when subreport width is smaller than the cell it is placed in, the border line on right side is not displaying but in print it is displaying

with regards

suresh babu

I wasn't able to duplicate this behavior. I created a 2" wide subreport with a simple textbox on it. I then created a parent report with a simple 1 row table and placed the subreport in the middle, 3" wide cell. The right-side borders showed up in Report Manager regardless of whether I placed the borders on the table cell or on the subreport body.

Would you mind opening an issue via the below url and attaching your reports so I can take a look?

http://lab.msdn.microsoft.com/ProductFeedback/Default.aspx

Thank you.

|||

I have a similar problem, although it doesn't involve a SubReport.

I have a table with about 8 columns. For 1 row in the table, I want several of the rows to be underlined - which was handled by setting the border property of the TextBoxes. The data was underlined until I entered formulas/expressions to 3 of the Text Boxes. Now, the boxes with expressions do not show the underlines when the report is displayed, but the underlines do show up on the printed report. Text boxes without expressions are fine.

|||

If you would send a sample report (preferably one that goes against one of our sample databases) to the above URL, we'll take a look.

Thanks, Donovan.

|||

Sorry, can't provide a sample.

I will provide a little more info. I tried removing the expressions from the boxes that did not have a border - the border did not come back.

In one row, I have 8 columns. I set the bottom border to 1Pt. Solid for 7 of the text boxes. The border displayed for 4 of the 7 text boxes.

I resolved my problem by setting the top border of the row below to 1 Pt. Solid. I did this for all 7 columns. The report now displays and prints fine.

I believe, but can't prove, that the top border is displaying for 3 columns and the bottom border is displaying for the other 4 columns.

I am pretty sure that the bottom border originally displayed for all 7 columns when I began the report design. I think the border disappeared when I added the expressions - but I can't say that this is absolutely correct.

border line not displaying properly

hi,

when i preview a report in report manager, i am not able to view borderline (right side), but when i take a print out, it is printing properly all the border lines.

i am uisng a subreport and placing it in a table.when subreport width is smaller than the cell it is placed in, the border line on right side is not displaying but in print it is displaying

with regards

suresh babu

I wasn't able to duplicate this behavior. I created a 2" wide subreport with a simple textbox on it. I then created a parent report with a simple 1 row table and placed the subreport in the middle, 3" wide cell. The right-side borders showed up in Report Manager regardless of whether I placed the borders on the table cell or on the subreport body.

Would you mind opening an issue via the below url and attaching your reports so I can take a look?

http://lab.msdn.microsoft.com/ProductFeedback/Default.aspx

Thank you.

|||

I have a similar problem, although it doesn't involve a SubReport.

I have a table with about 8 columns. For 1 row in the table, I want several of the rows to be underlined - which was handled by setting the border property of the TextBoxes. The data was underlined until I entered formulas/expressions to 3 of the Text Boxes. Now, the boxes with expressions do not show the underlines when the report is displayed, but the underlines do show up on the printed report. Text boxes without expressions are fine.

|||

If you would send a sample report (preferably one that goes against one of our sample databases) to the above URL, we'll take a look.

Thanks, Donovan.

|||

Sorry, can't provide a sample.

I will provide a little more info. I tried removing the expressions from the boxes that did not have a border - the border did not come back.

In one row, I have 8 columns. I set the bottom border to 1Pt. Solid for 7 of the text boxes. The border displayed for 4 of the 7 text boxes.

I resolved my problem by setting the top border of the row below to 1 Pt. Solid. I did this for all 7 columns. The report now displays and prints fine.

I believe, but can't prove, that the top border is displaying for 3 columns and the bottom border is displaying for the other 4 columns.

I am pretty sure that the bottom border originally displayed for all 7 columns when I began the report design. I think the border disappeared when I added the expressions - but I can't say that this is absolutely correct.