Showing posts with label cutting. Show all posts
Showing posts with label cutting. Show all posts

Friday, February 17, 2012

Cutting to a certain word

Hi there, i need to know how to cut a string to the nearest word. For example, i've got an article and i need to extract just a part of the beginning, i could use LEFT([content], 250) but there is little chance this will cut on a word. Therefore i need to know if there is a function that will cut to the nearest word in T-SQL or i will simply put a summary field in the database. (I prefer to generate the summary on the fly if possible)

You could use CHARINDEX.

SELECT LEFT(column, CHARINDEX(' ', column) ) FROM yourTable

|||

I just looked up what you said and this doesn't make sense...

I didn't even try but i know what this will result in... Returns the first word of a column...

But i guess if i provide a startAT value(param 3) to charindex i can start the search at 250 characters and it will cut accordingly...

|||

Yes, this will always give you a full word:

Declare @.tvarchar(100), @.startatintSET @.t ='this is a good test and a long sentence to test end of word'SET @.startat = 33SELECT @.t,left(@.t,@.startat + CHARINDEX(' ',right(@.t,len(@.t) - @.startat)))

Tuesday, February 14, 2012

Cutting out the sentence

dear all,
I need do constantly queries against a remote server:
select * from [xxx.xx.xxx.xx].db.owner.table
I would like to avoid put every time the IP between brackets
Thanks a lot,Try using "Client Network Utility" to create an alias.
AMB
"Enric" wrote:

> dear all,
> I need do constantly queries against a remote server:
> select * from [xxx.xx.xxx.xx].db.owner.table
> I would like to avoid put every time the IP between brackets
> Thanks a lot,
>

Cutting and Pasting from PDF output

Hi

We have some reports that are published as PDF files. The layout of the report is fairly free, using lists within lists.

Some of our users want to cut and paste some of the data. When they do so, the order and layout of the fields does not resemble the layout of the report. Any way around this.

Note that when the report is published as mhtml or excel, cutting and pasting from these formats is much better.

thanks

Peter

No, there is no way around that. If the user is going to reuse the figues in another format then it is best to stick to Excel output. If only specific users need this then you could set them up with an subscription that has Excel output, and leave everyone else with the PDF version.

Cutting & Pasting Tasks

Has anyone else experienced serious pain when cutting and pasting tasks between packages? In that, the default way SSIS lays out the tasks is absolutely atrocious (things on top of each other, way to far apart from each other, boxes sized to small, etc.) Is there some trickery I need to do to get it to retain the layout and formatting when I paste?
Its rubbish isn't it? I also hate the way auto-format can sometimes produce a worse layout than what you started with and there's no way of CTRL-Z-ing it.

Sorry, that's not very constructive is it? I've fed this back to MS and am hoping its on their list of things for Vnext.

For the time being Greg, I think you're stuck with it.

-Jamie

P.S. CTRL-Z is something I'd like to see across the board but I dare say you need Visual Studio hooks in order to do this - so its a VS problem!