Showing posts with label idea. Show all posts
Showing posts with label idea. Show all posts

Tuesday, March 27, 2012

copy file automatically

I need to copy files from one machine to another machine. It should be done automatically. Could you please give me a suggestion. I have no idea about this. It should write a script or program. But I have no idea yet,

Thanksxcopy utility would help..|||Can you give me more detail about xcopy utility? Where is it? how can i learn it? Thanks in advance.|||open a dos window.

at the prompt type: help xcopy|||i try this in cmd command:
C:\>xcopy c:YTEST \\Server25702\C:\YTEST1

i want to copy the YTEST file to another machine (called Server25702). but it gave me a error message:
Invalid drive specification
0 File(s) copied

What wrong with it, also i change Server25702 to IP address, it also gave me a same message. Can you help me again? Thanks.|||You have to map a drive to \\server25702\c:\ytest1 before you can use xcopy.

So if you use the map command to map drive letter D - your syntax would be:

xcopy c:\ytest d:\ytest

i try this in cmd command:
C:\>xcopy c:YTEST \\Server25702\C:\YTEST1

i want to copy the YTEST file to another machine (called Server25702). but it gave me a error message:
Invalid drive specification
0 File(s) copied

What wrong with it, also i change Server25702 to IP address, it also gave me a same message. Can you help me again? Thanks.|||i try to use map drive, i type \\Server25702, it give me message, the network drive can't be found. Why? Thanks.|||you will need to share the drive on server25702|||Thanks, i got it.
But after i copied, i found all the folder in the source file didn't copy to destination, Can this copy anything in the folder i selected to the destination?

I am going to save it as .bat file, How can i use window to schedule it to run from Monday to Friday. Thanks.

Saturday, February 25, 2012

Copy a standby/readonly database

Any idea to copy a standby/readonly database. We a have a standby/readonly
DB from logshipping for hot standby and we would like to make a copy of this
standby/readonly DB into a read/write DB in the same server for daily
testing. Thanks in advance!Hi Stephanie
Why not take a backup of the original database and restore it?
John
"stephanie" wrote:
> Any idea to copy a standby/readonly database. We a have a standby/readonly
> DB from logshipping for hot standby and we would like to make a copy of this
> standby/readonly DB into a read/write DB in the same server for daily
> testing. Thanks in advance!|||The original DB is in another server. This is a daily restore in standby
server and the database is about 50GB. it will be heavy load to copy the
files through the network and time consuming to restore the full backup.
"John Bell" wrote:
> Hi Stephanie
> Why not take a backup of the original database and restore it?
> John
>
> "stephanie" wrote:
> > Any idea to copy a standby/readonly database. We a have a standby/readonly
> > DB from logshipping for hot standby and we would like to make a copy of this
> > standby/readonly DB into a read/write DB in the same server for daily
> > testing. Thanks in advance!|||Hi
If you had only wanted a readonly database you could have included it in the
log shipping, but I know of a other way of doing this to make it writable.
You may want to look at Litespeed
http://www.quest.com/litespeed_for_sql_server/ to improve the performance and
compression of your backups.
John
"stephanie" wrote:
> The original DB is in another server. This is a daily restore in standby
> server and the database is about 50GB. it will be heavy load to copy the
> files through the network and time consuming to restore the full backup.
> "John Bell" wrote:
> > Hi Stephanie
> >
> > Why not take a backup of the original database and restore it?
> >
> > John
> >
> >
> >
> > "stephanie" wrote:
> >
> > > Any idea to copy a standby/readonly database. We a have a standby/readonly
> > > DB from logshipping for hot standby and we would like to make a copy of this
> > > standby/readonly DB into a read/write DB in the same server for daily
> > > testing. Thanks in advance!|||This is a multi-part message in MIME format.
--090606030107070301080608
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
stephanie wrote:
> Any idea to copy a standby/readonly database. We a have a standby/readonly
> DB from logshipping for hot standby and we would like to make a copy of this
> standby/readonly DB into a read/write DB in the same server for daily
> testing. Thanks in advance!
>
As John suggest, a backup/restore might do the job. Otherwise you can
look at Replication which can replicate your data to another database.
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator
--090606030107070301080608
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
stephanie wrote:
<blockquote cite="midA6738B2B-39F0-4753-AE5D-ACBD170FDA74@.microsoft.com"
type="cite">
<pre wrap="">Any idea to copy a standby/readonly database. We a have a standby/readonly
DB from logshipping for hot standby and we would like to make a copy of this
standby/readonly DB into a read/write DB in the same server for daily
testing. Thanks in advance!
</pre>
</blockquote>
<font size="-1"><font face="Arial">As John suggest, a backup/restore
might do the job. Otherwise you can look at Replication which can
replicate your data to another database.<br>
<br>
<br>
-- <br>
Regards<br>
Steen Schlüter Persson<br>
Databaseadministrator / Systemadministrator<br>
</font></font>
</body>
</html>
--090606030107070301080608--

