SqlDataSource.Update With Session Variable As Input Parameter

May 25, 2007

I'm getting a type mismatch error (currently string, when I think I need Int32 ?) with the code below. I'm having difficultly setting my session variable to type Int32 and having it take up the value of RawCoDeptRowID. When I "Watch" it, it's value remains as "snCoDeptRowID".  Also, not sure if my Update command and it's snCoDeptRowID input parameter is well formed? Any advice would be greatly appreciated. Thank you.

Web Page 1:

Session["snCoDeptRowID"] = Convert.ToInt32 (RawCoDeptRowID);

 

Web Page2:<asp:SqlDataSource ID="SqlDataSource3" runat="server"

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

UpdateCommand="UPDATE [CompanyDepartment] SET [User_Name] = @User_Name, [FirstName] = @FirstName, [LastName] = @LastName, [Company_Name] = @Company_Name, [Department_Name] = @Department_Name WHERE [User_ID] = @snCoDeptRowID ">

<updateparameters>

<asp:parameter Name="User_Name" Type="String" />

<asp:parameter Name="FirstName" Type="String" />

<asp:parameter Name="LastName" Type="String" />

<asp:Controlparameter Name="Company_Name" Type="String" ControlID ="ListBox1" PropertyName ="SelectedValue" />

<asp:Controlparameter Name="Department_Name" Type="String" ControlID ="ListBox2" PropertyName ="SelectedValue" />

<asp:QueryStringParameter Name="User_ID" Type="Int32" QueryStringField ="@snCoDeptRowID" DefaultValue ="@snCoDeptRowID" />

</updateparameters>

</asp:SqlDataSource>

View 1 Replies


ADVERTISEMENT

Assign Session Variable Value To Update Parameter

Jun 12, 2007

Hi, I'm trying to update a sqlserver database through vb.net in an asp.net 2.0 project. I'm using a sqldatasource and am trying to code an update parameter with a session variable.
code snippet:   <UpdateParameters><asp:Parameter Name="hrs_credited" />
<asp:Parameter Name="updater_id" DefaultValue="<%$ Session("User_ID")%>" Type="Int32"/>
<asp:Parameter Name="activity_id" />
<asp:Parameter Name="attendee_id" /></UpdateParameters>
The error message that I receive is:
 Error 2 Literal content ('<asp:Parameter Name="updater_id" DefaultValue="" Type="Int32"/>') is not allowed within a 'System.Web.UI.WebControls.ParameterCollection'. C:DevelopmentCMEdataentryattendance.aspx 29 
Does anyone have an idea how to assign the session var value to the parameter?
Thanks!

View 1 Replies View Related

Populating An SqlDataSource Using A Session Variable

May 29, 2008

I'm having a real problem populating my SqlDataSource and was wondering if anyone could help.  I'm sure it's something simple
First off, I created a session variable on a previous page like so Dim NewSubscribeID As Integer = Convert.ToInt32(retSubcribeID.Value)
Session("SubcribeID") = NewSubscribeID
I now want to use this session variable on another page to populate a SqlDataSource like so <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionXX %>" SelectCommand="spXX" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:SessionParameter Name="SubscribeID" SessionField="SubscribeID" Type="Int32" DefaultValue="0" />
</SelectParameters>
</asp:SqlDataSource>
Here is the problem... Only the default value gets used.
I've tried putting the session variable into a label to test that it does actually exist lblTest.Text = Session("SubcribeID")

 and it does...What am I doing wrong?

View 2 Replies View Related

How To Use A Cookie As An Input Parameter In Sqldatasource?

Apr 8, 2008

i created a cookie as follows
 HttpCookie myCookie = new HttpCookie("Portal");
myCookie["EMail_ID"] = Email_ID;myCookie["Role"] = Role_ID.Value.ToString();myCookie.Expires = DateTime.Now.AddMinutes(1);
Response.Cookies.Add(myCookie);
 
Now i have to take the"EMail_ID" as input parameter in sqldatasourse.
 
<asp:SqlDataSource ID="SqlDS_DC_List" runat="server" ConnectionString="<%$ ConnectionStrings:EnR_Portal_ConnectionString %>"
SelectCommand="proc_DC_List" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:CookieParameter CookieName=" " Name="Email_ID" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
 
how can i specify Email ID as cookie name?
 
 

View 11 Replies View Related

