How Do I Send RS Parameter To XML Query?

Jan 19, 2007

I Have this web service method:

[WebMethod]

public DataSet EeoReport(DateTime start, DateTime end)

{}

I have this XML query that sends blanks to start and end and properly gets my data.

<Query>
<ElementPath IgnoreNamespaces="True">
EeoReportResponse {}/
EeoReportResult/diffgram{}/
DataSetName {}/TableName {Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8}
</ElementPath>

<SoapAction>http://services.mydomain.com/EeoReport</SoapAction>
<Method Namespace="http://services.mydomain.com"
Name="EeoReport">
</Method>
</Query>

How do i add RS parameters to this query to represent start and end in the above webmethod...?

View 4 Replies


ADVERTISEMENT

Send Parameter Via QueryString To A StoredProcedure

Apr 19, 2008

 Halloi have a problem to send a parameter via QueryString to my storedProcedure.If i run the procedure in VisualWebDeveloper everything works fine, when i enter the parameter with the DialogBox: 1 ALTER PROCEDURE dbo.StoredProcedure2 2 @appart varchar(50)3 4 AS5 BEGIN6 7 SELECT category FROM immovables WHERE category = @appart 8 END9 /* SET NOCOUNT ON */ 10 RETURNThen i have a simple Page with a link <a href="Test.aspx?objtxt=34" target="_self">send</a> that send the QueryString to the Following Site:   <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Unbenannte Seite" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="StoredProcedure2" SelectCommandType="StoredProcedure" SortParameterName="objtxt"> <SelectParameters> <asp:QueryStringParameter Name="appart" QueryStringField="objtxt" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px" AutoGenerateRows="False" DataSourceID="SqlDataSource1"> <Fields> <asp:BoundField DataField="category" HeaderText="category" SortExpression="category" /> </Fields> </asp:DetailsView> </asp:Content> Now, when i run the application, i get the following message, when i fire up the Link:Für die Prozedur oder Funktion StoredProcedure2 wurden zu viele Argumente angegeben.I'm german so i get this message in german, tranlated: to many aguments wher passed to the procedure or funktion StoredProcedure2  I think the problem has thomething to do with the parameter deklaration in the storedProcedure.am I wrong?can somebody help me?Regards from Cologne (Germany) Caspar 

View 5 Replies View Related

Possible To Send Parameter To Excel (via Web) To Pas Along Through To SQL Server?

Sep 14, 2004

Is there anyway to pass a parameter to an Excel spreadsheet (loaded in a browser) to use as a parameter in SQL statement?

I know that the Microsoft Technologies can write Excel files and then load them, but I'm looking to take an existing workbook, parameterize the SQL statement and pass parameters via the Querystring/Form Post to it.

Why you may ask? For existing PivotTables/Charts that can be filtered BEFORE they are run.

Any/all thoughts appreciated.

Bob

View 3 Replies View Related

SQL Auto Send Email Based On Parameter

May 5, 2008

I would like some help conceptualizing how to acomplish this task. My client has requested the ASP.NET web/SQL Server application send an email to one of our locations based on whether that location complied (via the web app) to each week's report. Here's how the flow would go:
The location checks the webpage weekly and selects their compliance to each record on the report. (They could overlook one of the records and not make a selection.)  The SQL db would then query the compliance table and create a report of those locations with at least one "non-compliance."  Then the Db would send a reminder email to each location on that report. The Db tables have the email address info assigned to each location, so I can join that to the compliance log table.
Can this be done? I am using SQL Server Management Studio Express and Visual Web Developer (VB.net).
Thank you for your ideas,SMc

View 7 Replies View Related

Return An Unique Identifier To An ASP.NET Page To Send It As A Parameter Into Another Stored Procedure

May 1, 2007

Hi !
I have a problem with the unique identifier and  don't know how to solve it.
I have a stored procedure, called from my ASP.NET page, which inserts a new record into a table. I need to get the Id of the row just inserted in order to use it as a parameter of another stored procedure which inserts a new row with this value and other values.
I tried with SCOPE_IDENTITY but i don't know how to ask for this value to the first stored procedure and stored it into an ASP variable.
Dim cmd As New SqlCommand
cmd.CommandText = "Insertar_Contacto"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = connect
 Thanks!!
 

View 2 Replies View Related

Send Query Result

Feb 20, 2006

Hi
How to send a Query Result as attachment in excel format using any types of sql mail tools, SQLMAIL or CDO or ....
Thanks

View 1 Replies View Related

Send Mail Automatically Using Sql Query

Jun 4, 2008

