Installation Procedure When Adding Extra Components Afterwards

Dec 20, 2007

(6th attempt to post this on the forum - problems with the forum?)

Hello

Assume that you have SQL Server 2005 Standard Edition installed but only the Database Services and you patched it with SP2. Now assume that you need to install all the other components like Notification Services and Reporting Services, what are the correct steps to follow?

I tried this once this failed miserably and ended up in completely having to uninstall SQL Server 2005 and completely reinstalling it. Luckily for me this was a demo machine.

See:
http://gabriel.lozano-moran.name/blog/PermaLink,guid,6a81a3a9-45d3-4221-8b16-ba4e4863949c.aspx

Thanks

Gabriel

View 3 Replies


ADVERTISEMENT

Adding Extra Steps To A Create User Wizard Asp.net (c#)

Feb 25, 2008

 Hi, Apologies in advance if you get confused by reading this.... I am trying to create an additional step in the Create Wizard User Control that is provided by ASP.net. The additional step that I want to add will come after a user will create their username, password, email etc. The information which I want to save in the extra step are details such as firstname, lastname, address, height, weight etc. (I am creating an online weight management system for dieticians).When I  run through the application, the username, password etc save perfectly to the database, but nothing happens with the other "personal information". There are no errors thrown so I don't know where the problem is coming from.I have included the code below as I have it:The code behind the Register.aspx file is as follows: <asp:SqlDataSource ID="InsertExtraInfo" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>" InsertCommand="INSERT INTO [aspnet_UserInformation] ([first_name], [surname], [address1], [address2], [city], [country], [number], [height], [weight]) VALUES (@txtFirstName, @txtSurname, @txtAddress1, @txtAddress2, @txtCity, @txtCountry, @txtNumber, @txtHeight, @txtWeight)" ProviderName="<%$ ConnectionStrings:ASPNETDBConnectionString1.ProviderName %>"> <InsertParameters> <asp:ControlParameter Name="txtFirstName" Type="String" ControlID="txtFirstName" PropertyName="Text" /> <asp:ControlParameter Name="txtSurname" Type="String" ControlID="txtSurname" PropertyName="Text" /> <asp:ControlParameter Name="txtAddress1" Type="String" ControlID="txtAddress1" PropertyName="Text" /> <asp:ControlParameter Name="txtAddress2" Type="String" ControlID="txtAddress2" PropertyName="Text" /> <asp:ControlParameter Name="txtCity" Type="String" ControlID="txtCity" PropertyName="Text" /> <asp:ControlParameter Name="txtCountry" Type="String" ControlID="txtCountry" PropertyName="Text" /> <asp:ControlParameter Name="txtNumber" Type="String" ControlID="txtNumber" PropertyName="Text" /> <asp:ControlParameter Name="txtHeight" Type="String" ControlID="txtHeight" PropertyName="Text" /> <asp:ControlParameter Name="txtWeight" Type="String" ControlID="txtWeight" PropertyName="Text" /> </InsertParameters> </asp:SqlDataSource>
 Then the code I have behind the Register.aspx.cs page is: protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)    {        TextBox UserName = (TextBox)CreateUserWizard1.FindControl("UserName");        SqlDataSource DataSource = (SqlDataSource)CreateUserWizard1.FindControl("InsertExtraInfo");                MembershipUser User = Membership.GetUser(UserName.Text);        //object UserGUID = User.ProviderUserKey;        DataSource.InsertParameters.Add("UserId", UserGUID.ToString());        DataSource.Insert();    } I know there is a problem with the code on the aspx.cs page but I cant figure it out. I need the username / password information to relate to the personal details information. I know I have to create a foreign key in the asp_UserInformation table that will link to the username in the asp_Membership (where all the username / password info is stored) Any help will do, I'm almost in tears here!!!The Spud 

View 1 Replies View Related

Aggregate Functions - Adding Extra Column With Another Field

Jun 13, 2014

I have a simple query like:

select max(PTR_DATE)
from MPR_portfolio_transactions
group by PTR_SYMBOL

and this is working fine, but if I add an extra column with another field like:

select max(PTR_DATE) , PTR_SHAREBALANCE
from MPR_portfolio_transactions
group by PTR_SYMBOL

Then I get an error message like:

Column 'MPR_portfolio_transactions.PTR_SHAREBALANCE' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

How can I get round to this?

View 6 Replies View Related

Components Installation

Sep 29, 2006

I am just a novice, and am curious.I

I was trying subscription, but an error occured: "Microsoft Server Management Studio is un able to accessreplication components because replication is not installed on this instance.



I went to change, located my setup exe, installed. but at the end, I get this message: No selected features can be installed or upgraded. Setup cannot proceed since no effective change is being made to the machine......

I downloaded the Express edition via MSDN download.



May somebody please help? What wrong did I do? What did I miss to do?

View 4 Replies View Related

Transact SQL :: Field Not Update Correctly - Adding Extra Duplicated Row

Oct 8, 2015

I have the following querry :

SELECT APHIST.ReturnDate AS ATDATE
,API_HIST.[ActionPlanItemID]
,API_HIST.[ActionPlanID]
,PIT.[ProductItemID]

[Code] ....

It produced the following result

Based on my querry when n=2, it should be set to 0, why it cannot be set ?

if I added the value 2 to the list of values as below :

CROSS APPLY (Values(0),(1),(2)) d(n)

Then the value  n=2 is updated but it adds  extra duplicated rows which is not part of my real

View 11 Replies View Related

Do I Need To Reapply SP1 After Adding New Components?

Jul 28, 2006

Hello,

I applied SQL 2005 SP1 and hotfixes to my instance. Now I found the SQL_replication component was not installed. I just installed that component.

1. Do I need to reapply SP1? Then hotfixes?

2. Will reapply SP1 or hotfixes cause problems? I tried on my test server, the SP1 install failed with some errors the first time. It went through Ok the second time. (I have 3 instances on this test server. I only added new component to one instance. When applying SP1 the second time, the installer forces me to apply on all instances and tools; causing outage to all instances. The installer did not force me when I applied SP1 the first time.)

I wonder what is the best practice for handling this case.

thanks,

ktmd

View 1 Replies View Related

Adding SCRIPT And LOOK UP Components Using C#

May 29, 2006

Hi,

Could you please tell me how to add SCRIPT and LOOK UP component to a data flow using C#? Also, is there any artilces/site which gives information about the SSIS programming?



Regards,

Gopi

View 4 Replies View Related

Your Upgrade Is Blocked.. When Adding Components To SQL 2005 Standard Edition SP1

Sep 28, 2006

Name: Microsoft SQL Server 2005 Tools

Hello,

I am having a problem when trying to add the Client Components to an existing installation of SQL 2005 Standard Edition SP1 running on Windows 2003 Standard. The server was originally built with SQL 2005 Standard Edition and had SP1 installed at a later date. I am using the CD that SQL was originally installed with which is not a service packed copy of SQL. The reason given when clicking the details button is as follows:

Reason: Your upgrade is blocked. For more information about upgrade support, see the "Version and Edition Upgrades" and "Hardware and Software Requirements" topics in SQL Server 2005 Setup Help or SQL Server 2005 Books Online.

Build version check:

Your upgrade is blocked because the existing component is a later version than the version you are trying to upgrade to. To modify an existing SQL Server component, go to Add or Remove Programs in Control Panel, select the component you would like to modify, and then click Change/Remove.

Any help would be greatly appreciated.

Regards

Steve

View 23 Replies View Related

Force Client Components Using A Commmand Line Installation To Diffrent Location

Jan 12, 2007

Is it possible to force the SLQ 2005 Client Components to be installed into a diffrent location other than the default location?


What I'm trying to do is run the setup command though the command line to create an unattended client installation with all the client componets to a diffrent location that

Thanks, Any information or examples would be great!

View 1 Replies View Related

SQL Server 2005 Installation Woes For Workstation Components And Client Tools

Apr 27, 2008


Hello,

I have installed successfully Microsoft SQL server 2005 in MSCS.

However the set up did not install Workstation components (client tools - SSMS etc).

I have successfully installed workstation components in one node of cluster.

However setup is giving following error while installing workstation components on other node. (From this node MS SQL server 2005 was installed).

Product: Microsoft SQL Server 2005 Tools -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action SqlWbSetup.5F46584E_060D_4BCB_ADEE_BD15A7BFCC2A, location: C:Program FilesMicrosoft SQL Server90ToolsBinnVSShellCommon7IDESqlWb.exe, command: /setup

There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.

I did "C:Program FilesMicrosoft SQL Server90ToolsBinnVSShellCommon7IDESqlWb.exe, /setup".

It executed but no error, no output.

Any gues, help in isolating issue?

Any more information required.(Media is ok. Setup has been tried after reboot. There is enough disk space.)

Regards.

Mahesh
===========
Setup

1) Microsoft Cluster of two nodes.
2) Hardare - HP Blade servers
3) OS - Windows 2003 EE with SP2
4) SQL Server 2005 Standard Edition with SP2.

