I've read in some threads that it's possible to backup a database on a network shared folder using this..
Backup Database temp to disk = "\\servername\shared_folder\temp.bkp" with init
I have tried this first using a local folder and it succeeds but when I try to do the backup on a network shared folder, the backup fails saying unable to find backup device. I already made sure that the shared folder gives read/write access to 'Everyone"
on the sharing option. By the way, the pcs are configured only as workgroup. I read in one thread that you have be in a domain to be able to do this.
hope to get help from you guys
thanks,
ace
Hi,
Try doing this:-
1. Have a common OS user in both systems, Say name of the OS user is
backupuser.
2. Start the MSSQL Server and SQl Agent service using backupuser
How to do that:
So go to Control Panel -- Admin Tools -- Services -- MSSQL Server sercice--
Double click and select the "Log on" option. There you give a the backupuser
and password to start the service.
Now stop and start the MSSQL Serevr service.
3. Give the necessary privileges (write) in the remote machine directory
and share.
4. After this you try to execute the Backup database command in Query
Analyzer:-
Backup database <dbname> to
Disk='\\RemoteServername\share\folder\dbname.bak' with init ( With init will
overwrite the backup file every time)
I think this will definitely work out.
Thanks
Hari
MCDBA
"ace rojas" <acerojas3@.yahoo.com> wrote in message
news:B588771A-EB3A-4E0A-A438-238BB7D7102D@.microsoft.com...
> I've read in some threads that it's possible to backup a database on a
network shared folder using this..
> Backup Database temp to disk = "\\servername\shared_folder\temp.bkp" with
init
> I have tried this first using a local folder and it succeeds but when I
try to do the backup on a network shared folder, the backup fails saying
unable to find backup device. I already made sure that the shared folder
gives read/write access to 'Everyone" on the sharing option. By the way, the
pcs are configured only as workgroup. I read in one thread that you have be
in a domain to be able to do this.
> hope to get help from you guys
> thanks,
> ace
|||The problem is still permissions... Since you are in a workgroup, you will
either have to add the SQL Server login account or SQL AGent login account
as having permissions on the Other server.
The file permissions needed for backup are those for the login that sql
server service uses (when the backup is being done in SEM or Query
Analyzer), and the permissions are those that SQL Agent uses when the backup
is scheduled...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:OlVlyMGSEHA.3140@.tk2msftngp13.phx.gbl...
> Hi,
> Try doing this:-
> 1. Have a common OS user in both systems, Say name of the OS user is
> backupuser.
> 2. Start the MSSQL Server and SQl Agent service using backupuser
> How to do that:
> So go to Control Panel -- Admin Tools -- Services -- MSSQL Server
sercice--
> Double click and select the "Log on" option. There you give a the
backupuser
> and password to start the service.
> Now stop and start the MSSQL Serevr service.
> 3. Give the necessary privileges (write) in the remote machine directory
> and share.
> 4. After this you try to execute the Backup database command in Query
> Analyzer:-
> Backup database <dbname> to
> Disk='\\RemoteServername\share\folder\dbname.bak' with init ( With init
will[vbcol=seagreen]
> overwrite the backup file every time)
> I think this will definitely work out.
> Thanks
> Hari
> MCDBA
>
> "ace rojas" <acerojas3@.yahoo.com> wrote in message
> news:B588771A-EB3A-4E0A-A438-238BB7D7102D@.microsoft.com...
> network shared folder using this..
with
> init
> try to do the backup on a network shared folder, the backup fails saying
> unable to find backup device. I already made sure that the shared folder
> gives read/write access to 'Everyone" on the sharing option. By the way,
the
> pcs are configured only as workgroup. I read in one thread that you have
be
> in a domain to be able to do this.
>
|||ace rojas
alliance technologies corp, phil
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
|||Thanks guys, I did it and it worked even if the two pcs belong to
different workgroups. As long as there is common user and password for
the Sqlserver NTservice (logon as) and the PC sharing the folder on
where i'll do the backup.
thanks again
ace rojas
alliance technologies corp, phil
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Showing posts with label temp. Show all posts
Showing posts with label temp. Show all posts
Thursday, March 22, 2012
Database Backup over the network
I've read in some threads that it's possible to backup a database on a network shared folder using this.
Backup Database temp to disk = "\\servername\shared_folder\temp.bkp" with ini
I have tried this first using a local folder and it succeeds but when I try to do the backup on a network shared folder, the backup fails saying unable to find backup device. I already made sure that the shared folder gives read/write access to 'Everyone" on the sharing option. By the way, the pcs are configured only as workgroup. I read in one thread that you have be in a domain to be able to do this
hope to get help from you guy
thanks
aceHi,
Try doing this:-
1. Have a common OS user in both systems, Say name of the OS user is
backupuser.
2. Start the MSSQL Server and SQl Agent service using backupuser
How to do that:
So go to Control Panel -- Admin Tools -- Services -- MSSQL Server sercice--
Double click and select the "Log on" option. There you give a the backupuser
and password to start the service.
Now stop and start the MSSQL Serevr service.
3. Give the necessary privileges (write) in the remote machine directory
and share.
4. After this you try to execute the Backup database command in Query
Analyzer:-
Backup database <dbname> to
Disk='\\RemoteServername\share\folder\dbname.bak' with init ( With init will
overwrite the backup file every time)
I think this will definitely work out.
Thanks
Hari
MCDBA
"ace rojas" <acerojas3@.yahoo.com> wrote in message
news:B588771A-EB3A-4E0A-A438-238BB7D7102D@.microsoft.com...
> I've read in some threads that it's possible to backup a database on a
network shared folder using this..
> Backup Database temp to disk = "\\servername\shared_folder\temp.bkp" with
init
> I have tried this first using a local folder and it succeeds but when I
try to do the backup on a network shared folder, the backup fails saying
unable to find backup device. I already made sure that the shared folder
gives read/write access to 'Everyone" on the sharing option. By the way, the
pcs are configured only as workgroup. I read in one thread that you have be
in a domain to be able to do this.
> hope to get help from you guys
> thanks,
> ace|||The problem is still permissions... Since you are in a workgroup, you will
either have to add the SQL Server login account or SQL AGent login account
as having permissions on the Other server.
The file permissions needed for backup are those for the login that sql
server service uses (when the backup is being done in SEM or Query
Analyzer), and the permissions are those that SQL Agent uses when the backup
is scheduled...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:OlVlyMGSEHA.3140@.tk2msftngp13.phx.gbl...
> Hi,
> Try doing this:-
> 1. Have a common OS user in both systems, Say name of the OS user is
> backupuser.
> 2. Start the MSSQL Server and SQl Agent service using backupuser
> How to do that:
> So go to Control Panel -- Admin Tools -- Services -- MSSQL Server
sercice--
> Double click and select the "Log on" option. There you give a the
backupuser
> and password to start the service.
> Now stop and start the MSSQL Serevr service.
> 3. Give the necessary privileges (write) in the remote machine directory
> and share.
> 4. After this you try to execute the Backup database command in Query
> Analyzer:-
> Backup database <dbname> to
> Disk='\\RemoteServername\share\folder\dbname.bak' with init ( With init
will
> overwrite the backup file every time)
> I think this will definitely work out.
> Thanks
> Hari
> MCDBA
>
> "ace rojas" <acerojas3@.yahoo.com> wrote in message
> news:B588771A-EB3A-4E0A-A438-238BB7D7102D@.microsoft.com...
> > I've read in some threads that it's possible to backup a database on a
> network shared folder using this..
> >
> > Backup Database temp to disk = "\\servername\shared_folder\temp.bkp"
with
> init
> >
> > I have tried this first using a local folder and it succeeds but when I
> try to do the backup on a network shared folder, the backup fails saying
> unable to find backup device. I already made sure that the shared folder
> gives read/write access to 'Everyone" on the sharing option. By the way,
the
> pcs are configured only as workgroup. I read in one thread that you have
be
> in a domain to be able to do this.
> >
> > hope to get help from you guys
> >
> > thanks,
> > ace
>
Backup Database temp to disk = "\\servername\shared_folder\temp.bkp" with ini
I have tried this first using a local folder and it succeeds but when I try to do the backup on a network shared folder, the backup fails saying unable to find backup device. I already made sure that the shared folder gives read/write access to 'Everyone" on the sharing option. By the way, the pcs are configured only as workgroup. I read in one thread that you have be in a domain to be able to do this
hope to get help from you guy
thanks
aceHi,
Try doing this:-
1. Have a common OS user in both systems, Say name of the OS user is
backupuser.
2. Start the MSSQL Server and SQl Agent service using backupuser
How to do that:
So go to Control Panel -- Admin Tools -- Services -- MSSQL Server sercice--
Double click and select the "Log on" option. There you give a the backupuser
and password to start the service.
Now stop and start the MSSQL Serevr service.
3. Give the necessary privileges (write) in the remote machine directory
and share.
4. After this you try to execute the Backup database command in Query
Analyzer:-
Backup database <dbname> to
Disk='\\RemoteServername\share\folder\dbname.bak' with init ( With init will
overwrite the backup file every time)
I think this will definitely work out.
Thanks
Hari
MCDBA
"ace rojas" <acerojas3@.yahoo.com> wrote in message
news:B588771A-EB3A-4E0A-A438-238BB7D7102D@.microsoft.com...
> I've read in some threads that it's possible to backup a database on a
network shared folder using this..
> Backup Database temp to disk = "\\servername\shared_folder\temp.bkp" with
init
> I have tried this first using a local folder and it succeeds but when I
try to do the backup on a network shared folder, the backup fails saying
unable to find backup device. I already made sure that the shared folder
gives read/write access to 'Everyone" on the sharing option. By the way, the
pcs are configured only as workgroup. I read in one thread that you have be
in a domain to be able to do this.
> hope to get help from you guys
> thanks,
> ace|||The problem is still permissions... Since you are in a workgroup, you will
either have to add the SQL Server login account or SQL AGent login account
as having permissions on the Other server.
The file permissions needed for backup are those for the login that sql
server service uses (when the backup is being done in SEM or Query
Analyzer), and the permissions are those that SQL Agent uses when the backup
is scheduled...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:OlVlyMGSEHA.3140@.tk2msftngp13.phx.gbl...
> Hi,
> Try doing this:-
> 1. Have a common OS user in both systems, Say name of the OS user is
> backupuser.
> 2. Start the MSSQL Server and SQl Agent service using backupuser
> How to do that:
> So go to Control Panel -- Admin Tools -- Services -- MSSQL Server
sercice--
> Double click and select the "Log on" option. There you give a the
backupuser
> and password to start the service.
> Now stop and start the MSSQL Serevr service.
> 3. Give the necessary privileges (write) in the remote machine directory
> and share.
> 4. After this you try to execute the Backup database command in Query
> Analyzer:-
> Backup database <dbname> to
> Disk='\\RemoteServername\share\folder\dbname.bak' with init ( With init
will
> overwrite the backup file every time)
> I think this will definitely work out.
> Thanks
> Hari
> MCDBA
>
> "ace rojas" <acerojas3@.yahoo.com> wrote in message
> news:B588771A-EB3A-4E0A-A438-238BB7D7102D@.microsoft.com...
> > I've read in some threads that it's possible to backup a database on a
> network shared folder using this..
> >
> > Backup Database temp to disk = "\\servername\shared_folder\temp.bkp"
with
> init
> >
> > I have tried this first using a local folder and it succeeds but when I
> try to do the backup on a network shared folder, the backup fails saying
> unable to find backup device. I already made sure that the shared folder
> gives read/write access to 'Everyone" on the sharing option. By the way,
the
> pcs are configured only as workgroup. I read in one thread that you have
be
> in a domain to be able to do this.
> >
> > hope to get help from you guys
> >
> > thanks,
> > ace
>
Database Backup over the network
I've read in some threads that it's possible to backup a database on a netwo
rk shared folder using this..
Backup Database temp to disk = "\\servername\shared_folder\temp.bkp" with in
it
I have tried this first using a local folder and it succeeds but when I try
to do the backup on a network shared folder, the backup fails saying unable
to find backup device. I already made sure that the shared folder gives read
/write access to 'Everyone"
on the sharing option. By the way, the pcs are configured only as workgroup.
I read in one thread that you have be in a domain to be able to do this.
hope to get help from you guys
thanks,
aceHi,
Try doing this:-
1. Have a common OS user in both systems, Say name of the OS user is
backupuser.
2. Start the MSSQL Server and SQl Agent service using backupuser
How to do that:
So go to Control Panel -- Admin Tools -- Services -- MSSQL Server sercice--
Double click and select the "Log on" option. There you give a the backupuser
and password to start the service.
Now stop and start the MSSQL Serevr service.
3. Give the necessary privileges (write) in the remote machine directory
and share.
4. After this you try to execute the Backup database command in Query
Analyzer:-
Backup database <dbname> to
Disk='\\RemoteServername\share\folder\db
name.bak' with init ( With init will
overwrite the backup file every time)
I think this will definitely work out.
Thanks
Hari
MCDBA
"ace rojas" <acerojas3@.yahoo.com> wrote in message
news:B588771A-EB3A-4E0A-A438-238BB7D7102D@.microsoft.com...
> I've read in some threads that it's possible to backup a database on a
network shared folder using this..
> Backup Database temp to disk = "\\servername\shared_folder\temp.bkp" with
init
> I have tried this first using a local folder and it succeeds but when I
try to do the backup on a network shared folder, the backup fails saying
unable to find backup device. I already made sure that the shared folder
gives read/write access to 'Everyone" on the sharing option. By the way, the
pcs are configured only as workgroup. I read in one thread that you have be
in a domain to be able to do this.
> hope to get help from you guys
> thanks,
> ace|||The problem is still permissions... Since you are in a workgroup, you will
either have to add the SQL Server login account or SQL AGent login account
as having permissions on the Other server.
The file permissions needed for backup are those for the login that sql
server service uses (when the backup is being done in SEM or Query
Analyzer), and the permissions are those that SQL Agent uses when the backup
is scheduled...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:OlVlyMGSEHA.3140@.tk2msftngp13.phx.gbl...
> Hi,
> Try doing this:-
> 1. Have a common OS user in both systems, Say name of the OS user is
> backupuser.
> 2. Start the MSSQL Server and SQl Agent service using backupuser
> How to do that:
> So go to Control Panel -- Admin Tools -- Services -- MSSQL Server
sercice--
> Double click and select the "Log on" option. There you give a the
backupuser
> and password to start the service.
> Now stop and start the MSSQL Serevr service.
> 3. Give the necessary privileges (write) in the remote machine directory
> and share.
> 4. After this you try to execute the Backup database command in Query
> Analyzer:-
> Backup database <dbname> to
> Disk='\\RemoteServername\share\folder\db
name.bak' with init ( With init
will
> overwrite the backup file every time)
> I think this will definitely work out.
> Thanks
> Hari
> MCDBA
>
> "ace rojas" <acerojas3@.yahoo.com> wrote in message
> news:B588771A-EB3A-4E0A-A438-238BB7D7102D@.microsoft.com...
> network shared folder using this..
with[vbcol=seagreen]
> init
> try to do the backup on a network shared folder, the backup fails saying
> unable to find backup device. I already made sure that the shared folder
> gives read/write access to 'Everyone" on the sharing option. By the way,
the
> pcs are configured only as workgroup. I read in one thread that you have
be
> in a domain to be able to do this.
>|||ace rojas
alliance technologies corp, phil
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!|||Thanks guys, I did it and it worked even if the two pcs belong to
different workgroups. As long as there is common user and password for
the Sqlserver NTservice (logon as) and the PC sharing the folder on
where i'll do the backup.
thanks again
ace rojas
alliance technologies corp, phil
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
rk shared folder using this..
Backup Database temp to disk = "\\servername\shared_folder\temp.bkp" with in
it
I have tried this first using a local folder and it succeeds but when I try
to do the backup on a network shared folder, the backup fails saying unable
to find backup device. I already made sure that the shared folder gives read
/write access to 'Everyone"
on the sharing option. By the way, the pcs are configured only as workgroup.
I read in one thread that you have be in a domain to be able to do this.
hope to get help from you guys
thanks,
aceHi,
Try doing this:-
1. Have a common OS user in both systems, Say name of the OS user is
backupuser.
2. Start the MSSQL Server and SQl Agent service using backupuser
How to do that:
So go to Control Panel -- Admin Tools -- Services -- MSSQL Server sercice--
Double click and select the "Log on" option. There you give a the backupuser
and password to start the service.
Now stop and start the MSSQL Serevr service.
3. Give the necessary privileges (write) in the remote machine directory
and share.
4. After this you try to execute the Backup database command in Query
Analyzer:-
Backup database <dbname> to
Disk='\\RemoteServername\share\folder\db
name.bak' with init ( With init will
overwrite the backup file every time)
I think this will definitely work out.
Thanks
Hari
MCDBA
"ace rojas" <acerojas3@.yahoo.com> wrote in message
news:B588771A-EB3A-4E0A-A438-238BB7D7102D@.microsoft.com...
> I've read in some threads that it's possible to backup a database on a
network shared folder using this..
> Backup Database temp to disk = "\\servername\shared_folder\temp.bkp" with
init
> I have tried this first using a local folder and it succeeds but when I
try to do the backup on a network shared folder, the backup fails saying
unable to find backup device. I already made sure that the shared folder
gives read/write access to 'Everyone" on the sharing option. By the way, the
pcs are configured only as workgroup. I read in one thread that you have be
in a domain to be able to do this.
> hope to get help from you guys
> thanks,
> ace|||The problem is still permissions... Since you are in a workgroup, you will
either have to add the SQL Server login account or SQL AGent login account
as having permissions on the Other server.
The file permissions needed for backup are those for the login that sql
server service uses (when the backup is being done in SEM or Query
Analyzer), and the permissions are those that SQL Agent uses when the backup
is scheduled...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:OlVlyMGSEHA.3140@.tk2msftngp13.phx.gbl...
> Hi,
> Try doing this:-
> 1. Have a common OS user in both systems, Say name of the OS user is
> backupuser.
> 2. Start the MSSQL Server and SQl Agent service using backupuser
> How to do that:
> So go to Control Panel -- Admin Tools -- Services -- MSSQL Server
sercice--
> Double click and select the "Log on" option. There you give a the
backupuser
> and password to start the service.
> Now stop and start the MSSQL Serevr service.
> 3. Give the necessary privileges (write) in the remote machine directory
> and share.
> 4. After this you try to execute the Backup database command in Query
> Analyzer:-
> Backup database <dbname> to
> Disk='\\RemoteServername\share\folder\db
name.bak' with init ( With init
will
> overwrite the backup file every time)
> I think this will definitely work out.
> Thanks
> Hari
> MCDBA
>
> "ace rojas" <acerojas3@.yahoo.com> wrote in message
> news:B588771A-EB3A-4E0A-A438-238BB7D7102D@.microsoft.com...
> network shared folder using this..
with[vbcol=seagreen]
> init
> try to do the backup on a network shared folder, the backup fails saying
> unable to find backup device. I already made sure that the shared folder
> gives read/write access to 'Everyone" on the sharing option. By the way,
the
> pcs are configured only as workgroup. I read in one thread that you have
be
> in a domain to be able to do this.
>|||ace rojas
alliance technologies corp, phil
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!|||Thanks guys, I did it and it worked even if the two pcs belong to
different workgroups. As long as there is common user and password for
the Sqlserver NTservice (logon as) and the PC sharing the folder on
where i'll do the backup.
thanks again
ace rojas
alliance technologies corp, phil
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Sunday, February 19, 2012
Data type int to char
Hi again everyone,
I build a temp table with a data type of int on one column. I then use BCP
to export this table to a TXT file. I use the -c option and also the -t""
(no column delimiter).
The problem I am having is that I am limited to 5 characters for this column
by the company the data is being sent too (archaic I know, I think they are
reading it with Cobol) and the int exports to about 9 characters.
Is there a way to change an int to a char on the fly with INSERT? Something
like CAST?
Beating my brains out, thanks for any suggestions.
George
george collins wrote:
> Hi again everyone,
> I build a temp table with a data type of int on one column. I then
> use BCP to export this table to a TXT file. I use the -c option and
> also the -t"" (no column delimiter).
> The problem I am having is that I am limited to 5 characters for this
> column by the company the data is being sent too (archaic I know, I
> think they are reading it with Cobol) and the int exports to about 9
> characters.
> Is there a way to change an int to a char on the fly with INSERT?
> Something like CAST?
> Beating my brains out, thanks for any suggestions.
> George
You can optionally use a query with BCP. That would give you the
opportunity to convert the INT into a char(5). But you may have problems
if the values in the INT are greater than 99,999 since you'll run into 6
digit numbers.
David Gugick
Imceda Software
www.imceda.com
|||Yeah, I ran in to that kind of issue, what my main problem was the original
character type was a float which would not convert. I changed that to an
int and I am off and running.
Thanks.
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:%23enR57ooEHA.3464@.tk2msftngp13.phx.gbl...
> george collins wrote:
> You can optionally use a query with BCP. That would give you the
> opportunity to convert the INT into a char(5). But you may have problems
> if the values in the INT are greater than 99,999 since you'll run into 6
> digit numbers.
> --
> David Gugick
> Imceda Software
> www.imceda.com
>
I build a temp table with a data type of int on one column. I then use BCP
to export this table to a TXT file. I use the -c option and also the -t""
(no column delimiter).
The problem I am having is that I am limited to 5 characters for this column
by the company the data is being sent too (archaic I know, I think they are
reading it with Cobol) and the int exports to about 9 characters.
Is there a way to change an int to a char on the fly with INSERT? Something
like CAST?
Beating my brains out, thanks for any suggestions.
George
george collins wrote:
> Hi again everyone,
> I build a temp table with a data type of int on one column. I then
> use BCP to export this table to a TXT file. I use the -c option and
> also the -t"" (no column delimiter).
> The problem I am having is that I am limited to 5 characters for this
> column by the company the data is being sent too (archaic I know, I
> think they are reading it with Cobol) and the int exports to about 9
> characters.
> Is there a way to change an int to a char on the fly with INSERT?
> Something like CAST?
> Beating my brains out, thanks for any suggestions.
> George
You can optionally use a query with BCP. That would give you the
opportunity to convert the INT into a char(5). But you may have problems
if the values in the INT are greater than 99,999 since you'll run into 6
digit numbers.
David Gugick
Imceda Software
www.imceda.com
|||Yeah, I ran in to that kind of issue, what my main problem was the original
character type was a float which would not convert. I changed that to an
int and I am off and running.
Thanks.
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:%23enR57ooEHA.3464@.tk2msftngp13.phx.gbl...
> george collins wrote:
> You can optionally use a query with BCP. That would give you the
> opportunity to convert the INT into a char(5). But you may have problems
> if the values in the INT are greater than 99,999 since you'll run into 6
> digit numbers.
> --
> David Gugick
> Imceda Software
> www.imceda.com
>
Data type int to char
Hi again everyone,
I build a temp table with a data type of int on one column. I then use BCP
to export this table to a TXT file. I use the -c option and also the -t""
(no column delimiter).
The problem I am having is that I am limited to 5 characters for this column
by the company the data is being sent too (archaic I know, I think they are
reading it with Cobol) and the int exports to about 9 characters.
Is there a way to change an int to a char on the fly with INSERT? Something
like CAST?
Beating my brains out, thanks for any suggestions.
Georgegeorge collins wrote:
> Hi again everyone,
> I build a temp table with a data type of int on one column. I then
> use BCP to export this table to a TXT file. I use the -c option and
> also the -t"" (no column delimiter).
> The problem I am having is that I am limited to 5 characters for this
> column by the company the data is being sent too (archaic I know, I
> think they are reading it with Cobol) and the int exports to about 9
> characters.
> Is there a way to change an int to a char on the fly with INSERT?
> Something like CAST?
> Beating my brains out, thanks for any suggestions.
> George
You can optionally use a query with BCP. That would give you the
opportunity to convert the INT into a char(5). But you may have problems
if the values in the INT are greater than 99,999 since you'll run into 6
digit numbers.
--
David Gugick
Imceda Software
www.imceda.com|||Yeah, I ran in to that kind of issue, what my main problem was the original
character type was a float which would not convert. I changed that to an
int and I am off and running.
Thanks.
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:%23enR57ooEHA.3464@.tk2msftngp13.phx.gbl...
> george collins wrote:
>> Hi again everyone,
>> I build a temp table with a data type of int on one column. I then
>> use BCP to export this table to a TXT file. I use the -c option and
>> also the -t"" (no column delimiter).
>> The problem I am having is that I am limited to 5 characters for this
>> column by the company the data is being sent too (archaic I know, I
>> think they are reading it with Cobol) and the int exports to about 9
>> characters.
>> Is there a way to change an int to a char on the fly with INSERT?
>> Something like CAST?
>> Beating my brains out, thanks for any suggestions.
>> George
> You can optionally use a query with BCP. That would give you the
> opportunity to convert the INT into a char(5). But you may have problems
> if the values in the INT are greater than 99,999 since you'll run into 6
> digit numbers.
> --
> David Gugick
> Imceda Software
> www.imceda.com
>
I build a temp table with a data type of int on one column. I then use BCP
to export this table to a TXT file. I use the -c option and also the -t""
(no column delimiter).
The problem I am having is that I am limited to 5 characters for this column
by the company the data is being sent too (archaic I know, I think they are
reading it with Cobol) and the int exports to about 9 characters.
Is there a way to change an int to a char on the fly with INSERT? Something
like CAST?
Beating my brains out, thanks for any suggestions.
Georgegeorge collins wrote:
> Hi again everyone,
> I build a temp table with a data type of int on one column. I then
> use BCP to export this table to a TXT file. I use the -c option and
> also the -t"" (no column delimiter).
> The problem I am having is that I am limited to 5 characters for this
> column by the company the data is being sent too (archaic I know, I
> think they are reading it with Cobol) and the int exports to about 9
> characters.
> Is there a way to change an int to a char on the fly with INSERT?
> Something like CAST?
> Beating my brains out, thanks for any suggestions.
> George
You can optionally use a query with BCP. That would give you the
opportunity to convert the INT into a char(5). But you may have problems
if the values in the INT are greater than 99,999 since you'll run into 6
digit numbers.
--
David Gugick
Imceda Software
www.imceda.com|||Yeah, I ran in to that kind of issue, what my main problem was the original
character type was a float which would not convert. I changed that to an
int and I am off and running.
Thanks.
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:%23enR57ooEHA.3464@.tk2msftngp13.phx.gbl...
> george collins wrote:
>> Hi again everyone,
>> I build a temp table with a data type of int on one column. I then
>> use BCP to export this table to a TXT file. I use the -c option and
>> also the -t"" (no column delimiter).
>> The problem I am having is that I am limited to 5 characters for this
>> column by the company the data is being sent too (archaic I know, I
>> think they are reading it with Cobol) and the int exports to about 9
>> characters.
>> Is there a way to change an int to a char on the fly with INSERT?
>> Something like CAST?
>> Beating my brains out, thanks for any suggestions.
>> George
> You can optionally use a query with BCP. That would give you the
> opportunity to convert the INT into a char(5). But you may have problems
> if the values in the INT are greater than 99,999 since you'll run into 6
> digit numbers.
> --
> David Gugick
> Imceda Software
> www.imceda.com
>
Subscribe to:
Posts (Atom)