Showing posts with label figure. Show all posts
Showing posts with label figure. Show all posts

Sunday, March 11, 2012

Alter Stored Procedure with asp.net code

I have looked all around and I am having no luck trying to figure out how to alter a stored procedure within an asp.net application.

Here is a short snippet of my code, but it keeps erroring out on me.

Try
myCommand.CommandText = "Using " & DatabaseName & vbNewLine & Me.txtStoredProcedures.Text
myCommand.ExecuteNonQuery()
myTran.Commit()
Catch ex As Exception
myTran.Rollback()
Response.Write(ex.ToString())
End Try

The reason for this is because I have to propagate stored procedures across many databases and was hoping to write an application for it.

Basically the database name is coming from a loop statement and I just want to keep on going through all the databases that I have chosen and have the stored procedure updated (altered) automatically

So i thought the code above was close, but it keeps catching on me. Anybody's help would be greatly appreciated!!!

This is one of the things that make stored procedures a maintenance nightmare.

It should be "USE", not "USING". It may be an idea to use separate connections or at least to execute the USE statement separately.

|||

Well, I changed it to Use (I should have seen that already) and still got nothing. I did try to do one stored proc at a time, but it kept catching on me. Any other ideas?

|||

Why not just run the stored procedure create/update within Query Analyser / SQL Server Management Studio?

Thursday, March 8, 2012

alter database syntax

ok i must be blind as I can't find/figure it out. What is the correct syntax
for alter database using the recovery full option. I want to change the
recovery method to full from simple. Thanks for the info.
Jasonalter database dbname
set recovery full
HTH
--
Ray Higdon MCSE, MCDBA, CCNA
--
"Jason Meyer" <jason.meyer@.nospam.roseville.k12.mn.us> wrote in message
news:eUDT3RJ1DHA.3824@.TK2MSFTNGP11.phx.gbl...
> ok i must be blind as I can't find/figure it out. What is the correct
syntax
> for alter database using the recovery full option. I want to change the
> recovery method to full from simple. Thanks for the info.
>
> Jason
>|||alter database XXX
set recovery full
"Jason Meyer" <jason.meyer@.nospam.roseville.k12.mn.us> wrote in message
news:eUDT3RJ1DHA.3824@.TK2MSFTNGP11.phx.gbl...
> ok i must be blind as I can't find/figure it out. What is the correct
syntax
> for alter database using the recovery full option. I want to change the
> recovery method to full from simple. Thanks for the info.
>
> Jason
>|||never mind, found it. thanks
"Jason Meyer" <jason.meyer@.nospam.roseville.k12.mn.us> wrote in message
news:eUDT3RJ1DHA.3824@.TK2MSFTNGP11.phx.gbl...
> ok i must be blind as I can't find/figure it out. What is the correct
syntax
> for alter database using the recovery full option. I want to change the
> recovery method to full from simple. Thanks for the info.
>
> Jason
>

Monday, February 13, 2012

All users can edit security!

I've been fighting for 2 days trying to figure out how to block general user
s from being able to edit security on reports/folders. I have myself set up
as Content Manager and the groups Everyone and Users set up as Browsers. C
an someone please tell me w
hat I am missing? Thanks.OOPs. Should've put this in Reporting Services area. Sorry.
"BrianW" wrote:

> I've been fighting for 2 days trying to figure out how to block general users from
being able to edit security on reports/folders. I have myself set up as Content Ma
nager and the groups Everyone and Users set up as Browsers. Can someone please tell
me
what I am missing? Thanks.