How To Provide An Input Parameter For A SqlDataSource Using The Different Source Alternatives???

Jan 11, 2006

Hello everybody,
I'm new using ASP 2.0,  I was trying to find out how do i tell a SqlDataSource the parameters it will be using for the select query.  I was looking at the Configure Data Source wizard and when I press the where botton to create the parameters, I do not know how two of the available Source selections work which are: (Query String, and Session). What I want to understand is how do I pass the parameter value during the form load like I used to do with ASP 1.1.
I used to write: during the pageload event:
me.dataAdapter.selectparameter("@param").value = [myVar]
me.dataAdapter.fill(Me.ds)
 
I tried to do something like this for the SqlDataSource but didnt work.
can anyone tell me how can I acomplish this?
 
thanks a lot.
 
Ed.

View 7 Replies View Related

How To Use A Variable From The For Loop Container As A Input Parameter To A SP

Nov 6, 2006

Hi Everyone:

I have a quick but imp SSIS question. I have a For Each Loop Container, and inside that I wish to add a Execute SQL Task item, so I can call a sp to do some inserts/updates. The ForEachLoop container is looping thru a ADO Object source variable(which is the user variable defined by me, as a FullResultSet). In my Execute SQL Task, I would like to utilize one of the columns from the result set as an input parameter to my Stored procedure. Can someone please advise on how to do this? Please let me know if you have any more questions. I am waiting for a response... Thanks in advance.

 

MA

View 1 Replies View Related

Passing Object Variable As Input Parameter To An Execute SQL Task Query

Mar 29, 2007

I've encountered a new problem with an SSIS Pkg where I have a seq. of Execute SQL tasks. My question are:

1) In the First Execute SQL Task, I want to store a single row result of @@identity type into a User Variable User::LoadID of What type. ( I tried using DBNull Type or Object type which works, not with any other type, it but I can't proceed to step 2 )



2) Now I want to use this User::LoadID as input parameter of What type for the next task (I tried using Numeric, Long, DB_Numeric, Decimal, Double none of there work).



Please give me solutions for the above two..



View 6 Replies View Related

SQLDataSource - Select Parameter Drawn From A Variable

Mar 4, 2006

I have been using a workaround because i think I don't understand something about sqldatasource select parameters.
I am using control parameters as a workaround for when i want to use a variable at runtime. i assign the value to the control - then use that as my select parameter. is there another way?
here's what i do:
<asp:Literal runat="server" ID="litCurrentYear" Text="" Visible="False"></asp:Literal>
<asp:SqlDataSource runat="server" ID="dsSummaryTable" ConnectionString="***"SelectCommand="spReportSummary" SelectCommandType="StoredProcedure"><SelectParameters><asp:ControlParameter Name="CurrentYear" ControlID="litCurrentYear" PropertyName="Text" /></SelectParameters></asp:SqlDataSource>
On PageLoad I assign litCurrentYear.Text whatever value I want. It works fine. But there must be a more elegant way - I just don't know it yet :)

View 3 Replies View Related

Using XML As An Update Parameter In A SqlDataSource?

Nov 6, 2006

One of the requirements of the UpdateParameters for a GridView I'm building is that the fields that are being edited via EditItemTemplates are passed back to the UpdateParameter as XML. How would I go about combining the fields from the GridView/EditItems into an XML string that I can set as an asp:Parameter?
Thanks.

View 1 Replies View Related

Need Help With SQLDataSource Update Parameter

Jun 14, 2007

I need to know how to setup the ControlParameter for a template control in my Gridview? I have a datepicker in my template and I need to know how to refer to it in the ControlParameter of the SQLDataSource control.
  <UpdateParameters>
<asp:ControlParameter Name="dp_start" ControlID="bdpPlanStart" PropertyName="SelectedValue" Type="Datetime" />  Here is the template:<asp:TemplateField HeaderText="Start" SortExpression="dp_start">
<ItemTemplate>
<%#DataBinder.Eval(Container, "DataItem.dp_start", "{0:d}")%>
</ItemTemplate>
<EditItemTemplate>
<BDP:BasicDatePicker id="bdpPlanStart" SelectedValue='<%# DataBinder.Eval(Container.DataItem,"dp_start") %>' runat="server" DateFormat="d">
</BDP:BasicDatePicker>
</EditItemTemplate>
</asp:TemplateField>  

View 1 Replies View Related

