Showing posts with label proc. Show all posts
Showing posts with label proc. Show all posts

Friday, March 23, 2012

How to test SP in SQL Server Express?

How can I test a stored proc that is in my SQL Server Express 2005 database? I don't see anything in VS 2005 or a Query Analyzer in SSMS express. ThanksYou can do it in two ways in Management Studio Express:

1. Go to Programmability > Stored Procedures in Object Explorer and then right-click the name of the stored procedure you wish to execute and choose 'Execute Stored Procecure...'

2. In SQL Query window type 'EXEC nameofprocedure param1, param2' etc. (Replacing your real values, of course!)sql

how to tell when log file is not in use

sql2k sp3
Ive got a db with almost 4 gig of free space. I created a
proc that attempted to shrink it last night before doing
my backup so as to not backup this space. But I got the
message "Cannot shrink log file 2 (bla_log) because all
logical log files are in use". So I either need a way to
tell my backup to ignore the free space(this would be
preferable, but I dont this its possible) or tell my
shrink proc to see if the Log file is not in use.
TIA, ChrisBackup does not put your free space into the backup file. So don't worry
about that.
hth
Quentin
"chris" <anonymous@.discussions.microsoft.com> wrote in message
news:09ff01c3dc46$b4e9d2b0$a601280a@.phx.gbl...
> sql2k sp3
> Ive got a db with almost 4 gig of free space. I created a
> proc that attempted to shrink it last night before doing
> my backup so as to not backup this space. But I got the
> message "Cannot shrink log file 2 (bla_log) because all
> logical log files are in use". So I either need a way to
> tell my backup to ignore the free space(this would be
> preferable, but I dont this its possible) or tell my
> shrink proc to see if the Log file is not in use.
> TIA, Chris|||Then why do I have a backup thats 12.7 gigs when the used
space is about 9.7 gigs?
>--Original Message--
>Backup does not put your free space into the backup
file. So don't worry
>about that.
>hth
>Quentin
>"chris" <anonymous@.discussions.microsoft.com> wrote in
message
>news:09ff01c3dc46$b4e9d2b0$a601280a@.phx.gbl...
>> sql2k sp3
>> Ive got a db with almost 4 gig of free space. I created
a
>> proc that attempted to shrink it last night before doing
>> my backup so as to not backup this space. But I got the
>> message "Cannot shrink log file 2 (bla_log) because all
>> logical log files are in use". So I either need a way to
>> tell my backup to ignore the free space(this would be
>> preferable, but I dont this its possible) or tell my
>> shrink proc to see if the Log file is not in use.
>> TIA, Chris
>
>.
>|||Have you updated the used space information?
"chris" <anonymous@.discussions.microsoft.com> wrote in message
news:018e01c3dc54$5ee62310$a101280a@.phx.gbl...
> Then why do I have a backup thats 12.7 gigs when the used
> space is about 9.7 gigs?
>
> >--Original Message--
> >Backup does not put your free space into the backup
> file. So don't worry
> >about that.
> >
> >hth
> >
> >Quentin
> >
> >"chris" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:09ff01c3dc46$b4e9d2b0$a601280a@.phx.gbl...
> >> sql2k sp3
> >>
> >> Ive got a db with almost 4 gig of free space. I created
> a
> >> proc that attempted to shrink it last night before doing
> >> my backup so as to not backup this space. But I got the
> >> message "Cannot shrink log file 2 (bla_log) because all
> >> logical log files are in use". So I either need a way to
> >> tell my backup to ignore the free space(this would be
> >> preferable, but I dont this its possible) or tell my
> >> shrink proc to see if the Log file is not in use.
> >>
> >> TIA, Chris
> >
> >
> >.
> >|||Yes.
"Quentin Ran" <ab@.who.com> wrote in message
news:#9DozhG3DHA.2296@.TK2MSFTNGP11.phx.gbl...
> Have you updated the used space information?
> "chris" <anonymous@.discussions.microsoft.com> wrote in message
> news:018e01c3dc54$5ee62310$a101280a@.phx.gbl...
> > Then why do I have a backup thats 12.7 gigs when the used
> > space is about 9.7 gigs?
> >
> >
> > >--Original Message--
> > >Backup does not put your free space into the backup
> > file. So don't worry
> > >about that.
> > >
> > >hth
> > >
> > >Quentin
> > >
> > >"chris" <anonymous@.discussions.microsoft.com> wrote in
> > message
> > >news:09ff01c3dc46$b4e9d2b0$a601280a@.phx.gbl...
> > >> sql2k sp3
> > >>
> > >> Ive got a db with almost 4 gig of free space. I created
> > a
> > >> proc that attempted to shrink it last night before doing
> > >> my backup so as to not backup this space. But I got the
> > >> message "Cannot shrink log file 2 (bla_log) because all
> > >> logical log files are in use". So I either need a way to
> > >> tell my backup to ignore the free space(this would be
> > >> preferable, but I dont this its possible) or tell my
> > >> shrink proc to see if the Log file is not in use.
> > >>
> > >> TIA, Chris
> > >
> > >
> > >.
> > >
>