=============================

MSI (s) (B0:7C) [17:40:20:390]: Note: 1: 1722 2: SqlWbSetup.5F46584E_060D_4BCB_ADEE_BD15A7BFCC2A 3: C:Program FilesMicrosoft SQL Server90ToolsBinnVSShellCommon7IDESqlWb.exe 4: /setup
MSI (s) (B0:7C) [17:47:23:609]: Product: Microsoft SQL Server 2005 Tools -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action SqlWbSetup.5F46584E_060D_4BCB_ADEE_BD15A7BFCC2A, location: C:Program FilesMicrosoft SQL Server90ToolsBinnVSShellCommon7IDESqlWb.exe, command: /setup


MSI (s) (B0:7C) [17:47:35:921]: Note: 1: 1729
MSI (s) (B0:7C) [17:47:35:921]: Product: Microsoft SQL Server 2005 Tools -- Configuration failed.

MSI (s) (B0:7C) [17:47:35:953]: Cleaning up uninstalled install packages, if any exist
MSI (s) (B0:7C) [17:47:35:953]: MainEngineThread is returning 1603
MSI (s) (B0:A0) [17:47:36:062]: Destroying RemoteAPI object.
MSI (s) (B0:80) [17:47:36:062]: Custom Action Manager thread ending.

View 1 Replies View Related

Adding 'unaware' SQL Server 2005 Components To Existing Windows 2003 Cluster

Feb 11, 2008



This is a fresh install of SQL Server 2005 (64bit) on a Windows 2003 R2 SP2 64bit OS. The Cluster has been built and SQL 2005 has been installed (Database Engine(clustered), Analysis Server(clustered), Notification Server, Integration Server, Reporting Services). SQL 2005 SP2 has been installed.