I have problem using the sp msdb.dbo.sp_send_dbmail....it will give error like "the EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo'". i am using godaddy...plz help me how to rectify the error...give me the full answer....
 thank
muthu6500

View 3 Replies View Related

SP Send Mail With Query Result

Dec 12, 2003

I try to use the SP to send the mail with some query result to my self and not using the build in sp xp_sendmail function. is there anyway i can do? or page i can look at it. please advise. thanks

View 3 Replies View Related

How Do You Send The Result Of A Query By SendMail?

Apr 19, 2007

For example the result of an Execute T-SQL Statement task.

This task does not have a hook-up for variable assignment, the SendMail can take in a variable. How do you pass the result of EXEC T-SQL statement be assigned to the variable in the SendMail task?

View 9 Replies View Related

Send Query Results Using SQl Mail

Sep 3, 2007

Hi,
Does anyone have an example of how to send the results of a query using sql mail? I m using sql server 2000 and have never used sql mail before.

Hope someone can help

Thanks

View 1 Replies View Related

Send Query Results Via Email

Sep 27, 2007

is it possible to use send mail task to send results of a query via email? if it can be sent then what would the result look like? will it be like excel type format or fixed length? or comma delimited?

and obviously -- how can I accomlish it?
thanks

View 5 Replies View Related

Query Regarding Send Mail Task

Jan 22, 2008

HI All,

There is an ssis package which has 3 sql tasks and one data flow task in the control flow.And as per the reuirement for each task failure on the control flow a mail has to be sent across as a notification. I have placed the send mail task for each and every task onerror eventhandler.

The problem comes when i run the task individually as execute task only one notification is sent but as i run the whole package, the send mail task sends one mail each for the sql task failures but for the data flow task it send across two mails instead of one mail. Why is this weared behaviour?? Are there any properties to be set for this?

Plz do let me know how this can be done.so that on data flow failure the send mail task sends only one notification on the package run instead of two.

Thanks,
Sheeba.

View 1 Replies View Related

How To Send Long String Using SqlContext.pipe.send(strString)?

Aug 15, 2006

Hi,



I have a string almost 11006 length.. when i try to send back from SQLCLR procedure

it says cannot send ..

here is Exception Text "Message length 11060 exceeds maximum length supported of 4000."

Max limit to send a string using pipe is 4000

How I can send a string which is large in size than 4000.



Thanks

View 6 Replies View Related

How To Send A Dynamic Files Attachment By Send Mail Task?

Jan 19, 2007

Hello All,

Hopefully someone out there will have an idea as this is driving me nuts.

I want to send a dynamic files in attachment files ny send mail task that file name has change follow datetime.

I try to use the expression but I can't use it.

please tell me for this problem.

Any suggestions appreciated,

Thanks.

View 4 Replies View Related

How To Send Query Results To A Flat File?

Jul 26, 2001

SQL Server is new to me.

I am using SQL Server 7.0 Query analyzer. I need to send my query results to a flat file. My select statement is 'SELECT * from table_a'.

Can someone help?

View 1 Replies View Related

MS SQL 6.5 Procedure To Send Query Results Via Email

Jul 20, 2005

Hi,I'm not sure if this is possible as i've googled everywhere, but i have aselect query that returns a customer record with their associated salesorders. I would like to automate a process which sends an email reminder toeach customer in the database, that has outstanding orders. This emailreminder should have the results of the query regarding their account.The table structure are as follows.---------------------Customer_tbl---------------------CustomerIDAccountNoNameEmailAddress---------------------Order_tbl---------------------OrderIDCustomerIDReferenceAmountDateOutstanding_flgCan anyone help?Sen.

View 2 Replies View Related

Transact SQL :: Send Email Only If Query Contains Results

Aug 8, 2015

I’m running a data integrity procedure from an agent job that is a scheduled weekly maintenance task which emails the results of my query, and is working properly.

I would however like this to only receive the email it the query contains results, and not send it no records are found to prompt me to take action.
 
My code less the personal information
  
EXEC msdb.dbo.sp_send_dbmail     
@profile_name
= '',
       @recipients
= '',
       @subject
= 'Database Integrity - Import Errors',

[Code] ....

View 5 Replies View Related

Send Results Of SELECT FOR XML Query To A File

Feb 9, 2008



I have posted this on previous forums, but the below code is a VB.net CLR stored proc that will accepts two parameters, a SELECT.... FOR XML query and a file path, and saves the resulting xml result into a file specified by the parameter. After compiling the VB code into a .dll than the T-SQL code to import the assembly, create the CLR proc and test it is included underneath. Hope some will find this useful