Copy a standby/readonly database

Any idea to copy a standby/readonly database. We a have a standby/readonly
DB from logshipping for hot standby and we would like to make a copy of this
standby/readonly DB into a read/write DB in the same server for daily
testing. Thanks in advance!Hi Stephanie
Why not take a backup of the original database and restore it?
John
"stephanie" wrote:

> Any idea to copy a standby/readonly database. We a have a standby/readonl
y
> DB from logshipping for hot standby and we would like to make a copy of th
is
> standby/readonly DB into a read/write DB in the same server for daily
> testing. Thanks in advance!|||The original DB is in another server. This is a daily restore in standby
server and the database is about 50GB. it will be heavy load to copy the
files through the network and time consuming to restore the full backup.
"John Bell" wrote:
[vbcol=seagreen]
> Hi Stephanie
> Why not take a backup of the original database and restore it?
> John
>
> "stephanie" wrote:
>|||Hi
If you had only wanted a readonly database you could have included it in the
log shipping, but I know of a other way of doing this to make it writable.
You may want to look at Litespeed
http://www.quest.com/litespeed_for_sql_server/ to improve the performance an
d
compression of your backups.
John
"stephanie" wrote:
[vbcol=seagreen]
> The original DB is in another server. This is a daily restore in standby
> server and the database is about 50GB. it will be heavy load to copy the
> files through the network and time consuming to restore the full backup.
> "John Bell" wrote:
>|||stephanie wrote:
> Any idea to copy a standby/readonly database. We a have a standby/readonl
y
> DB from logshipping for hot standby and we would like to make a copy of th
is
> standby/readonly DB into a read/write DB in the same server for daily
> testing. Thanks in advance!
>
As John suggest, a backup/restore might do the job. Otherwise you can
look at Replication which can replicate your data to another database.
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator

Sunday, February 19, 2012

Converting varchar to date