Now, I want to install Notification Server, Integration Server and Reporting Services on the second node for high availability.

When I select 'Install New Components' from Add/Remove Programs, the System Configuation Checker tells me theres a version difference and to:


To change an existing instance of Microsoft SQL Server 2005 to a different edition of SQL Server 2005, you must run SQL Server 2005 Setup from the command prompt and include the SKUUPGRADE=1 parameter.



I'm using the same binaries as the original install. Could this be a result of installing SQL 2005 SP2?

Can someone help me out with this. I'd prefer using the setup interface instead of a command line script.

View 4 Replies View Related

SQL Server 2005 Express Installation Problem: Incompatible Components From Beta Version Of .NET Framework

Oct 21, 2005

Hi all,
Yesterday, I just downloaded the SQL Server 2005 Express (SQLEXPR.EXE) and tried to install it in my Windows XP Pro PC that is on Microsoft NT 4 LAN System. I got the following error:                                                                        Microsoft SQL Server 2005 CTP setup                                                        The Microfost .NET Framework 2.0 is not installed. Please install before running setup.
This morning, I downloaded the NET Framework Version 2.0 Redistributable Package Beta 2 (x86) from the Microsoft Download Center and installed it in my Windows XP Pro PC. Then I tried to install the SQL Server 2005 Express (SQLEXPR.EXE) again. This time I got a new error:                                                                                                   SQL Server 2005 Setup has detected incompatible components from beta versions of Visual Studio, .NET Framework, or SQL Server 2005. Use ADD or Remove Programs to remove these components, and then run SQL Server 2005 Setup again. 
I am confused and lost in this installation problem.  Was the .NET Framework Version 2.0 Redistributable Package Beta 2 (x86) a wrong Microsoft .NET Framework 2.0 I downloaded and installed in my PC?  Where is the right Microsoft .NET Framework 2.0 for the SQL Server 2005 Express?  Please help and advise.
Thanks in advance,
Scott  Chang    

View 23 Replies View Related

Developing Custom Components By Extending The SSIS Stock Data Flow Components

Sep 7, 2006

Everything I've read says that custom data flow components are built by inheriting from the Microsoft.SqlServer.Dts.Pipeline.PipelineComponent class.

But the stock components such as the Derived Column data flow transformation must each be implemented by their own class. So how do I base my custom components on those classes? The documentation for the PipelineComponent class doesn't list any such subclasses.

View 1 Replies View Related

Using Composition To Create New Specialised Components From Multiple Sub-components?

Jun 30, 2006

Hi,

In another thread Jamie Thomson very informatively said "The components in SSIS
are deliberately atomic (i.e. they do something very specific) so that
its easy to put them together to build something greater than the sum
of the parts". Which does make a lot of sense. However, I've been finding that I end up having to create exactly the same "pattern" of combined transform components again and again in order to solve the same problem but in different dataflows (or even within the same dataflow). Cut-and-paste-tastic! In order to obtain real re-use, it seems to me like SSIS is crying out for an easy way to create new components by using composition - i.e. the ability to take commonly-used combinations of existing components and create new "super" components (without having to write Custom Transform Components in C#/VB.Net and handle everything in code).

Does anyone know if this sort of functionality is likely to make it into SSIS in the forseeable future?

Regards,

Lawrie

View 6 Replies View Related

SQL 2012 :: Specify Server Installation Location When Adding Second Node To Cluster

Jun 6, 2014

When adding a node to a SQL Server 2012 Standard edition cluster, how I do I identify the location for SQL server shared components and the rest of the SQL Server installation binaries?

When adding a node to a SQL Server 2012 Standard edition cluster all the binaries went to the C: drive default location. We put those files on a different drive when installing the first node. What needs to be done so both nodes have the binaries on the same drives and folders?

View 3 Replies View Related

Setup And Upgrade :: Adding Database Instance To Existing Installation - No Media

Sep 2, 2015

I have an existing, licensed installation of SQL 2008 R2, with one database instance.  I need to add a second instance, but do not currently have access to the installation media.  Can I use the Microsoft® SQL Server® 2008 Enterprise

Evaluation: Trial Experience for IT Professionals installer that's available for download from the Microsoft download site?

View 3 Replies View Related

Setup And Upgrade :: Cluster Installation Failed On Adding Node To Cluster

Oct 10, 2015

During the installation of Adding node to a SQL Server failover cluster(On passive node) getting error like.. The MOF compiler could not connect with the WMI server. This is either because of a semantic error such as an incompatibility with the existing WMI repository or an actual error such as the failure of the WMI server to start.We  run the below commands but didn’t get any resolution & got the same above error .
 
1<sup>st</sup> Method…

1. Open console command (Run->CMD with administrator privileges). 

2. net stop winmgmt 

3. Rename folder %windir%System32WbemRepository to other one, for backup purposes (for example _Repository). 

4. net start winmgmt

2<sup>nd</sup> Method..

1. Disable and stop the WMI service.

a) Command : - sc config winmgmt start= disabled

b. Command : -                 net stop winmgmt

2. Run the following commands.

a).  Command:  Winmgmt /salvagerepository %windir%System32wbem

b). Command:   Winmgmt /resetrepository %windir%System32wbem

3. Re-enable the WMI service

Command:          sc config winmgmt start= auto 

