Showing posts with label process. Show all posts
Showing posts with label process. Show all posts

Sunday, March 25, 2012

Adding a default value to a table

I'm new to SQL server and am in the process of converting an Access Db to SQL.

What I'd like to happen is for the current date and an Autonumber generated as soon as the user enters a value in another field. This was fairly straightforward in Access. When I try to set the default in design table (inSQL), the date() is not available. After a little research I came up with CREATE DEFAULT and Bind column commands, Global variables, etc.

I have a couple of questions for anyone that might know:

Is there an easier way than this to create default values in a table? AND,

Would I also have to bind columns for Table lookups? For example, if I wanted a price to be returned after the product ID was entered (Automatic in Access if relationship/form setup properly), would I have to bind the column? Or would it happen automatically?you can use getdate() or current_timestamp instead of date()

for "lookup" feature of access you can create calculated field.

Saturday, February 25, 2012

Add filters dynamically

Hi,

I am using a ReportViewer control on the windows form to connect to Report Server, process the report remotely (ServerReport) and render the report in PDF format.

The user wants to add some fiter(criteria) each time before the report is rendered. The filter (criteria) is generated separately. The original content of RDL should not be changed. I know, Report Builder is an option available. But, the end-user doesnt want to use Report builder to design the report.

I need to know, is there anyway I can retrieve the dataset->commandtext of the report(published on REport Server), edit and set it back dynamically, before rendering to PDF or any API, which can allow to add filters programmatically.

Thanks in advance.

You can pass it as report parameter. But is must be done carefully to prevent SQL injections)

Add filters dynamically

Hi,

I am using a ReportViewer control on the windows form to connect to Report Server, process the report remotely (ServerReport) and render the report in PDF format.

The user wants to add some fiter(criteria) each time before the report is rendered. The filter (criteria) is generated separately. The original content of RDL should not be changed. I know, Report Builder is an option available. But, the end-user doesnt want to use Report builder to design the report.

I need to know, is there anyway I can retrieve the dataset->commandtext of the report(published on REport Server), edit and set it back dynamically, before rendering to PDF or any API, which can allow to add filters programmatically.

Thanks in advance.

You can pass it as report parameter. But is must be done carefully to prevent SQL injections)

add event to application log

How do I add events to be recorded in the application log? I have a process
that is not completing 100% of the time, but I am not getting any events
recorded in the application log. The severity must be < 20. I realize that
opeing this up to all events will cause a lot of activity, but I need to find
out why this process does not complete every time it is run.
Thanks in advance.Doug,
Check out:
sp_addmessage
RAISERROR ... WITH LOG
xp_logevent
The choice will depend on your approach.
HTH
Jerry
"doug" <doug@.discussions.microsoft.com> wrote in message
news:310BB4E6-F9B4-4907-948A-7715B3289C04@.microsoft.com...
> How do I add events to be recorded in the application log? I have a
> process
> that is not completing 100% of the time, but I am not getting any events
> recorded in the application log. The severity must be < 20. I realize
> that
> opeing this up to all events will cause a lot of activity, but I need to
> find
> out why this process does not complete every time it is run.
> Thanks in advance.