Showing posts with label proc. Show all posts
Showing posts with label proc. Show all posts

Friday, March 23, 2012

How to allow use to exec xp_sendmail

I have a stored proc that assigns a value to a field based on user input from an Access front end.

The last part of the stored proc sends an email if certain conditions are met.

It appears that users do not have permission to execute xp_sendmail. I guess this is because it is executed on the master database. Is there a way I can give them permission to this stored proc?

The users are getting this message:

EXECUTE permission denied on bject 'xp_sendmail', 'database master', owner 'dbo'.(#229)You can grant a user to execute xp_sendmail by going to properties of xp_sendmail in master database and grant the user permission to execute.

Friday, March 9, 2012

how to add extra columns to a report that are not in select query or stored proc

Hi,

I am new to reporting.I have 10 columns coming from the sql query.I need to add 2 more columns to the same report.These 2 columns come from the values the user selected in the dropdownlist on a webpage(From where we are calling the Report).How to add these columns to the report from the webpage.Please guide me.

in the textbox use

=Parameters!parameterName.Value

|||

you create input parameters and supply the value when the rpt is launched from the web, then in the text box u place the i/p paramter inst of keeping the table field

Wednesday, March 7, 2012

How to add a Windows User Login to a database using T-SQL

Hi All,

I'm trying to add a new Windows User to a database using T-SQL. I tried the sp_addlogin system proc, but this doesn't allow backslashes (presumably because it only allows creation of SQL Server logins).

I couldn't find a sproc for this, what's the best way to achieve it?

Thanks,

Simon.

Sorry, being stupid - again!!

sp_grantlogin is all you need...

Friday, February 24, 2012

How to add a group header and footer for a report

I have a report that is being called via stored proc, and i want to group by contract. when report gets generated i get multiple contracts info. but will be grouped/sorted by contract.

please how can i have a group header and also a group footer to show a summary of each contract information with some calculated fields in it.

i may get 100 records related to 10 contracts , 10 rows for each contract.

as soon as the first contract info is shown on the report it has to show a summary related to the first contract in the group footer, and then continue populating the second contract info and so on.

Please i am totally new to reporting and help would be appreciated. thank you all.

Here's what you can do:

Click anywhere on your table while in Layout.
Right click on the box next to your details row (it has 3 horizontal bold bars on it), and select 'Insert Group'.
On the 'General' tab, make sure 'Include group header' and 'Include group footer' are both checked.
In the 'Group on:' section, drop down the box and select your contract field. (Or you can type: =Fields!contract.Value)
On the 'Sorting' tab, again, pick or type your contract field as above.
On the 'Visibility' tab, make sure that the 'Visible' radio button is selected.
Hit 'OK' and now you can add your fields to the group header and footer.

Hope this helps.

Jarret

|||

Did this work for you Reddymade?

Jarret