Last command to run after above steps

4. Command:     mofcomp "%programfiles(x86)%Microsoft SQL Server100Sharedsqlmgmproviderxpsp2up.mof"

File not found Error for above command.

View 3 Replies View Related

Need Help Adding Onto My Stored Procedure

Apr 6, 2005

calculate age:CREATE PROCEDURE selectage ASSELECT Age = datediff(yy, birthday, getdate()) + case when datepart(dy, birthday) <= datepart(dy, getdate()) then 0 else -1endFROM nopaymy ? is how do fix this problem:I add inWHERE (((Age)>= @age1 And (Age)<= @age2)) and it will complain about Age is not a column, so how would i store the underlined and bold Age aboves value?

View 6 Replies View Related

Adding New Stored Procedure

Mar 27, 2006

Currently I add a new stored procedure in Enterprise Manager by right-clicking Stored Procedure and clicking New Stored Procedure then copy/paste text of procedure into window displayed. Whenever we set up new customer, this process is repeated several times to get all of our stored procedures loaded.
Is there a way to automate this process?
Thanks

View 2 Replies View Related

Adding Stored Procedure

Jan 31, 2008



Hello,

What is the easiest way to add a strored prodedure in SQL- server? Sounds like silly question but it doesn´t seem that obvious to me.

BTW, I´m using SQL-server 2005.

Thanks in advance!

View 6 Replies View Related

Adding CLR Stored Procedure In ASP.Net Website

Apr 12, 2007

Hi all,I am creating a ASP.Net 2.0 website and in it I had to create a CLR stored procedure to do a complex sql procedure. Coming to the problem I created the CLR stored procedure as a different database project . I wanted to know whether its possible to add the CLR managed code into my exisiting ASP.Net project in which case I should get the dll for this stored procedure in order to deploy the stored proc in the SQL Server.Or is there some simplified approach to using clr stored procedures in an ASP.Net project.

View 2 Replies View Related

Adding A Variable To A Stored Procedure

Jul 19, 2007

Hi,I just try to add a variable (ORDER BY) to the end of a select statement and it doesn't work. I try so many things but im a newbie in SQL.Help!!!I want to add @OrderBy at the end of :-----------------SELECT *FROM AnnoncesWHERE CategoryID = @CategoryID AND DateOnCreate >= @DateFinale-----------------My declaration :Declare @OrderBy nvarchar(50)If @Sort = 'date_de' set @OrderBy = ' ORDER BY DateOnCreate DESC'Else  set @OrderBy = ' ORDER BY DateOnCreate ASC'

View 8 Replies View Related

Adding Procedure To SQL Server Express

May 18, 2006

I am adding (trying to add) a procedure (written by a friend of mine and someone who is experienced). I am adding it via the SQL Server Mgt. Studio Express. When I run it, it says that the command completed successfully, but it doesn't appear in the Procedure folder.

When I run my ASP 2.0 form that calls it, it says that it can't find the procedure.

Can anyone help me determine what to look for or what I might be doing wrong?

Thank you.

View 3 Replies View Related

Procedure Expects Parameter Error When Adding To DB

May 15, 2007

Hi,I'm trying to create a page where a user can search the database according to some criteria and get back the result in the form of a GridView. Also, the user has the option of saving the criteria to another table in the database by assigning it a name so that it can be retrieved easily in the future.I have the search and display part working, however, saving the criteria to the database is giving problems for some reason.Given below is my stored procedure to add the info to the db.  SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AddToReport]
(@ReportName varchar(100), @ProjID varchar(300), @DeptCode varchar(20), @ProjType varchar(20), @ProjectTitle varchar(300),
@ProjectManagerID int, @DateRequested datetime, @DueDate datetime, @ProjectStatusID int)

AS
SET NOCOUNT ON
DECLARE @Dept varchar(50)
DECLARE @err int

BEGIN TRANSACTION

IF @ReportName IS NULL
BEGIN
RETURN -1
END
ELSE
BEGIN
IF @DeptCode IS NOT NULL
BEGIN
SET @Dept = REPLACE(CONVERT(char,@DeptCode),'.','')
END
SET @err = @@ERROR


INSERT INTO dbo.tbl_Report (ReportName, ProjID, DeptCode, ProjType, ProjectTitle, ProjectManagerID, DateRequested, DueDate, ProjectStatusID)
VALUES (@ReportName, @ProjID, @Dept, @ProjType, @ProjectTitle, @ProjectManagerID, @DateRequested, @DueDate, @ProjectStatusID);
IF @err<>0
BEGIN
ROLLBACK TRANSACTION
RETURN @err
END
END
COMMIT TRANSACTION Given below is the relevant codebehind.  This is how the values are initialized:   Dim newManager As New ListItem
newManager.Text = "Choose a Manager"
newManager.Value = 0
projectManagerDDL.Items.Add(newManager)

Dim newDept As New ListItem
newDept.Text = "Choose a Department"
newDept.Value = ""
deptCodeDDL.Items.Add(newDept)

Dim newID As New ListItem
newID.Text = "Choose a Project"
newID.Value = ""
projIDDDL.Items.Add(newID)

Dim newStatus As New ListItem
newStatus.Text = "Choose a Status"
newStatus.Value = 0
projectStatusDDL.Items.Add(newStatus)