Code Snippet
'Requires the Trial or Release version of Visual Studio .NET 2005 Professional (or greater).
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Imports System.Xml

Partial Public Class outputxml
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Sub outputxml(ByVal XmlData As SqlXml, ByVal Filename As SqlString)
'Create the variables to hold the values that are supplied by the parameters
'input by the stored procedure
Dim xmlDoc As New XmlDocument()
Dim output As SqlPipe = SqlContext.Pipe()
Try
'Load the result set into the XmlDoc Variable and then save the results in the
'path provided by the stored procedure. The values are provided by the
'input parameters of the stored procedure
xmlDoc.LoadXml(XmlData.Value)
xmlDoc.Save(Filename.Value)
Catch ex As Exception
'If an error occurs catch the message and pipe it back to SQL
output.Send(ex.Message.ToString)
End Try
End Sub
End Class

T-SQL CODE BEGINS HERE


/*Alter the database to set trustworthy on in order

to allow the ability to set the assembly to external

access*/

ALTER DATABASE AdventureWorks SET trustworthy ON

--Import the assembly into SQL

CREATE ASSEMBLY outputxml

from 'C:outputxml.dll'

WITH PERMISSION_SET = EXTERNAL_ACCESS

-- Create the proc from the imported dll

CREATE PROCEDURE output

@xmldata XML,

@filename nvarchar(1024)

AS

EXTERNAL NAME outputxml.[outputxml.outputxml]

.outputxml



-- Test managed stored procedure

DECLARE @output xml

SET @output = (SELECT ProductID, Name, ListPrice

FROM Production.Product Product

FOR XML AUTO, ROOT('Catalog'), TYPE)

EXEC dbo.outputxml @output, 'c:Output.xml'

GO

View 2 Replies View Related

How Do I Attach Query Results To Send Mail

Jun 21, 2006

I have several tasks that I don't want to use conditional failure on. I have a ON ERROR send mail task right now that works. I want to have that send mail task include query results from a separate query. How do I do that?

Peter Cwik

View 8 Replies View Related

How To Send Query Result As Attachment With EXCEL Format

Feb 17, 2012

i am using sp_send_dbmail to send Emails.how to send query result as an attachment with EXCEL Format.

View 1 Replies View Related

SQL 2012 :: Send Emails With Query Results As Attachment?

Jul 16, 2014

What is the best way to send emails with query results as attachment?

There is a stored proc sp_send_dbmail but the formatting is not very good.

View 3 Replies View Related

SQL Tools :: Export Data To PDF And Send It By Mail Using A Query

Jul 8, 2015

i like to know if there is a way to export data to pdf and send it by mail using a query same way used to export to csv or text file "sp_send_dbmail".

View 6 Replies View Related

SQL Server 2008 :: 2 Emails Being Send From Job When Only 1 Should Send?

Apr 18, 2012

I have a job that emails out shipment notifications at the end of the day to our customers. The problem I have is I don't understand why the same email is sending out twice within a minute of each other when the job is only scheduled to run once. If I take the code out of the step and run it in management studio it only emails once. I attached the code for one customer for reference. We are running SQL 2008 on a VM sending to an exchange 2010 server.

DECLARE @tableHTML NVARCHAR(MAX) ;
SET @tableHTML =N'<H1>XYZ Company ASN For ' + CONVERT(VARCHAR(10), GETDATE(), 101) + ' </H1>' +
N'<table border="1">' +
N'<tr><th>Vendor</th><th>Delivery Date</th>' +
N'<th>Purchase Order Number</th><th>Item Number</th><th>Item Description</th>' +
N'<th>Quantity Shipped</th><th>UOM</th><th>BOL Number</th>'

[code]....

View 9 Replies View Related

SQL 2012 :: Possible To Send Pivot Query Results As Automated Database Email?

Nov 26, 2014

possible to send Pivot query results as automated database email ?

View 3 Replies View Related

SQL Server 2008 :: Remove Rows Affected From Query In Send Mail

May 6, 2015

I need to remove "rows affected" text from results as shown below from posted Sp. I am using set nocount on but its not working as expected.

Create Procedure DailyCheckList
As
SET NOCOUNT ON
Declare @EmailSub varchar(500),@dt varchar(100),@Msg varchar(max),@M varchar(max)
set @dt= convert(varchar(20),GETDATE(),107)

[Code].....

View 1 Replies View Related

SQL Server 2008 :: Send Emails To Individuals In Query Results And Extra?

