Showing posts with label quotcreate. Show all posts
Showing posts with label quotcreate. Show all posts

Saturday, February 25, 2012

"CREATE OR ALTER" works in oracle, but not in ms sql

Hi

Normally we deliver scripts and the installers may NOT update the scripts.

This was fine for SQL scripts for oracle: because we are not aware of the situation in production, whether a stored proc was already previously installed or not.

therefore we wrote:

CREATE OR ALTER PROCEDURE ....... (or something like that).

but it seems in SQL server I can only write one of both:

CREATE PROCEDURE ....

or

ALTER PROCEDURE

this means that the script fails if it's NOT yet installed when and i use ALTER, and it fails when it IS already installed and I write CREATE

isn't there a solution to use "CREATE OR ALTER" in one script ?

IF EXISTS (SELECT name FROM sysobjects WHERE name = 'myStoredProc' AND type = 'P')

BEGIN

DROP PROCEDURE myStoredProc

END

GO

CREATE PROCEDURE myStoredProc (@.Params ...)

AS

BEGIN

...

END

GO

"Create a Grants Rights Script" error in rs db configaration

Hi,

While I'm trying to configure rs db configuration, I’m getting "Create a Grants Rights Script" error when I click Apply button in rs configuration UI.

For this setup; I’m using 32-bit rs on 64-bit windows 2003 server and trying to connect 64-bit sql db instance on a different 64-bit box . both boxes are in same windows domain. I could also able to create rs db from rs configuration UI successfully. I'm using sql sa credentials and installed SQL SP1 on both boxes. Pl let me know how to fix this error.

Complate error message is,

System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Management.ManagementScope.InitializeGuts(Object o)
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObjectSearcher.Initialize()
at System.Management.ManagementObjectSearcher.Get()
at Microsoft.ReportingServices.Diagnostics.WebUtil.GetIPAddresses(String machine)
at ReportServicesConfigUI.Panels.DatabaseSetupPanel.IsLocalDbServer(String dbServer)
at ReportServicesConfigUI.Panels.DatabaseSetupPanel.SetDatabaseConnectionTask(String connectionString, String server, String database, ConfigurationCredentialsType credsType, String account, String password, Boolean upgrade, String dbVersion)

Thanks in advance

Ram

did you ever resolve this problem. I'm gettnig the same error.|||

Hi Greg,

I would suggest to start from here:

http://msdn2.microsoft.com/en-us/library/ms365170.aspx

http://msdn2.microsoft.com/en-us/library/ms159093.aspx

Mihaela

"Create a Grants Rights Script" error in rs db configaration

Hi,

While I'm trying to configure rs db configuration, I’m getting "Create a Grants Rights Script" error when I click Apply button in rs configuration UI.

For this setup; I’m using 32-bit rs on 64-bit windows 2003 server and trying to connect 64-bit sql db instance on a different 64-bit box . both boxes are in same windows domain. I could also able to create rs db from rs configuration UI successfully. I'm using sql sa credentials and installed SQL SP1 on both boxes. Pl let me know how to fix this error.

Complate error message is,

System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Management.ManagementScope.InitializeGuts(Object o)
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObjectSearcher.Initialize()
at System.Management.ManagementObjectSearcher.Get()
at Microsoft.ReportingServices.Diagnostics.WebUtil.GetIPAddresses(String machine)
at ReportServicesConfigUI.Panels.DatabaseSetupPanel.IsLocalDbServer(String dbServer)
at ReportServicesConfigUI.Panels.DatabaseSetupPanel.SetDatabaseConnectionTask(String connectionString, String server, String database, ConfigurationCredentialsType credsType, String account, String password, Boolean upgrade, String dbVersion)

Thanks in advance

Ram

did you ever resolve this problem. I'm gettnig the same error.|||

Hi Greg,

I would suggest to start from here:

http://msdn2.microsoft.com/en-us/library/ms365170.aspx

http://msdn2.microsoft.com/en-us/library/ms159093.aspx

Mihaela