Dim newDateRequestedMonth As New ListItem
newDateRequestedMonth.Text = "Month"
newDateRequestedMonth.Value = 0
dateRequestedMonthDDL.Items.Add(newDateRequestedMonth)

Dim newDateRequestedDay As New ListItem
newDateRequestedDay.Text = "Day"
newDateRequestedDay.Value = 0
dateRequestedDayDDL.Items.Add(newDateRequestedDay)

Dim newDateRequestedYear As New ListItem
newDateRequestedYear.Text = "Year"
newDateRequestedYear.Value = 0
dateRequestedYearDDL.Items.Add(newDateRequestedYear)

Dim newDueDateMonth As New ListItem
newDueDateMonth.Text = "Month"
newDueDateMonth.Value = 0
dueDateMonthDDL.Items.Add(newDueDateMonth)

Dim newDueDateDay As New ListItem
newDueDateDay.Text = "Day"
newDueDateDay.Value = 0
dueDateDayDDL.Items.Add(newDueDateDay)

Dim newDueDateYear As New ListItem
newDueDateYear.Text = "Year"
newDueDateYear.Value = 0
dueDateYearDDL.Items.Add(newDueDateYear) This is the submit code:  Protected Sub saveButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim connString As String
Dim con As SqlConnection


Try
connString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("ConnectionString1").ConnectionString

con = New SqlConnection(connString)

Dim cmd As SqlCommand = New SqlCommand()
cmd.Connection = con

If (([String].IsNullOrEmpty(reportNameTextBox.Text) = False) Or reportNameTextBox.Text <> "Enter Report Name") Then
cmd.Parameters.Add("ReportName", SqlDbType.VarChar, 300).Value = reportNameTextBox.Text
End If

If ([String].IsNullOrEmpty(projIDDDL.SelectedItem.Value)) = False Then
cmd.Parameters.Add("ProjID", SqlDbType.VarChar, 30).Value = projIDDDL.SelectedItem.Value
End If

If ([String].IsNullOrEmpty(deptCodeDDL.SelectedItem.Value)) = False Then
cmd.Parameters.Add("DeptCode", SqlDbType.VarChar, 20).Value = deptCodeDDL.SelectedItem.Value
End If

If (typeRBL.SelectedItem.Value <> "All") Then
cmd.Parameters.Add("ProjType", SqlDbType.VarChar, 20).Value = typeRBL.SelectedItem.Value
End If

If ([String].IsNullOrEmpty(projectTitleTextBox.Text)) = False Then
cmd.Parameters.Add("ProjectTitle", SqlDbType.VarChar, 300).Value = projectTitleTextBox.Text
End If

If CInt(projectManagerDDL.SelectedItem.Value) <> 0 Then
cmd.Parameters.Add("ProjectManagerID", SqlDbType.Int).Value = CInt(projectManagerDDL.SelectedItem.Value)
End If

If (dateRequestedDayDDL.SelectedItem.Value = 0 Or dateRequestedMonthDDL.SelectedItem.Value = 0 Or dateRequestedYearDDL.SelectedItem.Value = 0) Then
Dim dateRequested As New DateTime
dateRequested = Nothing
Else
Dim dateRequested As New DateTime(dateRequestedYearDDL.SelectedValue, dateRequestedMonthDDL.SelectedValue, dateRequestedDayDDL.SelectedValue)
If (dateRequested) <> Nothing Then
cmd.Parameters.Add("DateRequested", SqlDbType.DateTime).Value = dateRequested
End If
End If


If (dueDateDayDDL.SelectedItem.Value = 0 Or dueDateMonthDDL.SelectedItem.Value = 0 Or dueDateYearDDL.SelectedItem.Value = 0) Then
Dim dueDate As New DateTime
dueDate = Nothing
Else
Dim dueDate As New DateTime(dueDateYearDDL.SelectedValue, dueDateMonthDDL.SelectedValue, dueDateDayDDL.SelectedValue)
If (dueDate) <> Nothing Then
cmd.Parameters.Add("DueDate", SqlDbType.DateTime).Value = dueDate
End If
End If

If (projectStatusDDL.SelectedItem.Value) <> 0 Then
cmd.Parameters.Add("ProjectStatusID", SqlDbType.Int).Value = CInt(projectStatusDDL.SelectedItem.Value)
End If

cmd.CommandText = "dbo.AddToReport"
cmd.CommandType = CommandType.StoredProcedure

Try
con.Open()
cmd.ExecuteNonQuery()
Response.Write("Report Saved")
Catch ex As Exception
Response.Write(ex)
Finally
con.Close()
con.Dispose()

End Try



Catch ex As ApplicationException
Response.Write("Could not load the database")
End Try

End Sub   The only absolute requirement when saving to the table is the ReportName. All the other criteria can be NULL. If I don't select and values and try to save the values, I get an error:System.Data.SqlClient.SqlException: Procedure or function 'AddToReport' expects
parameter '@ProjID', which was not supplied. at
System.Data.SqlClient.SqlConnection.OnError...  etc If I choose the ProjID (thus giving it a value), I get the following error:System.Data.SqlClient.SqlException: Procedure or function 'AddToReport' expects
parameter '@DeptCode', which was not supplied. at
System.Data.SqlClient.SqlConnection.OnError... etc  and so forth. I'm guessing it's a problem of NULLs somewhere, but I'm not sure. Thanks. 

View 6 Replies View Related

Strored Procedure For Adding Play List