Jul 15, 2015

I have a set of results based on a query that displays a learner, their workplace assessor and both their email addresses.

I want to send a standard request email (using db_mail) to each learner's email address which specifies who their individual assessor is and their current employer. One per learner.
I then want to email each assessor and in this email detail their learners (and their employer details) that I have emailed the request too.

View 1 Replies View Related

DB Engine :: Send Query Result As Excel Attachment With Database Mail?

Aug 12, 2015

I have below table in the snapshot, My task is to send the same output as a attachment in Excel to email. i used the below procedure
 
EXEC [msdb]..sp_send_dbmail 
@profile_name='TSSSendMail',
@recipients='mymailID@gmail.com.com',
@subject='DB Mail',
@body='HI Team',
@execute_query_database = 'DbName',
@query = 'EXEC J16ReimbursementFortnightly1TO15 1',
@attach_query_result_as_file=1,
@query_attachment_filename = 'SummaryReimbursement.xls'

But I am not getting Proper Output, is seems like CSV Format, but i want it proper tabular format in Excel.

View 4 Replies View Related

Central Management Server - How To Send Query Output In The Form Of Mail

Apr 29, 2015

i have used CMS in SQL 2008 R2. i have added couple of servers in its group. i have executed a query & i need to send the query output in the form of email.

basically query is checking the rows count from couple of user tables in servers.

issue here is how to copy the data that is used by CMS? i need to work on automate the rows count in difft user table in db servers.

View 2 Replies View Related

Integration Services :: Send Excel File From SSIS Using Send Mail Task Without Saving Excel File Locally?

Jul 14, 2015

Is there anyway to  send excel file from ssis using send mail task without saving the excel file locally. I need to automate the process which involves loading the excel file from the database and send it to some people. 

View 6 Replies View Related

Query With Another Query Input Parameter

Oct 18, 2006

Dear Friends,

I have a long query with an input parameter. I want this input parameter be all teh values returned from another query.



SELECT DIR FROM DIRECCAO

BIG QUERY with DIR input parameter.



How can I do?

Thanks.



View 4 Replies View Related

Query Parameter

Mar 2, 2007

I have to create a stored procedure where the criteria is: "All", specific value and, all except one value so far this is what I have:@Status varchar (50)  -- as parameter from a dropdown boxDECLARE @NewStatus varchar(50)
SET @NewStatus =
CASE
WHEN @Status ='All' AND @Status <> 'All but closed' THEN '%'
WHEN @Status <>'All' AND @Status <> 'All but closed' THEN @Status
END

and in the stored procedure

.........

WHERE Status like @NewStatus  I am a little confused as to how could I return all values except those that have  the value "Closed" Thanks. 

View 2 Replies View Related

Need To Add A Parameter To Query

Mar 23, 2008

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetAllArticlesByCatID" TypeName="articlesTableAdapters.tblArticleTableAdapter">
<SelectParameters>
<asp:QueryStringParameter Name="articlecatid" QueryStringField="catid" Type="Int32" />
what goes here?
 
</SelectParameters>
</asp:ObjectDataSource>
I'm using this to populate some templates I'm using.
I need to add a parameter for the query:
SELECT     tblArticle.ArticleCatID, tblArticle.ArticleID, tblArticle.ArticleText, tblArticle.ArticleTitle, tblArticle.Author, tblArticle.ShortDesc, tblArticle.WebSiteID,                       tblWebSite.SiteURL, tblWebSite.PageRankFROM         tblArticle INNER JOIN                      tblWebSite ON tblArticle.WebSiteID = tblWebSite.WebSiteIDWHERE     (tblArticle.ArticleCatID = @articlecatid) and tblArticle.Active=@active
This is from a tableadapter. How to I get the True value passed into this thing?  When an article is initially saved, the active value is set to false until the article is reviewed. Once everything is ok, then the status is set to actve.  So, although everything is sitting there in the table for the article, the directory will not pull it up with other search results already approved.

View 2 Replies View Related

Query: IIf And Parameter

Jul 11, 2007

Hi,Is it possible to create a query with an IIf Function but using a parameter in the expression?This is what I'm trying to do, except it doesn't work:SELECT Related_Area_Id, Course_Code, Course_Public_Title, Course_Level, Course_WBLTTG_OnlyFROM dbo.CourseWHERE (Related_Area_Id = @CurriculumArea) AND (Course_Level = @CourseLevel) AND (Course_WBLTTG_Only = IIf(@Apprenticeship = True, 1, 0)) Are there any other solutions?Thanks

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved