Showing posts with label forms. Show all posts
Showing posts with label forms. Show all posts

Sunday, March 25, 2012

Best Query/Search Method

Hi,

I'm wondering about the following:

I have come across an InfoPath Forms application who's code is scripted in javascript and who's data seems to be in XML files.
An analyst at that company told me they suspect the data is ALSO in SQL Server... somewhere. They can't seem to find it though. I have
reviewed the .js code and some methods are called for which I can find no source. I believe those methods execute OK because they're found
inside some DLL.

I'm thinking I would enter a new record using the form in InfoPath using some datavalue that I can expect will be unique.. like a lastname who's first three chars is ZZZ or something like that. Subsequently, I'd search each column in each table in each DB on the server to see if I can locate it somewhere.

So, my question is what is the best approach for this? I have access to the db, table and column names. I know I can write a small vb.net piece of code to execute my search. But, is there some better way using some sql procedure (or using the full text catalog) instead or any other tool(s)?

Thanks in advance for your advise.

Stewart

Go into sql server management studio and open up a new query window, then set the query window to the the database in question.

Execute this query:

select 'union select ''[' + colu.table_schema + '].[' + colu.table_name + '].[' + colu.column_name + ']'' as "Schema.Table.Column" '
+ ',[' + colu.column_name + '] as "Value" '
+ ' from [' + colu.table_schema + '].[' + colu.table_name + '] '
+ ' where [' + colu.column_name + '] like ''ZZZ%'' '
from INFORMATION_SCHEMA.columns as colu
where colu.data_type in ('varchar','nvarchar','char','nchar','text','ntext')

Below the query will be the results, one sql statement per text-based column.

You can click, then right-click on the top-left button-looking box in the grid header and copy the text into the buffer.

Paste it into a new query window.

Delete the first "union" on the first line and execute the query.

It will return one row per column value per table that matches ZZZ%.

Depending upon the number of tables/columns in the database, and the number of rows in the table, you might need to split the results into multiple, smaller queries.


Enjoy!


|||

Hi David,

Thanks very much for the assistance. It worked perfectly!

Regards,
Stewart

|||

The views in the master database are very powerful. Try the information_schema views first, and switch to the sys... views if the information_schema views don't have what you need.

Glad it helped!

sql

Tuesday, March 20, 2012

Best Practices (Forms/Letters)

I have a rather large number of already existing forms and letters (in paper
format) that I need to recreate in Reporting Services. After reading a few
posts with regards to formatting etc I have noted that several recommend not
using Text Boxes/Labels but rather tables.
As I'm very new to RS could somebody please advise as to the best possible
way to go about creating these.
Often there is a few lines of text then something that needs to be populated
from the database then another few lines of text etc.
Any help on this would be greatly appreciated.On Sun, 3 Apr 2005 18:03:02 -0700, "Nat Johnson"
<NatJohnson@.discussions.microsoft.com> wrote:
>I have a rather large number of already existing forms and letters (in paper
>format) that I need to recreate in Reporting Services. After reading a few
>posts with regards to formatting etc I have noted that several recommend not
>using Text Boxes/Labels but rather tables.
>As I'm very new to RS could somebody please advise as to the best possible
>way to go about creating these.
>Often there is a few lines of text then something that needs to be populated
>from the database then another few lines of text etc.
>Any help on this would be greatly appreciated.
>
Nat,
Can you explain more about what you are trying to do (ignoring what
the appropriate software might or might not be).
On the face of it, I suspect that Reporting Services may not be the
optimal solution. But I would prefer to better understand your
objective. Forms, for example, in my terminology are used to collect
data from users. I assume that is not part of your aim?
Andrew Watt
MVP - InfoPath|||The company I work for are creating an application which includes an SQL
database. I have to use RS for the reports that are required. Most of the
reports are the traditional style (eg lineflow looking) but others are
letters or forms that the system will automatically print out if a certain
condition is met.
The forms that will be printed will have parts that will be populated from
the database. The web team for the project are creating the online forms. I
have to make my forms similar to theirs for printing out as once the parts
are populated from db they need to be printed so a user can take them to a
site for hand completion.
Most of the letters that need to be printed out need to get data from the
db. And will be automatically printed by the system when a condition is met.
The normal reports that need to be created are not the problem. My question
really relates to the forms and letters and the formatting of these.
Let me know if this helps you anymore or not.
cheers
Nat
"Andrew Watt [MVP - InfoPath]" wrote:
> On Sun, 3 Apr 2005 18:03:02 -0700, "Nat Johnson"
> <NatJohnson@.discussions.microsoft.com> wrote:
> >I have a rather large number of already existing forms and letters (in paper
> >format) that I need to recreate in Reporting Services. After reading a few
> >posts with regards to formatting etc I have noted that several recommend not
> >using Text Boxes/Labels but rather tables.
> >
> >As I'm very new to RS could somebody please advise as to the best possible
> >way to go about creating these.
> >
> >Often there is a few lines of text then something that needs to be populated
> >from the database then another few lines of text etc.
> >
> >Any help on this would be greatly appreciated.
> >
> Nat,
> Can you explain more about what you are trying to do (ignoring what
> the appropriate software might or might not be).
> On the face of it, I suspect that Reporting Services may not be the
> optimal solution. But I would prefer to better understand your
> objective. Forms, for example, in my terminology are used to collect
> data from users. I assume that is not part of your aim?
> Andrew Watt
> MVP - InfoPath
>|||You should be able to render to PDF and print the PDF documents.
If the documents are to be completed by hand that ought to work for
you.
Almost certainly there will be some tweaking involved to get the
appearance that everybody is happy with.
Andrew Watt
MVP - InfoPath
On Mon, 4 Apr 2005 13:05:03 -0700, "Nat Johnson"
<NatJohnson@.discussions.microsoft.com> wrote:
>The company I work for are creating an application which includes an SQL
>database. I have to use RS for the reports that are required. Most of the
>reports are the traditional style (eg lineflow looking) but others are
>letters or forms that the system will automatically print out if a certain
>condition is met.
>The forms that will be printed will have parts that will be populated from
>the database. The web team for the project are creating the online forms. I
>have to make my forms similar to theirs for printing out as once the parts
>are populated from db they need to be printed so a user can take them to a
>site for hand completion.
>Most of the letters that need to be printed out need to get data from the
>db. And will be automatically printed by the system when a condition is met.
>The normal reports that need to be created are not the problem. My question
>really relates to the forms and letters and the formatting of these.
>Let me know if this helps you anymore or not.
>cheers
>Nat
>"Andrew Watt [MVP - InfoPath]" wrote:
>> On Sun, 3 Apr 2005 18:03:02 -0700, "Nat Johnson"
>> <NatJohnson@.discussions.microsoft.com> wrote:
>> >I have a rather large number of already existing forms and letters (in paper
>> >format) that I need to recreate in Reporting Services. After reading a few
>> >posts with regards to formatting etc I have noted that several recommend not
>> >using Text Boxes/Labels but rather tables.
>> >
>> >As I'm very new to RS could somebody please advise as to the best possible
>> >way to go about creating these.
>> >
>> >Often there is a few lines of text then something that needs to be populated
>> >from the database then another few lines of text etc.
>> >
>> >Any help on this would be greatly appreciated.
>> >
>> Nat,
>> Can you explain more about what you are trying to do (ignoring what
>> the appropriate software might or might not be).
>> On the face of it, I suspect that Reporting Services may not be the
>> optimal solution. But I would prefer to better understand your
>> objective. Forms, for example, in my terminology are used to collect
>> data from users. I assume that is not part of your aim?
>> Andrew Watt
>> MVP - InfoPath