Dec 20, 2007

Hi...
Am working with asp.net with vb for a MusicProject..
In this I have playlist for particular User..ie User Selects Some Songs and clicks on AddToMyPlayList Button....
Here He can insert those songs into a new playlist or update the earlier..
the StroedProcedure is as follws:  'N' means NewPlayList  and 'E' means Existing
 ***************************************************************************************
CREATE PROCEDURE MUSIC_ADD_PLAYLIST    (    @PLAYLIST_NAME VARCHAR(255),    @USER_ID VARCHAR(255),  @ItemList NVARCHAR(4000),  @delimiter CHAR(1),  @FOLDERNAME VARCHAR(255) ,@PLAYLISTTYPE CHAR(1))    AS        SET NOCOUNT ON 
  DECLARE @IDENT INT     
IF @PLAYLISTTYPE = 'N'
BEGIN   INSERT INTO MUSIC_PLAYLIST      (       MUSIC_PLAYLIST_NAME,       MUSIC_PLAYLIST_USER      )            VALUES            (       @PLAYLIST_NAME,       @USER_ID      )       
  SELECT @IDENT=@@IDENTITY FROM MUSIC_PLAYLIST       END  IF @PLAYLISTTYPE='E'
 BEGIN
 SELECT @IDENT=MUSIC_PLAYLIST_ID FROM MUSIC_PLAYLIST WHERE MUSIC_PLAYLIST_USER=@USER_ID  AND MUSIC_PLAYLIST_NAME=@PLAYLIST_NAME
 END
  DECLARE @tempItemList NVARCHAR(4000)        SET @tempItemList = @ItemList            DECLARE @i INT            DECLARE @Item NVARCHAR(4000)            SET @tempItemList = REPLACE (@tempItemList, ' ', '')        SET @i = CHARINDEX(@delimiter, @tempItemList)            WHILE (LEN(@tempItemList) > 0)        BEGIN            IF @i = 0                SET @Item = @tempItemList            ELSE                SET @Item = LEFT(@tempItemList, @i - 1)           -- INSERT INTO @IDTable(Item) VALUES(@Item) 
    INSERT INTO MUSIC_SONGSLIST       (Music_PlayList_Id,Music_SongName,Music_Song_Location)      VALUES      (@IDENT,@ITEM,@FOLDERNAME+''+@ITEM)                  IF @i = 0                SET @tempItemList = ''            ELSE                SET @tempItemList = RIGHT(@tempItemList, LEN(@tempItemList) - @i)            SET @i = CHARINDEX(@delimiter, @tempItemList)        END
GO
***************************************************************************************
Here the problem is am not getting the exact result means if i add 6 songs to a playlist it is adding only 4 songs to that particular playlist..
Please help me out
Thanks in Advance,
Madhavi

View 1 Replies View Related

Adding Field Or Stored Procedure To MSDE

Jan 7, 2004

Is there a way to add a field or a stored procedure to a server running MSDE? Like a script on the command line or?? how can this be done.

Thank you,

View 5 Replies View Related

Adding Date Timestamp To Xp_sendmail Procedure

Jan 10, 2007

I am trying to figure out how to add a time datestamp to my xp_sendmail procedure:

use master;
go

CREATE PROC pr_sendmail
AS

DECLARE @DT DATETIME
SET @DT=GETDATE()

BEGIN

EXEC xp_sendmail @recipients = 'me@work.com',
@message = 'send email from SQL Server Stored Procedure.',
@copy_recipients = 'me@work.com',
@subject = 'Job Started at ', @DT

END

How do I get this to work? Thanks!

View 7 Replies View Related

Question On Adding A Join To The Stored Procedure

Nov 15, 2007

The stored procedure below was working fine and I have added a inner join to it and it stopped working. I have highlighted the new code I have added to the stored procedure in red. Any suggestions on how to solve this issue?

I am getting the below error
Server: Msg 209, Level 16, State 1, Procedure AIG_GetRECON_TRANSACTION, Line 53
Ambiguous column name 'REINS_TYPE_CD'.

below is the query i changed.


ALTER PROCEDURE [dbo].[AIG_GetRECON_TRANSACTION]
@RECON_TRNSCTN_ID int=NULL,
@RECON_ITEM_ID int=NULL,
@DIVISION_ID int=NULL,
@REINS_TYPE_CD int=NULL,
@TRANSACTION_NO char(10)=NULL,
@TRANSACTION_NAME varchar(100)=NULL,
@REF_NUMBER varchar(20)=NULL,
@POLICY_CRS_REF_NO varchar(20)=NULL,
@GL_DTFrom datetime=NULL,
@GL_DTTo datetime=NULL,
@TRANSACTION_CD int=NULL,
@AMOUNT money=NULL,
@FILE_STATUS_CD int=NULL,
@TRNSCTN_OWR_CD int=NULL,
@ISSUE_CD int=NULL,
@SUPP_ISSUE_CD int=NULL,
@IRC_CLASSIFICATION_CD int=NULL,
@UNDER_90_DAYS money=NULL,
@OVER_90_DAYS money=NULL,
@AGING_DAYS_CNT int=NULL,
@VOCHER_NO varchar(50)=NULL,
@LOADED_DTFrom datetime=NULL,
@LOADED_DTTo datetime=NULL,
@SPUsageMode TINYINT = 0 -- This should be the last parameter

AS

