Showing posts with label exact. Show all posts
Showing posts with label exact. Show all posts

Wednesday, March 28, 2012

Finding Containers and Variables from Script task?

Hi,
* Here's my use case:
I have 20 odd event handlers in various containers that all do the exact same thing. Even though they're simple (a Script and an Execute SQL Task), its a right pain to copy them & keep them synced. I could probably create a custom task for the content of each handler, but I would still need to copy & configure it across 20 event handlers.
My (maybe impossible) idea to handle this was to:
Create a single event handler at the global scope. When invoked, use System::SourceID or System::SourceName to either
- GetContainer(SourceID).Variables("myVar") (had there been such a function call)
- Traverse the package object model to find the container, i.e:
Package.Executables(SourceName).Variables("myVar")
Is it true that there is no practical way of doing this?

* "Variables on the container ... are visible to the event handler that handles the event on that container"
As I understand it, this is only true when attaching an event handler to the specific container generating the event. If a container has no event handler, the event will propagate up through the hierarchy all the way to the package scope if needed. As soon as the event has propagated even once, the invoked event handler no longer has access to the local variables of the source container. Is this a reasonably correct description?
Event handlers and propagation would be _strikingly_ more useful if the handler had access to the source container environment that created the event, or am I missing something obvious?

* As a second possibility, can I create a _custom task_ (as opposed to a script) that _can_ traverse the object model of a package created in the designer (i.e. I'm not creating the whole package in my own code)?

If you lasted this long, thanks!-)
KI think I answered this on the NG, but the variables on the parent of the eventhandler that raised the event are visible to the event handler.
You can also create a package that handle the events and uses parent package configurations to pass in the values for the events. Then use an execute package task in all your event handlers that references that shared package.
Tasks cannot traverse the object model. They are prohibited and variables will refuse to hold a reference to IS object model objects with an error.|||Although I did implement using those 20 event handlers, I've now ditched that in favour of parsing the needed info out of sysdtslog90, which does away with the need for all those event handlers. Always a good feeling when stripping out half the 'code' but none of the functionalityBig Smile
Very useful to understand how & when to use the event handlers though, thanks!
K

Friday, March 23, 2012

Find value match in SQL table

Find value match in SQL table

Is there any application that can compare two tables and find the similarities (there is no high rate of exact match on the field values but there are similarities)?

Taod for ms sql server has that feature to compare rows from 2 tables..

I nkow that are theare also others but Toad i did use it..

Sorry for my bad english

|||

There is a tablediff.exe that comes with SQL Server 2005, if you are using 2005.

Monday, March 12, 2012

Find out the commands executed

We have a stores database on SQL Server 2000. What I need to know is
the exact changes (or what ever the sql commands that are executed)
during a specific interval of time on the StoreDatabase.
e.g. between 10:15 AM and 10:30 AM.
Is there anyway I could do that?
Thanks for helping!
dbUse can use the SQL Server Profiler to capture the sql commands against a
given database.
regards, -marty nicholson
"Dan" <danjbart@.yahoo.com> wrote in message
news:fa556b4d.0307191812.12948b98@.posting.google.com...
> We have a stores database on SQL Server 2000. What I need to know is
> the exact changes (or what ever the sql commands that are executed)
> during a specific interval of time on the StoreDatabase.
> e.g. between 10:15 AM and 10:30 AM.
> Is there anyway I could do that?
> Thanks for helping!
> db|||As already suggested Profiler or a server side trace could be used if you
are interested in future events, if you want to have a look at what happened
in the past then the only tool really available would be Log Explorer from
www.lumigent.com
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Dan" <danjbart@.yahoo.com> wrote in message
news:fa556b4d.0307191812.12948b98@.posting.google.com...
We have a stores database on SQL Server 2000. What I need to know is
the exact changes (or what ever the sql commands that are executed)
during a specific interval of time on the StoreDatabase.
e.g. between 10:15 AM and 10:30 AM.
Is there anyway I could do that?
Thanks for helping!
db

Wednesday, March 7, 2012

Find Exact word in Full-Text Search

Hi,

I have the fields like this.

Session1 Session2 Session3 Session4
---------------------------
SQL Server-Part1 SQL Server-Part2 ASP.Net CSS

C# SQL Server-Part3 ASP.Net Javascript

I have set the Full-Text to all the columns. For searching i wrote the below query

SELECT * FROM <TABLE NAME> WHERE CONTAINS(*,'"SQL Server-Part1"')

My Result expectation is: The First Record should come. But the result of the query bring the two records. It see the "SQL Server" string also. I need to find the exact word. How to do it?

Please answer me as soon as possible.


Ganesh.

Hi there,

Why don't you try this:

SELECT TOP 1 * FROM <TABLE NAME> WHERE CONTAINS(*,'"SQL Server-Part1"')

Hope this helps,

thanks,

Murthy here

|||

Murthy Puvvada:

Hi there,

Why don't you try this:

SELECT TOP 1 * FROM <TABLE NAME> WHERE CONTAINS(*,'"SQL Server-Part1"')

Hope this helps,

thanks,

Murthy here

Sorry, but I think that is bad sql advice!

There is no guarantee that the correct record will be returned first in the query. Next time, it could be the second record returned.

In fact, if there is no order by clause, the sql standard maintains that the order of records returned in indeterminate, meaning officially unpredictable. Any sub-sub-release of sql server (or any other sql database) is free to make internal performance enhancements that could result in the records being returned in a different order.


|||

On another note, I haven't used Full Text indexing yet. Sorry, I can'tgive definitive advice there. But I'm guessing, from the sample datathat you showed, that maybe some of the characters you typed are wildcards of some sort within the context of the Contains function. Beingignorant on Full Indexing, I would read up on the specifications forthe Contains function more carefully.

And why do you have both single and double quotes around the search string? It sure looks weird!

|||

Oh! No. I can not use SELECT TOP 1 . Because the table may have duplicate of the string in more than a time.

So, please give me the exact answer.

Thanks

|||

Again, you need to research the Contains function and what it does. It clearly brings back data that you do not expect it to.

Have you researched that function yet?

|||

I glanced at the online documentation for the contains function and the mdx language for the search parameter.

It looks like it treats a - character as an Except command in some circumstances. I noticed that you had a - in the text you were searching for.

Might want to do an experiment and see if that's the problem.