SqlDataSource Update Doesn't Work When Using Parameter

Feb 3, 2007

Hi all:
I have a list of items (actually a relation in which a user has selected an item, along with a rating for the item) in an Access database table, connected to my app with a SqlDataSource and bound to a repeater.  The repeater displays the items to the user along with a dropdown box to show the rating, and allow the user to update it.  The page connects and displays correctly.
My problem is that when the user submits the page and I iterate through the repeater items to update each rating, the updates are not being completed in the database.  The update works if I hard-code a value for the rating into the query itself, but not when using an updateparameter (pTaskRating below).  In other words if I replace pTaskRating with '5', all the correct records will be found and have their ratings updated to 5.  That means that the mySurveyId and pTaskId(DefaultValue) parameters have to be working, because the right records are found, but I can't seem to update records based on the DefaultValue of the pTaskRating parameter, even though I can verify that the DefaultValue is correct by placing a watch on it.  It seems that my problem must be in my use of that particular parameter in the query, either in properties of the parameter or in the value assigned to it.  I am extremely frustrated - any ideas would be greatly, greatly appreciated.  Thanks!
Bruck
The table I'm pulling from and updating looks like this:
SURVEY_ID (Text 50), TASK_ID (Long Int), RATING_ID (Long Int)
Here's my ASPX for the main data source:
<asp:SqlDataSource ID="sqlTaskSelections" runat="server" ConnectionString='Provider=Microsoft.Jet.OLEDB.4.0;Data Source="abc.mdb";Persist Security Info=True;Jet OLEDB:Database Password=xyz' ProviderName="System.Data.OleDb" SelectCommand="SELECT [SURVEY_ID], [TASK_ID], [RATING_ID] FROM [TBL_TASK_SELECTION] WHERE [SURVEY_ID] = mySurveyId" UpdateCommand="UPDATE [TBL_TASK_SELECTION] SET [RATING_ID] = pTaskRating WHERE ([SURVEY_ID] = mySurveyId) AND ([TASK_ID] = pTaskId)">
<UpdateParameters>

<asp:SessionParameter Name="mySurveyId" SessionField="SurveyId" DefaultValue="" /><asp:Parameter Name="pTaskId" DefaultValue="" /><asp:Parameter Name="pTaskRating" DefaultValue="" />
</UpdateParameters>
And here's the repeater (the Task ID and Rating are stored in hidden fields for easy access later):
<asp:Repeater ID="rptTaskSelections" runat="server">

<HeaderTemplate><table border="0"></HeaderTemplate>

<ItemTemplate>

<tr class="abctr"><td class="normal"><asp:DropDownList ID="cbRatings" runat="server"></asp:DropDownList><asp:HiddenField ID="hTaskId" Runat="server" Visible="false" Value='<%# Eval("TASK_ID") %>' /><asp:HiddenField ID="hRating" Runat="server" Visible="false" Value='<%# Eval("RATING_ID") %>' /> <%# Eval("TASK_ID") %></td></tr>
</ItemTemplate>

<FooterTemplate></td></tr></table></FooterTemplate>
</asp:Repeater>
And here's the page load and submit VB:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not Page.IsPostBack Then


'BIND / LOAD RATINGS TO DROPDOWN BOXES HEREDim i As IntegerDim cbCurrentRating As DropDownListDim hCurrentRating As HiddenFieldrptTaskSelections.DataSource = sqlTaskSelectionsrptTaskSelections.DataBind()


For i = 0 To rptTaskSelections.Items.Count - 1



cbCurrentRating = rptTaskSelections.Items(i).FindControl("cbRatings")hCurrentRating = rptTaskSelections.Items(i).FindControl("hRating")



cbCurrentRating.DataSource = sqlRatingscbCurrentRating.DataTextField = "RATING"cbCurrentRating.DataValueField = "ID"cbCurrentRating.DataBind()cbCurrentRating.SelectedValue = hCurrentRating.Value


Next

End If
End Sub
Protected Sub btnSubmitRateTasks_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmitRateTasks.Click

'UPDATE RATINGS HERE

Dim i As IntegerDim cbCurrentRating As DropDownListDim hCurrentTaskId As HiddenField

For i = 0 To rptTaskSelections.Items.Count - 1


cbCurrentRating = rptTaskSelections.Items(i).FindControl("cbRatings")hCurrentTaskId = rptTaskSelections.Items(i).FindControl("hTaskId")