-------------------------------------------------------------------------------
-- SP Usage Audit Info -- DO NOT REMOVE
-- All Stored Procedure code MUST be placed between Section 1 and 2 of
-- SP Usage Audit code
-------------------------------------------------------------------------------
-- SP Usaged Section 1 - Declare
-------------------------------------------------------------------------------
DECLARE @SPStartTime DATETIME
SELECT @SPStartTime = GETDATE()
DECLARE @SPEndTime DATETIME
DECLARE @AuditCount INT
-------------------------------------------------------------------------------

SELECT @GL_DTFROM = ISNULL(@GL_DTFROM, CONVERT(DATETIME,'1/1/1900'))
SELECT @GL_DTTO = ISNULL(@GL_DTTO, CONVERT(DATETIME,'12/31/9999'))
SELECT @LOADED_DTFROM = ISNULL(@LOADED_DTFROM, CONVERT(DATETIME,'1/1/1900'))
SELECT @LOADED_DTTO = ISNULL(@LOADED_DTTO, CONVERT(DATETIME,'12/31/9999'))

Begin

SELECT
RECON_TRNSCTN_ID,
RECON_ITEM_ID,
DIVISION_ID,
REINS_TYPE_CD,
TRANSACTION_NO,
TRANSACTION_NAME,
REF_NUMBER,
POLICY_CRS_REF_NO,
GL_DT,
TRANSACTION_CD,
AMOUNT,
FILE_STATUS_CD,
TRNSCTN_OWR_CD,
ISSUE_CD,
SUPP_ISSUE_CD,
IRC_CLASSIFICATION_CD,
UNDER_90_DAYS,
OVER_90_DAYS,
AGING_DAYS_CNT,
VOCHER_NO,
LOADED_DT,
REI.REINS_TYPE_DS

FROM AIGNET.dbo.RECON_TRANSACTION AS RE
INNER JOIN REINSURANCE_TYPE REI ON RE.REINS_TYPE_CD = REI.REINS_TYPE_CD
WHERE
(@RECON_TRNSCTN_ID IS NULL OR @RECON_TRNSCTN_ID=RE.RECON_TRNSCTN_ID)
AND
(@RECON_ITEM_ID IS NULL OR @RECON_ITEM_ID=RE.RECON_ITEM_ID)
AND
(@DIVISION_ID IS NULL OR @DIVISION_ID=RE.DIVISION_ID)
AND
(@REINS_TYPE_CD IS NULL OR @REINS_TYPE_CD=RE.REINS_TYPE_CD)
AND
(@TRANSACTION_NO IS NULL OR @TRANSACTION_NO=RE.TRANSACTION_NO)
AND
(@TRANSACTION_NAME IS NULL OR @TRANSACTION_NAME=RE.TRANSACTION_NAME)
AND
(@REF_NUMBER IS NULL OR @REF_NUMBER=RE.REF_NUMBER)
AND
(@POLICY_CRS_REF_NO IS NULL OR @POLICY_CRS_REF_NO=RE.POLICY_CRS_REF_NO)
AND
((RE.GL_DT IS NULL) OR (RE.GL_DT BETWEEN @GL_DTFrom AND @GL_DTTo))
AND
(@TRANSACTION_CD IS NULL OR @TRANSACTION_CD=RE.TRANSACTION_CD)
AND
(@AMOUNT IS NULL OR @AMOUNT=RE.AMOUNT)
AND
(@FILE_STATUS_CD IS NULL OR @FILE_STATUS_CD=RE.FILE_STATUS_CD)
AND
(@TRNSCTN_OWR_CD IS NULL OR @TRNSCTN_OWR_CD=RE.TRNSCTN_OWR_CD)
AND
(@ISSUE_CD IS NULL OR @ISSUE_CD=RE.ISSUE_CD)
AND
(@SUPP_ISSUE_CD IS NULL OR @SUPP_ISSUE_CD=RE.SUPP_ISSUE_CD)
AND
(@IRC_CLASSIFICATION_CD IS NULL OR @IRC_CLASSIFICATION_CD=RE.IRC_CLASSIFICATION_CD)
AND
(@UNDER_90_DAYS IS NULL OR @UNDER_90_DAYS=RE.UNDER_90_DAYS)
AND
(@OVER_90_DAYS IS NULL OR @OVER_90_DAYS=RE.OVER_90_DAYS)
AND
(@AGING_DAYS_CNT IS NULL OR @AGING_DAYS_CNT=RE.AGING_DAYS_CNT)
AND
(@VOCHER_NO IS NULL OR @VOCHER_NO=RE.VOCHER_NO)
AND
((RE.LOADED_DT IS NULL) OR (RE.LOADED_DT BETWEEN @LOADED_DTFrom AND @LOADED_DTTo))


End


-------------------------------------------------------------------------------
-- SP Usage Audit Info -- DO NOT REMOVE
-- SP Usage Section 2 - INSERT Audit Info
-------------------------------------------------------------------------------
SELECT @AuditCount = @SPUsageMode +
(SELECT ParameterFlag FROM DBPerfMon.dbo.SPUsageParameters WITH (NOLOCK)
WHERE Parameter = 'SPUsageByPass')

IF @AuditCount < 1