Hi
Not being a coder I have no idea how to do this and existing posts dont
really help.
I have a table called 'Incoming' and a column called dateofbirth. The
format of the column is varchar. The values in the dateof birth column
are 01012000. When searching for particular dates I'm getting crap
results (because the query is crap too). I reckon I need to convert the
values in the column to dates so that my query can work.
All help gratefully accepted.
TIAHi
declare @.dt varchar(20)
set @.dt='01012000'
select
convert(datetime,substring(@.dt,5,4)+substring(@.dt,1,2)+substring(@.dt,3,2),112)
"jjaggii" <richardwsmit@.gmail.com> wrote in message
news:1152864481.073991.8460@.75g2000cwc.googlegroups.com...
> Hi
> Not being a coder I have no idea how to do this and existing posts dont
> really help.
> I have a table called 'Incoming' and a column called dateofbirth. The
> format of the column is varchar. The values in the dateof birth column
> are 01012000. When searching for particular dates I'm getting crap
> results (because the query is crap too). I reckon I need to convert the
> values in the column to dates so that my query can work.
> All help gratefully accepted.
> TIA
>|||Many thanks for that Uri :)
Uri Dimant wrote:
> Hi
> declare @.dt varchar(20)
> set @.dt='01012000'
> select
> convert(datetime,substring(@.dt,5,4)+substring(@.dt,1,2)+substring(@.dt,3,2),112)
>
>
> "jjaggii" <richardwsmit@.gmail.com> wrote in message
> news:1152864481.073991.8460@.75g2000cwc.googlegroups.com...
> > Hi
> > Not being a coder I have no idea how to do this and existing posts dont
> > really help.
> >
> > I have a table called 'Incoming' and a column called dateofbirth. The
> > format of the column is varchar. The values in the dateof birth column
> > are 01012000. When searching for particular dates I'm getting crap
> > results (because the query is crap too). I reckon I need to convert the
> > values in the column to dates so that my query can work.
> > All help gratefully accepted.
> > TIA
> >|||SELECT DATEOFBIRTH = CAST( SUBSTRING(dateofbirth,5,4) + '-' +
SUBSTRING(dateofbirth,1,2) + '-' +
SUBSTRING(dateofbirth,3,2)
AS DATETIME
)
FROM Incoming
M A Srinivas
jjaggii wrote:
> Hi
> Not being a coder I have no idea how to do this and existing posts dont
> really help.
> I have a table called 'Incoming' and a column called dateofbirth. The
> format of the column is varchar. The values in the dateof birth column
> are 01012000. When searching for particular dates I'm getting crap
> results (because the query is crap too). I reckon I need to convert the
> values in the column to dates so that my query can work.
> All help gratefully accepted.
> TIA

Converting varchar to date

Hi
Not being a coder I have no idea how to do this and existing posts dont
really help.
I have a table called 'Incoming' and a column called dateofbirth. The
format of the column is varchar. The values in the dateof birth column
are 01012000. When searching for particular dates I'm getting crap
results (because the query is crap too). I reckon I need to convert the
values in the column to dates so that my query can work.
All help gratefully accepted.
TIAHi
declare @.dt varchar(20)
set @.dt='01012000'
select
convert(datetime,substring(@.dt,5,4)+subs
tring(@.dt,1,2)+substring(@.dt,3,2),11
2)
"jjaggii" <richardwsmit@.gmail.com> wrote in message
news:1152864481.073991.8460@.75g2000cwc.googlegroups.com...
> Hi
> Not being a coder I have no idea how to do this and existing posts dont
> really help.
> I have a table called 'Incoming' and a column called dateofbirth. The
> format of the column is varchar. The values in the dateof birth column
> are 01012000. When searching for particular dates I'm getting crap
> results (because the query is crap too). I reckon I need to convert the
> values in the column to dates so that my query can work.
> All help gratefully accepted.
> TIA
>|||Many thanks for that Uri
Uri Dimant wrote:
[vbcol=seagreen]
> Hi
> declare @.dt varchar(20)
> set @.dt='01012000'
> select
> convert(datetime,substring(@.dt,5,4)+subs
tring(@.dt,1,2)+substring(@.dt,3,2),
112)
>
>
> "jjaggii" <richardwsmit@.gmail.com> wrote in message
> news:1152864481.073991.8460@.75g2000cwc.googlegroups.com...|||SELECT DATEOFBIRTH = CAST( SUBSTRING(dateofbirth,5,4) + '-' +
SUBSTRING(dateofbirth,1,2) + '-' +
SUBSTRING(dateofbirth,3,2)
AS DATETIME
)
FROM Incoming
M A Srinivas
jjaggii wrote:
> Hi
> Not being a coder I have no idea how to do this and existing posts dont
> really help.
> I have a table called 'Incoming' and a column called dateofbirth. The
> format of the column is varchar. The values in the dateof birth column
> are 01012000. When searching for particular dates I'm getting crap
> results (because the query is crap too). I reckon I need to convert the
> values in the column to dates so that my query can work.
> All help gratefully accepted.
> TIA