Monday, March 26, 2012
i cant set directory for backup database.
then i clicked " Yes " .. - nothing happened ..
then i clicked " Yes " .. - nothing happened again ..
now i click ok again to close the "restore database" icon .. and they give me this.. i attached a screenshot .. pls have a look ..
i tried clicking "Manage Attachments" somewhere at the bottom of the page to upload .. but ragezone gave me a page telling me that they are sorry for any inconvenience caused .. so i cant attach it .. here is a link .. its kinda small .. but it says:
"Cannot open backup device 'C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\'. Device error or device off-line. See SQL Server error log files for more details. RESTORE DATABASE is terminating abnormally."
thank you for helping me .. thanks in advance ..
http://img.photobucket.com/albums/v81/xiaoboy/error.bmp
http://img.photobucket.com/albums/v...oy/untitled.bmp
PLEAS PLEASE HELP ..It seems that you only selected the directory, but you also have to specify a file name after the directory.|||ok .
which means i have to create another folder inside the last directory ? ..
can that folder be a notepad or what ?? ..|||no, you don't need a new folder, you need a filename. For example the complete path would be "e:\data\database\full_backup.bak", where "e:\data\database" would be your directory and "full_backup.bak" your filename.|||ookay ..
my default directory was "C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP"
inside "BACKUP" is NOTHING .. so what do i add into the directory now ? ..
i tried putting this .
"C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\full_backup.bak"
where "full_backup.bak" is actually not in my "BACKUP" folder ..
the same error appeared ..
please help me .. and thanks in advance .|||ookay ..
my default directory was "C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP"
inside "BACKUP" is NOTHING .. so what do i add into the directory now ? ..
i tried putting this .
"C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\full_backup.bak"
where "full_backup.bak" is actually not in my "BACKUP" folder ..
the same error appeared ..
"Cannot open backup device 'C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\full_backup.bak'. Device error or device off-line. See SQL Server error log files for more details. RESTORE DATABASE is terminating abnormally."
please help me .. and thanks in advance .|||can you create a new print screen, but make sure that the error message is at the bottom of the page, so I can see what's behind it. Also if possible, a can you make it somewhat bigger?|||http://img24.exs.cx/my.php?loc=img24&image=bd5.jpg
is this ok ?|||ok, so if I look at your screen dump, I can see that you have a "." (.full_backup.bak) before the file name. Can you remove this and try again.|||Hey buddy the image is very very small and we could hardly see anything on it. Pls increase the size of the image.|||jora .. i removed that "." behind 'full_backup.bak' already ..
here is ther result again . http://img88.exs.cx/my.php?loc=img88&image=bd8.jpg
thx for helping .|||you are now mixing up two things. First you have to create a backup by specifying a filename before you can restore it.
This image is a screen during restore of the database. I presume now that you already have a backup. You have to know where it is and select it. If you only used default settings, it should be in the "C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP". If there is no file there, your backup did not succeed.|||okay .. this time i changed back to the default already ..
well it came out like this ..
http://img93.exs.cx/my.php?loc=img93&image=bd3.jpg|||what happens if click on the three dots after the directory? This directory should contain the file of the backup. If not, then either your backup is somewhere else and you have to browse to it or your backup did not succeed in which case you can't restore the database.
So the first thing you have to do now is either to locate your backup or to create a backup.|||then i shall choose to create a backup ..
ok .. can i just find a place and create (right click, and new folder) and name it backup??|||sure, you can choose and create your own folder structure (just remember where you put it :D ). Also make sure you type a file name after the directory name.
When you are ready, you can try to restore the database by navigating to your file.|||ok thanks jora ..
can i add u on msn ? .. so in case another thing happenes i can ask u ..sql
I can't see my Procedure. Why? This is my first Stored Procedure.
I created the "MyDb" database using Microsoft SQL 2005 Server Management
Studio and I added the table "dbo.Surveys".
Then I right clicked on Store Procedures and created a new procedure.
When I close it I am asked to save it. I save it and gave the file a
name.
However my stored procedure doesn't show in the Stored Procedures list.
I can only access it by loading the file (File > Open > File). Why?
When I open the File the Connect Window shows again.
I believe the procedure is created because I used CREATE.
When I execute it twice I got the message that there is already another
procedure with that name so I change CREATE to ALTER.
Could you explain to me how to make my procedure visible in:
Databases/MyDb/Programmability/StoredProcedores
How to run it with dbo.Surveys table and see all the records that
returns?
Thank You,
Miguel
My Stored Procedure code is:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE dbo.Surveys_GetSurveyBySurveyName
-- Procedure Parameters
@.SurveyName nvarchar
AS
BEGIN
-- Prevent extra result sets from interfering with SELECT statements
SET NOCOUNT ON;
-- Procedure statements
SELECT m.SurveyName
FROM dbo.application_Surveys
WHERE @.SurveyName = u.SurveyName
IF ( @.@.ROWCOUNT = 0 ) -- Survey Name not found
RETURN -1
RETURN 0
END
GO> When I close it I am asked to save it. I save it and gave the file a name.
That is a file.
> However my stored procedure doesn't show in the Stored Procedures list.
> I can only access it by loading the file (File > Open > File). Why?
You need to *RUN* the CREATE PROCEDURE script to apply the procedure to the
database. This has nothing to do with a file you save on your hard drive.
> I believe the procedure is created because I used CREATE.
> When I execute it twice I got the message that there is already another
> procedure with that name so I change CREATE to ALTER.
Then maybe you created it in the wrong database? Just because you created a
database does not necessarily mean that your current query window is in that
database's context.
> Could you explain to me how to make my procedure visible in:
> Databases/MyDb/Programmability/StoredProcedores
Did you right-click and hit refresh? Did you try EXEC
dbo.Surveys_GetSurveyBySurveyName?
> My Stored Procedure code is:
What happens when you insert this here:
> SET ANSI_NULLS ON
> GO
> SET QUOTED_IDENTIFIER ON
> GO
USE MyDB
GO
> ALTER PROCEDURE dbo.Surveys_GetSurveyBySurveyName
...|||Well, have you hit F5 after creation the SP? Have you refresh on stored
procedure--system stored procedure folder?
"Miguel Dias Moura" <md*REMOVE*moura@.gmail*NOSPAM*.com> wrote in message
news:u$nJopbTGHA.5108@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I created the "MyDb" database using Microsoft SQL 2005 Server Management
> Studio and I added the table "dbo.Surveys".
> Then I right clicked on Store Procedures and created a new procedure.
> When I close it I am asked to save it. I save it and gave the file a name.
> However my stored procedure doesn't show in the Stored Procedures list.
> I can only access it by loading the file (File > Open > File). Why?
> When I open the File the Connect Window shows again.
> I believe the procedure is created because I used CREATE.
> When I execute it twice I got the message that there is already another
> procedure with that name so I change CREATE to ALTER.
> Could you explain to me how to make my procedure visible in:
> Databases/MyDb/Programmability/StoredProcedores
> How to run it with dbo.Surveys table and see all the records that returns?
> Thank You,
> Miguel
> My Stored Procedure code is:
> SET ANSI_NULLS ON
> GO
> SET QUOTED_IDENTIFIER ON
> GO
> ALTER PROCEDURE dbo.Surveys_GetSurveyBySurveyName
> -- Procedure Parameters
> @.SurveyName nvarchar
> AS
> BEGIN
> -- Prevent extra result sets from interfering with SELECT statements
> SET NOCOUNT ON;
> -- Procedure statements
> SELECT m.SurveyName
> FROM dbo.application_Surveys
> WHERE @.SurveyName = u.SurveyName
> IF ( @.@.ROWCOUNT = 0 ) -- Survey Name not found
> RETURN -1
> RETURN 0
> END
> GO
>
I cant see my Procedure. Why? This is my first Stored Procedure.
I created the "MyDb" database using Microsoft SQL 2005 Server Management Studio and I added the table "dbo.Surveys".
Then I right clicked on Store Procedures and created a new procedure.
When I close it I am asked to save it. I save it and gave the file a name.
However my stored procedure doesn't show in the Stored Procedures list.
I can only access it by loading the file (File > Open > File). Why?
When I open the File the Connect Window shows again.
I believe the procedure is created because I used CREATE.
When I execute it twice I got the message that there is already another procedure with that name so I change CREATE to ALTER.
Could you explain to me how to make my procedure visible in:
Databases/MyDb/Programmability/StoredProcedores
How to run it with dbo.Surveys table and see all the records that returns?
Thank You,
Miguel
My Stored Procedure code is:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE dbo.Surveys_GetSurveyBySurveyName
-- Procedure Parameters
@.SurveyName nvarchar
AS
BEGIN
-- Prevent extra result sets from interfering with SELECT statements
SET NOCOUNT ON;
-- Procedure statements
SELECT m.SurveyName
FROM dbo.application_Surveys
WHERE @.SurveyName = u.SurveyName
IF ( @.@.ROWCOUNT = 0 ) -- Survey Name not found
RETURN -1
RETURN 0
END
GO
USE MyDb
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE dbo.Surveys_GetSurveyBySurveyName
-- Procedure Parameters
@.SurveyName nvarchar
AS
BEGIN
-- Prevent extra result sets from interfering with SELECT statements
SET NOCOUNT ON;
-- Procedure statements
SELECT m.SurveyName
FROM dbo.application_Surveys
WHERE @.SurveyName = u.SurveyName
IF ( @.@.ROWCOUNT = 0 ) -- Survey Name not found
RETURN -1
RETURN 0
END
GO
this one can create on sp on my machine.
Limno
You must have created the stored proc in some other database.
Here's a script from SQLServerCentral.com that you can use to find any object: Compile the script in master database and exec it with the stored proc name.
/*
Purpose- Search object across database server.
Author-Vidyadhar P.
Email-vidya_pande@.yahoo.com
Date-6th-Feb-2006
Location- Pune,India
Input Parameters
@.object_name= Name of object to be searched part of object nameto be searched
@.ExactORLikeSearch= If no parameters are passed Sp will search for exact object names.
if 'L' is passes as parameter it will to like seach.
*/
create procedure dbo.sp_find_object -- 'product_master','L'
@.object_name varchar(100),
@.ExactORLikeSearch char(1)=E --E/L
as
begin
set nocount on
declare @.databases table (colid int identity ,dbname varchar(50))
create table ##object_db (dbName varchar(100), objectName varchar(100),objectType varchar(100))
insert into @.databases (dbname) select name from sysdatabases where dbid>4 and name not in ('pubs','northwind', 'holding_tank')
declare @.max_dbs int
select @.max_dbs=max(colid) from @.databases
declare @.current_db varchar(100)
declare @.Qstr nvarchar(2000)
declare @.Qstr1 nvarchar(2000)
set @.Qstr='insert into ##object_db select '
set @.Qstr1=''
declare @.i int
set @.i=1
while @.i<=@.max_dbs
begin
select @.current_db=dbname from @.databases wherecolid=@.i
--------------------------
if @.ExactORLikeSearch='E'
set @.Qstr1=@.Qstr+''''+@.current_db+''''+',name, case xtype when '+''''+'U'+'''' +' then ' +''''+'table'+''''+' when ' +''''+'P'+''''+' then '+''''+'procedure'+''''+' when '+''''+'F'+''''+' then '+''''+'function'+''''+' when '+''''+'V'+''''+' then '+''''+'view'+''''+ ' end as ObjectType
from '+@.current_db+'.dbo.sysobjects wherename='+''''+@.object_name+''''
--------------------------
if @.ExactORLikeSearch='L'
set @.Qstr1=@.Qstr+''''+@.current_db+''''+',name, case xtype when '+''''+'U'+'''' +' then ' +''''+'table'+''''+' when ' +''''+'P'+''''+' then '+''''+'procedure'+''''+' when '+''''+'F'+''''+' then '+''''+'function'+''''+' when '+''''+'V'+''''+' then '+''''+'view'+''''+ ' end as ObjectType
from '+@.current_db+'.dbo.sysobjects where namelike'+''''+'%'+@.object_name+'%'+'''' +'and xtype in ('+''''+'U'+''''+','+''''+'P'+''''+','+''''+'F'+','+''''+''''+'V'+''''+')'
--------------------------
exec sp_executesql @.Qstr1
set @.i=@.i+1
end
select * from ##object_db
drop table ##object_db
end
sql