Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Tuesday, March 27, 2012

Error 18210 Backup up SQL Server 2005 Database to network drive

I have 2 different servers that run nightly backup jobs to a network drive using the UNC format. I am noticing the larger databases encountering the following errors on a regular basis

Error: 18210, Severity: 16, State: 1.

'\\fnfssql3\SQLBackups\MNSQL05\<database>.BAK'. Operating system error 64(The specified network name is no longer available.).

BACKUP failed to complete the command BACKUP DATABASE <database>. Check the backup application log for detailed messages.

There are 5 databases on this server all backed up by the same job and 3 of them wortk fine and 2 of them fail so it is not a permissions problem. Have there been any problems with backing up to a network drive in 2005?

Well, backing up to networks drives is not officially *supported*, thats why the browser only display the local drives.

The reason for that and the logical explanation why you shouldn′t do that is, because the network is less reliable than local drives. If you want to make sure the database is backuped to network, you will have to either make sure the windows where the backups are streamed to the network don′t interfer with each other or you use a local backup to a drive and copy the files later over. Thats the most reliable option beside using a NAS / SAN.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Network hic-up can do this. One can see such error without sql involved.

Try trapping the error and retry the operation. Also, try backing up locally as suggested by Jens.

|||

Backing up database to a UNC path is fully supported. You must be thinking of running the database from a network drive.

http://support.microsoft.com/kb/304261

http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlbackuprest.mspx

|||

Oj,

the reason why I put *supported* in stars is, that it is sure supported, but not reliable in terms of just having a network share associated on a UNC share. (I thought he explanation should made that clearer, sorry for the poor explanation :-) ) The reliablity descrease due to your mentioned outages on the network. Having big backup files for the transfer over the network is there not recommended undless you have a SAN or a NAS which ensures more reliablity for the transfer. I often used the UNC path backup too on customer sites but either tried to shape the task to copy the files to different time windows or used a local backup and copied the files over with a mechanism (like xcopy / robocopy) to restart in the case of a connection loss.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Friday, February 17, 2012

error

hi i have one varchar field i m convarting that field to datetime in format of dd/mm/yyyy

but i m getting eror

select top 30000 CMS_Upload_Details_ID,Scheme_Code,DrCr,convert(varchar(10),cast(AdditionalField5 as datetime),103) 'ValDate',AdditionalField13 'dept_slip',AdditionalField14 'dept_dt',Cheque_No 'Instrm_No',Amount,CONVERT (varchar(11),Instrm_Date,103)Instrm_Date ,AdditionalField21 'Drawer Name' from Tbl_CMS_UploadDetails with(nolock) where Compare_Status='Pending' and ltrim(rtrim(CMS_Upload_Details_ID)) not in (select top 0 ltrim(rtrim(CMS_Upload_Details_ID)) from Tbl_CMS_UploadDetails with(nolock) where Compare_Status = 'Pending ' and Format_ID =83)and Compare_Status='Pending' and Format_ID =83

error is

Server: Msg 242, Level 16, State 3, Line 1
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

change your bold area as follow as,

Convert(datetime, AdditionalField5,103) as 'ValDate'

|||

hi thanx for reply

now i m getting this error


Server: Msg 241, Level 16, State 1, Line 1
Syntax error converting datetime from character string.

|||

Ok.. Expected one.. Use the following query..

SET DATEFORMAT dmy

Select ....
Case When IsDate(AdditionalField5)=1 Then

Convert(datetime, AdditionalField5,103)

Else NULL END as 'ValDate'

... From ....|||

hi i tried this

SET DATEFORMAT dmy
select top 30000 CMS_Upload_Details_ID,Scheme_Code,DrCr,Case when IsDate(AdditionalField5)=1 Then Convert(datetime, AdditionalField5,103) Else NULL END as 'ValDate',AdditionalField13 'dept_slip',AdditionalField14 'dept_dt',Cheque_No 'Instrm_No',Amount,CONVERT (varchar(11),Instrm_Date,103)Instrm_Date ,AdditionalField21 'Drawer Name' from Tbl_CMS_UploadDetails with(nolock) where Compare_Status='Pending' and ltrim(rtrim(CMS_Upload_Details_ID)) not in (select top 0 ltrim(rtrim(CMS_Upload_Details_ID)) from Tbl_CMS_UploadDetails with(nolock) where Compare_Status = 'Pending ' and Format_ID =83)and Compare_Status='Pending' and Format_ID =83

now getting error

Server: Msg 241, Level 16, State 1, Line 2
Syntax error converting datetime from character string.

|||Are you using any UNION on your query..?|||

no actuallu it is like this

if @.fileFormatId='83'
Begin

set @.s='select top '+cast( @.j as varchar(10)) +' CMS_Upload_Details_ID,Scheme_Code,DrCr,AdditionalField5 ''ValDate'',AdditionalField13 ''dept_slip'',AdditionalField14 ''dept_dt'',Cheque_No ''Instrm_No'',Amount,CONVERT (varchar(11),Instrm_Date,103)Instrm_Date ,AdditionalField21 ''Drawer Name'' from Tbl_CMS_UploadDetails with(nolock) where Compare_Status=''Pending'' and ltrim(rtrim(CMS_Upload_Details_ID)) not in (select top '+ cast(@.i as varchar(10))+' ltrim(rtrim(CMS_Upload_Details_ID)) from Tbl_CMS_UploadDetails with(nolock) where Compare_Status = ''Pending '' and Format_ID ='+ convert(varchar(5),@.fileFormatId) +')and Compare_Status=''Pending'' and Format_ID ='+ convert(varchar(5),@.fileFormatId)
end

