Showing posts with label exec. Show all posts
Showing posts with label exec. Show all posts

Wednesday, March 21, 2012

Failed services after backup

Last night we did a backup through backup exec using the
no recovery option. This was not part of a plan but it was
done anyway.
This morning when all the databases that had been backed
up with no recovery set were inaccessible (because they
were marked (Loading)) one of the things we did was to
stop to of our SQL server servers.
We now know all we had to do was do a restore database
with recovery but at the time we thought we would stop and
restart the service.
After stopping the service we can not restart it.
it gives a message indicating there was a failure with no
return code.
Does anyone have any ideas on how we can get these servers
started again?
ThanksThe first step is to check the errolog file and see specific messages there.
Then take it from there.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Bob Ryan" <anonymous@.discussions.microsoft.com> wrote in message
news:f32001c3f18c$d1138a20$a001280a@.phx.gbl...
> Last night we did a backup through backup exec using the
> no recovery option. This was not part of a plan but it was
> done anyway.
> This morning when all the databases that had been backed
> up with no recovery set were inaccessible (because they
> were marked (Loading)) one of the things we did was to
> stop to of our SQL server servers.
> We now know all we had to do was do a restore database
> with recovery but at the time we thought we would stop and
> restart the service.
> After stopping the service we can not restart it.
> it gives a message indicating there was a failure with no
> return code.
> Does anyone have any ideas on how we can get these servers
> started again?
>
> Thanks

Failed services after backup

Last night we did a backup through backup exec using the
no recovery option. This was not part of a plan but it was
done anyway.
This morning when all the databases that had been backed
up with no recovery set were inaccessible (because they
were marked (Loading)) one of the things we did was to
stop to of our SQL server servers.
We now know all we had to do was do a restore database
with recovery but at the time we thought we would stop and
restart the service.
After stopping the service we can not restart it.
it gives a message indicating there was a failure with no
return code.
Does anyone have any ideas on how we can get these servers
started again?
ThanksThe first step is to check the errolog file and see specific messages there.
Then take it from there.
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Bob Ryan" <anonymous@.discussions.microsoft.com> wrote in message
news:f32001c3f18c$d1138a20$a001280a@.phx.gbl...
> Last night we did a backup through backup exec using the
> no recovery option. This was not part of a plan but it was
> done anyway.
> This morning when all the databases that had been backed
> up with no recovery set were inaccessible (because they
> were marked (Loading)) one of the things we did was to
> stop to of our SQL server servers.
> We now know all we had to do was do a restore database
> with recovery but at the time we thought we would stop and
> restart the service.
> After stopping the service we can not restart it.
> it gives a message indicating there was a failure with no
> return code.
> Does anyone have any ideas on how we can get these servers
> started again?
>
> Thankssql

Sunday, February 19, 2012

Extracting info from an exec/sp_executesql command

Hi everyone,

Im trying to do the following code for a simple test on variable (not working but the logic show what i want to get).

Im trying to get informations from an exec/sp_executesql command using a variable declared before the command and use that extracted value in another query later. Am i far from the solution?

Code Snippet

DECLARE @.i int
DECLARE @.sql nvarchar(4000)
SELECT @.sql = 'SELECT @.i = Count(*) from tblTableTest'
exec sp_executesql @.sql
PRINT @.i

You have to declare the list of parameters.

Code Snippet

DECLARE @.i int

DECLARE @.sql nvarchar(4000)

SELECT @.sql = 'SELECT @.i = Count(*) from tblTableTest'

exec sp_executesql @.sql, N'@.i int output', @.i output

PRINT @.i

AMB