sqlTaskSelections.UpdateParameters.Item("pTaskId").DefaultValue = hCurrentTaskId.ValuesqlTaskSelections.UpdateParameters.Item("pTaskRating").DefaultValue = cbCurrentRating.SelectedValue
sqlTaskSelections.Update()

Next

Response.Redirect("nextpage.aspx")
End Sub
 

View 3 Replies View Related

Session Var As Table Name In SQLDataSource Selectcommand?

Mar 12, 2008

Hi Everyone,
I set the session("MyTable") with the user's name as contents when the user logs in, then I copy a new table name with session("MyTable") , I set PK and this all works, but I can't seem to figure out how to use the session var as table name SQLDataSource Selectcommand? I try a bunch of different stuff, putting it into a key in the web.config. Seems like this should be a piece of cake.
Im getting ~ "Session variable is not a valid datasource item" etc. Below is one of the things I have tried.<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Connectio String %>" SelectCommand="Select * From [" + Session("MyTable") + "] Where ID = @ID">
 TIA
Cebo

View 2 Replies View Related

How Do I Bind A Value Returned From Sqldatasource To A Session?

Apr 22, 2008

I have a sql data source that runs a query that returns a users data (See below).  I want to set the session variable "UserID" equal to the tkinit.  How do I "bind" the session to a column from this select command?   I tried this Session("UserID") = ("tkinit")    but that doesn't work.  I can hard code a session value, just can't figure out how to "bind" it from the sqldatasource.. 
<asp:SqlDataSource ID="getUserID" runat="server" ConnectionString="<%$ ConnectionStrings:xxxConnectionString %>" SelectCommand="SELECT [tkinit], [tklast], [tkfirst], [tkfirst]+' '+[tklast] as fullname FROM [yyy] WHERE ([login] = @login)"><SelectParameters><asp:Parameter Name="login" Type="String" /></SelectParameters></asp:SqlDataSource>
 
 

View 3 Replies View Related

Sqldatasource Using Session Data In Select Parameters

Jan 12, 2007

I'm having trouble using session data in my select parameters.  If I manually plug a value into the selectcommand or create a hard coded value using a parameter it works, but if I try to use the session data the query pulls no results.  I know the session data is set because I print the value at the top of the page, but for some reason it's not getting passed to the sessionparameter??? 
 This is the datasource code:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:flautoconnstr %>"
SelectCommand="SELECT * FROM [tblVehicles] WHERE ([profileid] = @profileid)">
<SelectParameters>
<asp:SessionParameter Name="profileid" SessionField="profileid" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
 
This is the line I use to set the session data.
Session["profileid"] = myQuote.Profileid;

View 1 Replies View Related

Session Variable Help!!!!!

Oct 29, 2004

Hi...
I'm developing a web app with VS 2005 Beta and I do not know how to include a seasson variable value into my code.

This is my code:

Function GetData() As System.Data.SqlClient.SqlDataReader
Dim sqlconn As System.Data.SqlClient.SqlConnection
Dim SqlCommand1 As System.Data.SqlClient.SqlCommand
Dim sqlRdr As System.Data.SqlClient.SqlDataReader
sqlconn = New SqlConnection("SERVER=SRVR;UID=USR;Password=PWD;DATABASE=MyDatabase")
sqlconn.Open()
SqlCommand1 = New SqlCommand("MyStrProc", sqlconn)
SqlCommand1.CommandTimeout = 1800
sqlRdr = SqlCommand1.ExecuteReader(CommandBehavior.CloseConnection)
Return sqlRdr
End Function

MyStrProc is:

CREATE PROCEDURE MyStrProc
@MyVar int
AS
IF @MyVar IS NOT NULL
BEGIN
.................
......t12.acct_nbr IN (@MyVar)
.....
END
GO

The variable @MyVar get its value from user log info in login page, and create a session variable.

My Question:

How and where to call seasson variable @MyVar, because now I'm getting this error:
Procedure 'MyStrProc' expects parameter '@MyVar', which was not supplied.

Any help will be great.

Tks

View 4 Replies View Related

Session Variable

Jun 22, 2007

Can we use session variable in reporting services.. say go to report -> properties and create a VB function that get ans set session variable.. If yes, how. If not, any workaround?

View 2 Replies View Related

Set Session Variable From SQL Select

May 13, 2007