Begin
SELECT @SPEndTime = GETDATE()
INSERT DBPerfMon.dbo.SPUsage (
DatabaseName
, Duration
, ObjectID
, ObjectName
, UserName
)
SELECT
DB_NAME()
, DATEDIFF(ms, @SPStartTime, @SPEndTime)
, OBJECT_ID(OBJECT_NAME(@@PROCID))
, OBJECT_NAME(@@PROCID)
, dbo.fncGetLastUpdatedBy ()
End

-------------------------------------------------------------------------------
-- Absolutely NO Stored Procedure code written beyond this point
-------------------------------------------------------------------------------

View 5 Replies View Related

Transact SQL :: Adding Values In Row Using Stored Procedure

Aug 18, 2015

I'm trying to write a stored procedure that performs a select statement of the RequestID column and the total of the disk size for that row. ie the values on RequestAdditionalDisk1Size + RequestAdditionalDisk2Size + RequestAdditionalDisk3Size where the Requester equals a certain value. I can perform the select statement fine on the individual values, how to add the values of the Disk sizes together and present that back in the select statement.So far the code looks like but is giving me an error around the line performing a SUM.

-- Author:<Author,,Name>
-- Create date: <Create Date,,>
-- Description:<Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[spMyRequests]
-- Add the parameters for the stored procedure here

[code]....

View 2 Replies View Related

SQL Server 2012 :: Adding Some Text To A Stored Procedure

Jul 21, 2015

I have made this defination for a stored procedure:

PROCEDURE EP_Conterbalances
@Start_Date_For_Totals_Date DATETIME,
@EmpFilterAddDuty VARCHAR(500),
@CounterBalanceType_id INT,
@dateFrom DATETIME,

[Code] .....

The value of @EmpFilterAddDuty could be:

'SELECT E.EmployeeID FROM dbo.EmployeeGroupMapToEmployee E, dbo.Per_Budget B WHERE E.EmployeeID = B.PER_PERSONAL_ID AND B.PEB_Budget_id = 243 AND E.EmployeeGroupID IN (SELECT H.Id FROM dbo.EmployeeGroup H WHERE H.InstitutionsId = 22) GROUP BY E.EmployeeID '

If i Replace @EmpFilterAddDuty with this in a QUERY, it gives me the expected result, but if i try to execute the stored procedure.:

DECLARE@return_value int
EXEC@return_value = [dbo].[EP_Conterbalances]
@Start_Date_For_Totals_Date = N'20120831',
@EmpFilterAddDuty = 'SELECT E.EmployeeID FROM dbo.EmployeeGroupMapToEmployee E, dbo.Per_Budget B

[Code] .....

I get this error code:

Conversion failed when converting the varchar value 'SELECT E.EmployeeID FROM dbo.EmployeeGroupMapToEmployee E, dbo.Per_Budget B WHERE E.EmployeeID = B.PER_PERSONAL_ID AND B.PEB_Budget_id = 243 AND E.EmployeeGroupID IN (SELECT H.Id FROM dbo.EmployeeGroup H WHERE H.InstitutionsId = 22) GROUP BY E.EmployeeID ' to data type int.

I really do not understand why SQL 2012 tries to convert the value to an int, and I want to know how to pass the text string.

View 4 Replies View Related

Adding Field To Stored Procedure For Crystal Reports

Jul 20, 2005

Hello:I have a stored procedure for generating our invoices in CrystalReports. I have added a new field to the SP, but when I try to add thefield to my Crystal Report invoice, the field isn't available in thelist. However, if I create a new, blank report using the same storedprocedure as the datasource, the field is available. I've seeminglytried every iteration of "Verify Database" to no avail.The obvious answer would be to simply drop the sp from my existingreport and then re-add it. However, if you do this, all your fields onthe report are dropped.Any ideas?Thanks,Scott

View 1 Replies View Related

Transact SQL :: Adding Stored Procedure To Master Database?

Apr 24, 2015

I have a SQL server instance being used as our data warehousing environment. The instance consists of several databases that I am snapshotting as part of our high availability strategy for data. I've created a stored procedure that takes the source database as an argument and that will create a new snapshot when a new one needs to be created and will also automatically remove the old snapshot. It also updates some synonym tables that point to the new snapshot but that might not be an important detail.

I would like to have the stored procedure stored some place global to all of the databases that I am routinely snapshotting, but that would mean putting it in the master database. Although having it there makes things significantly better in terms of usability, it seems like there's something wrong with putting any stored procedures in the master database. Am I wrong? Is it OK to put stored procedures there in situations like this?

View 4 Replies View Related

Newbie Question: Adding A Single Value To A List In A Stored Procedure

Apr 20, 2006

I have two tables. UserIds is a collection of users, with UserId as the primary key. Contacts simply maps pairs of users. Think of it like IM, where one user can have multiple contacts.


UserIds
----------
UserId - int, primary key
Username etc

Contacts
-------------
UserId - int, the UserId of the user who has the contact
ContactUserId - int, the UserId of the contact

I also have a stored procedure named GetConnectedUserIds that returns all the contacts of a given user. It takes a single parameter, @UserId, the UserId of the user whose contacts I want to get. That's pretty simple:


SELECT ContactUserId FROM Contacts WHERE UserId=@UserId.

Now here's where I get over my head. I actually want that stored procedure to return the user's contacts AND the user's own ID. I want the SELECT statement above, but tack on @UserId to the end of it.

How do I do that?

Thanks in advance for any help. Feel free to answer here or to point me to a useful resource.



Nate Hekman

View 5 Replies View Related







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