|||

Try the following query..

Code Snippet

SET DATEFORMAT dmy

if @.fileFormatId='83'
Begin

set @.s='select top '+cast( @.j as varchar(10)) +' CMS_Upload_Details_ID,Scheme_Code,DrCr,Case when IsDate(AdditionalField5)=1 Then Convert(datetime, AdditionalField5,103) Else NULL END as ''ValDate'',AdditionalField13 ''dept_slip'',AdditionalField14 ''dept_dt'',Cheque_No ''Instrm_No'',Amount,CONVERT (varchar(11),Instrm_Date,103)Instrm_Date ,AdditionalField21 ''Drawer Name'' from Tbl_CMS_UploadDetails with(nolock) where Compare_Status=''Pending'' and ltrim(rtrim(CMS_Upload_Details_ID)) not in (select top '+ cast(@.i as varchar(10))+' ltrim(rtrim(CMS_Upload_Details_ID)) from Tbl_CMS_UploadDetails with(nolock) where Compare_Status = ''Pending '' and Format_ID ='+ convert(varchar(5),@.fileFormatId) +')and Compare_Status=''Pending'' and Format_ID ='+ convert(varchar(5),@.fileFormatId)
end

Exec(@.s)

|||

Hi

Can you just confirm the SQL you are now using for the bold section of your query, and also can we see a sample of the format of the data in AdditionalField5. Also can this field be null (or have non-date text in it) and if so what do you expect to happen in this case.

|||mani actually i tried this earlier and getting error ..see my 2nd previous post|||

mani after printing my query i m getting this one ..so i m running this query.


SET DATEFORMAT dmy
select top 30000 CMS_Upload_Details_ID,Scheme_Code,DrCr,Case when IsDate(AdditionalField5)=1 Then Convert(datetime,AdditionalField5,103) Else NULL END as 'ValDate',AdditionalField13 'dept_slip',AdditionalField14 'dept_dt',Cheque_No 'Instrm_No',Amount,CONVERT (varchar(11),Instrm_Date,103)Instrm_Date ,AdditionalField21 'Drawer Name' from Tbl_CMS_UploadDetails with(nolock) where Compare_Status='Pending' and ltrim(rtrim(CMS_Upload_Details_ID)) not in (select top 0 ltrim(rtrim(CMS_Upload_Details_ID)) from Tbl_CMS_UploadDetails with(nolock) where Compare_Status = 'Pending ' and Format_ID =83)and Compare_Status='Pending' and Format_ID =83

|||

AdditionalField5 is varchar field ...and i m getting my date in this format

12/21/2006--this is is mm/dd/yyyy format i want to change this dd/mm/yyyy format

|||

I am really wondering....

IsDate() function first parse & validate your input before it parse so there is no issue on your bolded area..

Can you remove other date to character conversions to validate the query..

|||i didn't get u what i have to do now?|||hi yes this field can be null (or have non-date text in it) and so in this case how to d this?

Error

This is a multi-part message in MIME format.
--=_NextPart_000_0026_01C360BE.A39C7B60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
When using VB with SQL Server we get the following errors at various = times: Connection is busy with results of another command Cannot create new connection because in manual or = distributed transaction mode Is there a way to fix this problem without changing code. I am = using static cursor type while retrieving the data.
I am using Visual basic 6.0 with SQL Server 2000 and the operating = system is Win 2000 professional.
TIA,
Gary
--=_NextPart_000_0026_01C360BE.A39C7B60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
When using VB with SQL Server we get = the following errors at various times: Connection is busy with = results of another command Cannot create new connection = because in manual or distributed transaction mode Is there a way to fix = this problem without changing code. I am using static cursor type while = retrieving the data.
I am using Visual basic 6.0 with = SQL Server 2000 and the operating system is Win 2000 professional.
TIA,
Gary

--=_NextPart_000_0026_01C360BE.A39C7B60--This is a multi-part message in MIME format.
--=_NextPart_000_002A_01C360AD.DA018FD0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
The connection busy issue is because you haven't closed the recordset =before trying to execute another query on the same database connection =object - try setting the recordset object to nothing or use another =database connection object.
Not sure about the second - what are you doing?
-- Tony Rogerson
SQL Server MVP
http://www.sqlserverfaq.com?mbr=3D21
(Create your own groups, Forum, FAQ's and a ton more)
--=_NextPart_000_002A_01C360AD.DA018FD0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

The connection busy issue is because =you haven't closed the recordset before trying to execute another query on the same =database connection object - try setting the recordset object to nothing or use =another database connection object.
Not sure about the second - what are =you doing?
-- Tony RogersonSQL Server =MVPhttp://www.sqlserverfaq.com?mbr=3D21">http://www.sqlserverfaq.com=?mbr=3D21(Create your own groups, Forum, FAQ's and a ton =more)

--=_NextPart_000_002A_01C360AD.DA018FD0--

error

need help with this error message

TITLE: Microsoft SQL Server 2005 Setup

SQL Server Setup Failed to compile the Managed Object Format (MOF) file c:\Program Files\Microsoft SQL Server\90\Shared\sqlmgmproviderxpsp2up.mof. To proceed, see "Troubleshooting an Installation of SQL Server 2005" or "How to: View SQL Server 2005 Setup Log Files" in SQL Server 2005 Setup Help documentation.

hi,

try having a look at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=124335&SiteID=1

regards