Hi,
I try to set a Session variable with the result of a SQL Selec statement. I tried the following, but it is not working.
Session("thisone") = SqlDataSource1.SelectCommand = "SELECT myfield FROM [mytable] WHERE ([username] = @username)"
@username is a value from a textbox. What I am doing wrong?
Thanks for your help, Chris

View 2 Replies View Related

Need To Write Value Of Session Variable To SQL Record

Jan 8, 2006

Each user who inserts a new SQL record from the FormView control needs to have their UserID in one of the fields of the record.  I have the user ID stored in the Session("UserID") variable.  I am having trouble finding the right way to get this done.  I have tried using a hidden text box but I can't seem to assign the value.  I have tried the Insert Parameters but that will not accept <%# Session("UserID") %> as a DefaultValue.  Any ideas would be helpful.  Thanks.

View 5 Replies View Related

Passing Session Variable To Html Page.

Apr 17, 2008

Hi Folks,
i am trying to add a connection string value to my client side as follows. i am getting error. any ideas??
<asp:SqlDataSource ID="SqldsComments2" runat="server" ConnectionString='<% session("sqlConn") %>'
SelectCommand="SELECT * FROM TicketComments Where TicketNo=@TicketNo ">
<SelectParameters>
<asp:Parameter Name="TicketNo" DefaultValue="0" Type="string" />
</SelectParameters>
</asp:SqlDataSource>

View 6 Replies View Related

My Output Parameter Is Being Treated As An Input Parameter...why

Sep 25, 2006

I have a stored procedure which takes an input parm and is supposed to return an output parameter named NewRetVal.  I have tested the proc from Query Analyzer and it works fine, however when I run the ASP code and do a quickwatch I see that the parm is being switched to an input parm instead of the output parm I have it defined as...any ideas why this is happening?  The update portion works fine, it is the Delete proc that I am having the problems... ASP Code...<asp:SqlDataSource ID="SqlDS_Form" runat="server" ConnectionString="<%$ ConnectionStrings:PTNConnectionString %>" SelectCommand="PTN_sp_getFormDD" SelectCommandType="StoredProcedure" OldValuesParameterFormatString="original_{0}" UpdateCommand="PTN_sp_Form_Update" UpdateCommandType="StoredProcedure" OnUpdated="SqlDS_Form_Updated" OnUpdating="SqlDS_Form_Updating" DeleteCommand="PTN_sp_Form_Del" DeleteCommandType="StoredProcedure" OnDeleting="SqlDS_Form_Updating" OnDeleted="SqlDS_Form_Deleted"><UpdateParameters><asp:ControlParameter ControlID="GridView1" Name="DescID" PropertyName="SelectedValue" Type="Int32" /><asp:ControlParameter ControlID="GridView1" Name="FormNum" PropertyName="SelectedValue" Type="String" /><asp:Parameter Name="original_FormNum" Type="String" /><asp:Parameter Direction="InputOutput" size="25" Name="RetVal" Type="String" /></UpdateParameters><DeleteParameters><asp:Parameter Name="original_FormNum" Type="String" /><asp:Parameter Direction="InputOutput" Size="1" Name="NewRetVal" Type="Int16" /></DeleteParameters></asp:SqlDataSource>Code Behind:protected void SqlDS_Form_Deleted(object sender, SqlDataSourceStatusEventArgs e){  if (e.Exception == null)    {   string strRetVal = (String)e.Command.Parameters["@NewRetVal"].Value.ToString();    ............................Stored Procedure:CREATE PROCEDURE [dbo].[PTN_sp_Form_Del] (
@original_FormNum nvarchar(20),
@NewRetVal INT OUTPUT )
AS
SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

DECLARE @stoptrans varchar(5), @AvailFound int, @AssignedFound int

Set @stoptrans = 'NO'

/* ---------------------- Search PART #1 ----------------------------------------------------- */
SET @AvailFound = ( SELECT COUNT(*) FROM dbo.AvailableNumber WHERE dbo.AvailableNumber.FormNum = @original_FormNum )
SET @AssignedFound = ( SELECT COUNT(*) FROM dbo.AssignedNumber WHERE dbo.AssignedNumber.FormNum=@original_FormNum )

IF @AvailFound > 0 OR @AssignedFound > 0 /* It is ok if no rows found on available table, continue on to Assigned table, otherwise stop the deletion.*/
-----This means the delete can't happen...........
BEGIN

IF @AssignedFound > 0 AND @AvailFound = 0
BEGIN
SET @NewRetVal = 1
END

IF @AssignedFound > 0 AND @AvailFound > 0
BEGIN
SET @NewRetVal = 2
END

IF @AssignedFound = 0 AND @AvailFound > 0
BEGIN
SET @NewRetVal = 3
END
END

ELSE
BEGIN
DELETE FROM dbo.Form
WHERE dbo.Form.FormNum=@original_FormNum

SET @NewRetVal = 0
---Successful deletion
END
GO
 --------------------------------------------------------  When I go into the debug mode and do a quickwatch, the NewRetVal is showing as string input.

View 2 Replies View Related

Using A Database Field In A Session Parameter

Feb 26, 2007

Hi,
I'm using the SQL Datasource control. I want to use a value of a row in a session control parameter.
I have something like this now:
<asp:SessionParameter Name="ArticleType" SessionField="Article_type_" & number_in_gridview />
 number_in_gridview
must be filled with a value in the gridview of the current row.
 Does anybody how to do this ?
Regards,
Vortex

View 1 Replies View Related

Sql Insert, Capture Scope_Identity Output To Session Variable?

May 24, 2007

What C# code would capture the Scope_Identity value (CoDeptRowID) output by the code below? Do I even need to capture it or is it already available as a C# variable CoDeptRowID ? I can't seem to get my hands on it!
SqlDataSource1.Insert();<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
InsertCommand="INSERT INTO [CompanyDepartment] ([User_Name], [FirstName], [LastName]) VALUES (@User_Name, @FirstName, @LastName);
SELECT @CoDeptRowID = SCOPE_IDENTITY()"
<insertparameters>
<asp:sessionparameter Name="User_Name" Type="String" SessionField ="LoginName"/>
<asp:controlparameter Name="FirstName" Type="String" ControlID="TextBox1" PropertyName ="text"/>
<asp:controlparameter Name="LastName" Type="String" ControlID ="TextBox2" PropertyName ="text"/>
<asp:Parameter Direction =Output Name ="CoDeptRowID" Type ="Int32" DefaultValue = "0" />
</insertparameters>
</asp:SqlDataSource>

View 5 Replies View Related

Local Or Global Variable In An Interaction Session Of The SQL Analyzer

Jul 20, 2005

Hi,I am new to SQL. Please bear with me and allow me to ask a dumbquestion.I am debugging a stored procedure (written in Trans-SQL), and I foundthat the SQL analyzer that I use doesn't have a debugger. All I cando it is execute a block of code and see what is going on in aninteraction seesion of the SQL analyzer. I would need to declare somevariable to hold values of the previous query in the interactivesession.I understand that this can be easily done in a stored procedure viathe Declare command (e.g., Delcare @order_no int). Is similarfunctionality exists in an interaction session of the SQL analyzer?If so, what is the command. Please advise.Thank you very much for the help.Alex

View 1 Replies View Related

Create Session Model With Missing Value Parameter

Jan 28, 2008

Hi, I created a Session model via the following

CREATE SESSION MINING MODEL test
(
HCVS_MemberId Text KEY,
HCVS_MeasureDate_Float LONG KEY TIME,
HCVS_MeasureDate Date Discrete,
SysPressure LONG CONTINUOUS PREDICT,
DiaPressure LONG CONTINUOUS PREDICT,
Pluse LONG CONTINUOUS PREDICT
) USING Microsoft_Time_Series ;

How do I specify that I would like to Mean to fill the gap of missing values?

Thanks,
Ricky.

View 1 Replies View Related

How To Write A SELECT Statement And Store The Result In A Session Variable

Nov 6, 2007

I'm sure this is a very simple piece of code, but I'm having trouble understanding how to do this.
First I have a database with three columns


ContactID

View 1 Replies View Related

How Can I Capture Update Query Session...

Nov 4, 2007

Hi guys,

A column in my table is being updated and I would like to find out what process, host, user, etc. is performing the update.

I have added a trigger to the table so that when an update occurs I am able capture the session details into a table, however the session details that are being returned are those of the actual trigger rather than those of the original query.

The statement that I am using to capture the session details is...

select * from sys.dm_exec_connections cross apply sys.dm_exec_sql_text(most_recent_sql_handle) where session_id = @@spid

There is a parent_session_id returned in the above which I hoped might give me some pointers but this is always NULL.

I have been working my way through the system dynamic views in the hope that one of them will provide the information I am looking for but so far I've had no luck.

Because the system I am troubleshooting is web based the actual server and user details will be those configured as service accounts for the application but if I am able to show the developers the original query that was used for the update I'm sure they will be able to provide valuable information as to which component it is coming from. I imagine SQL will also be able to tell me which host is sending the query. With these two bits of info I'm sure I'll be able to track it down.

Our suspicion is that an old component is running somewhere and I'd like to be able to track it down. Perhaps I've spent too much time looking at this but I'm coming to the conclusion that it may not be possible from the SQL back end, which I am very surprised at.

I have tried capturing every session that was running at the time of the update but there's simply too much info to deal with. I even searched through these results but there's so many different possible combinations that an update statement might take form that it quickly became a worthless exercise.

Perhaps one of you can resolve this for me. Any ideas?

Regards,

Joe

View 7 Replies View Related

What Is The Best Parameter To Use For A Sqldatasource When The Parameter Is The Sqlmembership Username?

Mar 15, 2008

I know i can accomplish this by setting a session variable on page load on the server side (Session["UserName"]= User.Identity.Name) and then use a session parameter, but I was wondering how to do it without using session variables, i was hoping the following code would work, but it doesn't. Thanks for any ideas.





" Name="UserName" Type="String" />

View 3 Replies View Related

Reporting Services :: Procedure Or Function Create Session Expects Parameter Which Was Not Supplied

Jun 4, 2015

When i open any reports getting the below error message.An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database.

(rsReportServerDatabaseError)Procedure or function 'CreateSession' expects parameter '@SiteZone', which was not supplied.  

View 7 Replies View Related

Parsing An Input Variable

Apr 15, 1999

Does anyone know how to parse an input variable to a stored proc? For example, if I have an input variable that is: 'ford,chevy,pontiac' how do I parse through this variable and handle each value independently?

Since I do not know how many values may exists I can't do it based on a set amount of input variables.

View 3 Replies View Related

How To Set Input Xml Name And Folder From Variable

Mar 18, 2008

Hey Guys,

Heres my issue. please help

I have xml files and xslt files are in seperate folders. and each xml file has its own xslt. I've got the for loop riunning which loops thro the metadata table. This table has the file and folder localtions of xml and its corresponding xslt.
I'm using the transform xml task in control fllow. i dont see an option to set input xml name and folder from Variable in transform xml component properties? It seems to expect fully qualified path. is there an alternative? or what am i doing wrong?

View 5 Replies View Related

How To Input A DOS Variable Into A Stored Procedure

May 4, 2004

I am trying to Execute a Stored Procedure using Call OSQL from a .bat file, and passing a DOS variable to the Stored Procedure.

The DOS variable is established in the DOS command...

set SERVERJOB=JOBNAME

I have tried...

EXEC sp_procedure %SERVERJOB%

With this, I get an error...

sg 170, Level 15, State 1, Server ABCDEFGH, Line 20
Line 20: Incorrect syntax near '%'.

If I put the variable name in quotes on the EXEC statement above, the value used is the variable name, %SERVERJOB% itself rather than the value the variable was set to, which would be JOBNAME in the above example.

Any ideas??? Thanks!

View 2 Replies View Related

Variable Number Of Input Columns

May 2, 2007

We are trying to use the Import/export wizard to load a text file to a SQL Server 2005 database. The input file has a variable number of columns per row. For example, the first row has 3 columns, the second has 7, the third has 3, etc. The number of columns varies from 2 to 9 in the input file. The columns are separated by an uptick (`) and the rows are terminated by {CR}{LF}. We are using code page 1252. On processing, the wizard reads the first row (with 3 columns) ok, but then assumes all the other rows have 3 columns and parses the rows accordingly, ignoring the field and row terminators.

The process worked fine with SQL Server 2000. Is there some setting that we are missing, or some configuration on the database that we should be checking?



Thank You

View 3 Replies View Related

Using Input Variable With .NETODBC Provider

Oct 29, 2007



In my data flow task, I use a data reader source to get data from our 400. Currently, I have a simple sql command that is pulling data from a file qualifying by date, which is hard-coded. I would like to pass in a parameter which has the date in it. How can I do this? Thanks!

View 8 Replies View Related







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