显示标签为“sqlcmd”的博文。显示所有博文
显示标签为“sqlcmd”的博文。显示所有博文

2012年3月8日星期四

BCP for SQL2005

Hi,
I know that BCP.EXE is part of the client tools for SQL2005. Does it also
come as part of a standalone like say SQLCMD.EXE as a standalone from the
feature Pack? We are looking to install the Native client and SQLCMD and BCP
without the other executables.
Thanks
Chris
Hi Chris
I am not sure about the licencing issue with installing the Feature pack
version on it's own! AFAIK BCP.EXE is not available as a standalone install,
although there are example applications using the Bulk Copy API which you
could use to write your own application.
John
"Chris Wood" wrote:

> Hi,
> I know that BCP.EXE is part of the client tools for SQL2005. Does it also
> come as part of a standalone like say SQLCMD.EXE as a standalone from the
> feature Pack? We are looking to install the Native client and SQLCMD and BCP
> without the other executables.
> Thanks
> Chris
>
>
|||That's what I thought John.
We have some non MS SQL servers that don't really need the full Client
Tools, just the Native Client, SQLCMD and BCP. I could find the first 2 and
had hoped that BCP might be available too but if not then we should just be
able to copy an SQL2005 BCP.EXE onto the server.
Thanks
Chris
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:B7EDF30E-63A6-4757-BA3C-A6A8D53600AF@.microsoft.com...[vbcol=seagreen]
> Hi Chris
> I am not sure about the licencing issue with installing the Feature pack
> version on it's own! AFAIK BCP.EXE is not available as a standalone
> install,
> although there are example applications using the Bulk Copy API which you
> could use to write your own application.
> John
> "Chris Wood" wrote:
|||Hi Chris
You may want to try installing from SQL Express the tools only which will
not install Management studio or Profiler, but I don't know if BCP is
included.
John
"Chris Wood" wrote:

> That's what I thought John.
> We have some non MS SQL servers that don't really need the full Client
> Tools, just the Native Client, SQLCMD and BCP. I could find the first 2 and
> had hoped that BCP might be available too but if not then we should just be
> able to copy an SQL2005 BCP.EXE onto the server.
> Thanks
> Chris
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:B7EDF30E-63A6-4757-BA3C-A6A8D53600AF@.microsoft.com...
>
>
|||That's something worth trying.
Thanks
Chris
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:E207B799-76CE-4FCB-AA42-B9B89CF0F768@.microsoft.com...[vbcol=seagreen]
> Hi Chris
> You may want to try installing from SQL Express the tools only which will
> not install Management studio or Profiler, but I don't know if BCP is
> included.
> John
> "Chris Wood" wrote:
|||John,
I downloaded the SQLExpress and can see, using Winzip, that it has BCP
included as part. I do not have a machine to install this onto so can I just
pick Native client, SQLCMD and BCP from the downloaded package? I would like
to know if this is an option or not?
Thanks
Chris
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:E207B799-76CE-4FCB-AA42-B9B89CF0F768@.microsoft.com...[vbcol=seagreen]
> Hi Chris
> You may want to try installing from SQL Express the tools only which will
> not install Management studio or Profiler, but I don't know if BCP is
> included.
> John
> "Chris Wood" wrote:

BCP for SQL2005

Hi,
I know that BCP.EXE is part of the client tools for SQL2005. Does it also
come as part of a standalone like say SQLCMD.EXE as a standalone from the
feature Pack? We are looking to install the Native client and SQLCMD and BCP
without the other executables.
Thanks
ChrisHi Chris
I am not sure about the licencing issue with installing the Feature pack
version on it's own! AFAIK BCP.EXE is not available as a standalone install,
although there are example applications using the Bulk Copy API which you
could use to write your own application.
John
"Chris Wood" wrote:
> Hi,
> I know that BCP.EXE is part of the client tools for SQL2005. Does it also
> come as part of a standalone like say SQLCMD.EXE as a standalone from the
> feature Pack? We are looking to install the Native client and SQLCMD and BCP
> without the other executables.
> Thanks
> Chris
>
>|||That's what I thought John.
We have some non MS SQL servers that don't really need the full Client
Tools, just the Native Client, SQLCMD and BCP. I could find the first 2 and
had hoped that BCP might be available too but if not then we should just be
able to copy an SQL2005 BCP.EXE onto the server.
Thanks
Chris
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:B7EDF30E-63A6-4757-BA3C-A6A8D53600AF@.microsoft.com...
> Hi Chris
> I am not sure about the licencing issue with installing the Feature pack
> version on it's own! AFAIK BCP.EXE is not available as a standalone
> install,
> although there are example applications using the Bulk Copy API which you
> could use to write your own application.
> John
> "Chris Wood" wrote:
>> Hi,
>> I know that BCP.EXE is part of the client tools for SQL2005. Does it also
>> come as part of a standalone like say SQLCMD.EXE as a standalone from the
>> feature Pack? We are looking to install the Native client and SQLCMD and
>> BCP
>> without the other executables.
>> Thanks
>> Chris
>>|||Hi Chris
You may want to try installing from SQL Express the tools only which will
not install Management studio or Profiler, but I don't know if BCP is
included.
John
"Chris Wood" wrote:
> That's what I thought John.
> We have some non MS SQL servers that don't really need the full Client
> Tools, just the Native Client, SQLCMD and BCP. I could find the first 2 and
> had hoped that BCP might be available too but if not then we should just be
> able to copy an SQL2005 BCP.EXE onto the server.
> Thanks
> Chris
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:B7EDF30E-63A6-4757-BA3C-A6A8D53600AF@.microsoft.com...
> > Hi Chris
> >
> > I am not sure about the licencing issue with installing the Feature pack
> > version on it's own! AFAIK BCP.EXE is not available as a standalone
> > install,
> > although there are example applications using the Bulk Copy API which you
> > could use to write your own application.
> >
> > John
> >
> > "Chris Wood" wrote:
> >
> >> Hi,
> >>
> >> I know that BCP.EXE is part of the client tools for SQL2005. Does it also
> >> come as part of a standalone like say SQLCMD.EXE as a standalone from the
> >> feature Pack? We are looking to install the Native client and SQLCMD and
> >> BCP
> >> without the other executables.
> >>
> >> Thanks
> >>
> >> Chris
> >>
> >>
> >>
>
>|||That's something worth trying.
Thanks
Chris
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:E207B799-76CE-4FCB-AA42-B9B89CF0F768@.microsoft.com...
> Hi Chris
> You may want to try installing from SQL Express the tools only which will
> not install Management studio or Profiler, but I don't know if BCP is
> included.
> John
> "Chris Wood" wrote:
>> That's what I thought John.
>> We have some non MS SQL servers that don't really need the full Client
>> Tools, just the Native Client, SQLCMD and BCP. I could find the first 2
>> and
>> had hoped that BCP might be available too but if not then we should just
>> be
>> able to copy an SQL2005 BCP.EXE onto the server.
>> Thanks
>> Chris
>> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
>> news:B7EDF30E-63A6-4757-BA3C-A6A8D53600AF@.microsoft.com...
>> > Hi Chris
>> >
>> > I am not sure about the licencing issue with installing the Feature
>> > pack
>> > version on it's own! AFAIK BCP.EXE is not available as a standalone
>> > install,
>> > although there are example applications using the Bulk Copy API which
>> > you
>> > could use to write your own application.
>> >
>> > John
>> >
>> > "Chris Wood" wrote:
>> >
>> >> Hi,
>> >>
>> >> I know that BCP.EXE is part of the client tools for SQL2005. Does it
>> >> also
>> >> come as part of a standalone like say SQLCMD.EXE as a standalone from
>> >> the
>> >> feature Pack? We are looking to install the Native client and SQLCMD
>> >> and
>> >> BCP
>> >> without the other executables.
>> >>
>> >> Thanks
>> >>
>> >> Chris
>> >>
>> >>
>> >>
>>|||John,
I downloaded the SQLExpress and can see, using Winzip, that it has BCP
included as part. I do not have a machine to install this onto so can I just
pick Native client, SQLCMD and BCP from the downloaded package? I would like
to know if this is an option or not?
Thanks
Chris
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:E207B799-76CE-4FCB-AA42-B9B89CF0F768@.microsoft.com...
> Hi Chris
> You may want to try installing from SQL Express the tools only which will
> not install Management studio or Profiler, but I don't know if BCP is
> included.
> John
> "Chris Wood" wrote:
>> That's what I thought John.
>> We have some non MS SQL servers that don't really need the full Client
>> Tools, just the Native Client, SQLCMD and BCP. I could find the first 2
>> and
>> had hoped that BCP might be available too but if not then we should just
>> be
>> able to copy an SQL2005 BCP.EXE onto the server.
>> Thanks
>> Chris
>> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
>> news:B7EDF30E-63A6-4757-BA3C-A6A8D53600AF@.microsoft.com...
>> > Hi Chris
>> >
>> > I am not sure about the licencing issue with installing the Feature
>> > pack
>> > version on it's own! AFAIK BCP.EXE is not available as a standalone
>> > install,
>> > although there are example applications using the Bulk Copy API which
>> > you
>> > could use to write your own application.
>> >
>> > John
>> >
>> > "Chris Wood" wrote:
>> >
>> >> Hi,
>> >>
>> >> I know that BCP.EXE is part of the client tools for SQL2005. Does it
>> >> also
>> >> come as part of a standalone like say SQLCMD.EXE as a standalone from
>> >> the
>> >> feature Pack? We are looking to install the Native client and SQLCMD
>> >> and
>> >> BCP
>> >> without the other executables.
>> >>
>> >> Thanks
>> >>
>> >> Chris
>> >>
>> >>
>> >>
>>|||Hi Chris
I don't think there is a way of being that selective you would need to use
the ADDLOCAL and specify Connectivity and SQL_Tools90
John
"Chris Wood" wrote:
> John,
> I downloaded the SQLExpress and can see, using Winzip, that it has BCP
> included as part. I do not have a machine to install this onto so can I just
> pick Native client, SQLCMD and BCP from the downloaded package? I would like
> to know if this is an option or not?
> Thanks
> Chris
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:E207B799-76CE-4FCB-AA42-B9B89CF0F768@.microsoft.com...
> > Hi Chris
> >
> > You may want to try installing from SQL Express the tools only which will
> > not install Management studio or Profiler, but I don't know if BCP is
> > included.
> >
> > John
> >
> > "Chris Wood" wrote:
> >
> >> That's what I thought John.
> >>
> >> We have some non MS SQL servers that don't really need the full Client
> >> Tools, just the Native Client, SQLCMD and BCP. I could find the first 2
> >> and
> >> had hoped that BCP might be available too but if not then we should just
> >> be
> >> able to copy an SQL2005 BCP.EXE onto the server.
> >>
> >> Thanks
> >>
> >> Chris
> >>
> >> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> >> news:B7EDF30E-63A6-4757-BA3C-A6A8D53600AF@.microsoft.com...
> >> > Hi Chris
> >> >
> >> > I am not sure about the licencing issue with installing the Feature
> >> > pack
> >> > version on it's own! AFAIK BCP.EXE is not available as a standalone
> >> > install,
> >> > although there are example applications using the Bulk Copy API which
> >> > you
> >> > could use to write your own application.
> >> >
> >> > John
> >> >
> >> > "Chris Wood" wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> I know that BCP.EXE is part of the client tools for SQL2005. Does it
> >> >> also
> >> >> come as part of a standalone like say SQLCMD.EXE as a standalone from
> >> >> the
> >> >> feature Pack? We are looking to install the Native client and SQLCMD
> >> >> and
> >> >> BCP
> >> >> without the other executables.
> >> >>
> >> >> Thanks
> >> >>
> >> >> Chris
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>

BCP for SQL2005

Hi,
I know that BCP.EXE is part of the client tools for SQL2005. Does it also
come as part of a standalone like say SQLCMD.EXE as a standalone from the
feature Pack? We are looking to install the Native client and SQLCMD and BCP
without the other executables.
Thanks
ChrisHi Chris
I am not sure about the licencing issue with installing the Feature pack
version on it's own! AFAIK BCP.EXE is not available as a standalone install,
although there are example applications using the Bulk Copy API which you
could use to write your own application.
John
"Chris Wood" wrote:

> Hi,
> I know that BCP.EXE is part of the client tools for SQL2005. Does it also
> come as part of a standalone like say SQLCMD.EXE as a standalone from the
> feature Pack? We are looking to install the Native client and SQLCMD and B
CP
> without the other executables.
> Thanks
> Chris
>
>|||That's what I thought John.
We have some non MS SQL servers that don't really need the full Client
Tools, just the Native Client, SQLCMD and BCP. I could find the first 2 and
had hoped that BCP might be available too but if not then we should just be
able to copy an SQL2005 BCP.EXE onto the server.
Thanks
Chris
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:B7EDF30E-63A6-4757-BA3C-A6A8D53600AF@.microsoft.com...[vbcol=seagreen]
> Hi Chris
> I am not sure about the licencing issue with installing the Feature pack
> version on it's own! AFAIK BCP.EXE is not available as a standalone
> install,
> although there are example applications using the Bulk Copy API which you
> could use to write your own application.
> John
> "Chris Wood" wrote:
>|||Hi Chris
You may want to try installing from SQL Express the tools only which will
not install Management studio or Profiler, but I don't know if BCP is
included.
John
"Chris Wood" wrote:

> That's what I thought John.
> We have some non MS SQL servers that don't really need the full Client
> Tools, just the Native Client, SQLCMD and BCP. I could find the first 2 an
d
> had hoped that BCP might be available too but if not then we should just b
e
> able to copy an SQL2005 BCP.EXE onto the server.
> Thanks
> Chris
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:B7EDF30E-63A6-4757-BA3C-A6A8D53600AF@.microsoft.com...
>
>|||That's something worth trying.
Thanks
Chris
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:E207B799-76CE-4FCB-AA42-B9B89CF0F768@.microsoft.com...[vbcol=seagreen]
> Hi Chris
> You may want to try installing from SQL Express the tools only which will
> not install Management studio or Profiler, but I don't know if BCP is
> included.
> John
> "Chris Wood" wrote:
>|||John,
I downloaded the SQLExpress and can see, using Winzip, that it has BCP
included as part. I do not have a machine to install this onto so can I just
pick Native client, SQLCMD and BCP from the downloaded package? I would like
to know if this is an option or not?
Thanks
Chris
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:E207B799-76CE-4FCB-AA42-B9B89CF0F768@.microsoft.com...[vbcol=seagreen]
> Hi Chris
> You may want to try installing from SQL Express the tools only which will
> not install Management studio or Profiler, but I don't know if BCP is
> included.
> John
> "Chris Wood" wrote:
>|||Hi Chris
I don't think there is a way of being that selective you would need to use
the ADDLOCAL and specify Connectivity and SQL_Tools90
John
"Chris Wood" wrote:

> John,
> I downloaded the SQLExpress and can see, using Winzip, that it has BCP
> included as part. I do not have a machine to install this onto so can I ju
st
> pick Native client, SQLCMD and BCP from the downloaded package? I would li
ke
> to know if this is an option or not?
> Thanks
> Chris
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:E207B799-76CE-4FCB-AA42-B9B89CF0F768@.microsoft.com...
>
>

2012年2月16日星期四

Batching a cmd

Hi,
I'd like to do a daily backup of my db using windows programmed task and
running the following batch file:
sqlcmd -S server\db_Express -U username -P password
BACKUP DATABASE [dbSQL] TO DISK = N'D:\db05\dbSQL' WITH NOFORMAT, INIT,
NAME = N'dbSQL-Complite backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
declare @.backupSetId as int
select @.backupSetId = position from msdb..backupset where
database_name=N'dbSQL' and backup_set_id=(select max(backup_set_id) from
msdb..backupset where database_name=N'dbSQL' )
if @.backupSetId is null begin raiserror(N'Error de comprobación. No se
encuentra la información de copia de seguridad para la base de datos
''dbSQL''.', 16, 1) end
RESTORE VERIFYONLY FROM DISK = N'D:\db05\dbSQL' WITH FILE = @.backupSetId,
NOUNLOAD, NOREWIND
GO
exit
but the batch file hangs at exit and doesn't close the session.
What am I doing wrong?
TIA
Ana
SQL2005 Express> but the batch file hangs at exit and doesn't close the session.
This is because you have not specified the script source for the SQLCMD
utility so it is running in interactive mode. With a long script and/or
multiple batches, you can save the script to a file and specify the script
file path via the -i argument. For example:
sqlcmd -S server\db_Express -U username -P password -i
"C:\Scripts\MyBackupScript.sql"
See the Books online
(ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/sqlcmpt9/html/e1728707-5215-4c04-8320-e36f161b834a.htm)
for SQLCMD argument details.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Ana" <ananospam@.yahoo.com> wrote in message
news:O7%23cUkxcHHA.1244@.TK2MSFTNGP04.phx.gbl...
> Hi,
> I'd like to do a daily backup of my db using windows programmed task and
> running the following batch file:
> sqlcmd -S server\db_Express -U username -P password
> BACKUP DATABASE [dbSQL] TO DISK = N'D:\db05\dbSQL' WITH NOFORMAT, INIT,
> NAME = N'dbSQL-Complite backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
> GO
> declare @.backupSetId as int
> select @.backupSetId = position from msdb..backupset where
> database_name=N'dbSQL' and backup_set_id=(select max(backup_set_id) from
> msdb..backupset where database_name=N'dbSQL' )
> if @.backupSetId is null begin raiserror(N'Error de comprobación. No se
> encuentra la información de copia de seguridad para la base de datos
> ''dbSQL''.', 16, 1) end
> RESTORE VERIFYONLY FROM DISK = N'D:\db05\dbSQL' WITH FILE => @.backupSetId, NOUNLOAD, NOREWIND
> GO
> exit
> but the batch file hangs at exit and doesn't close the session.
> What am I doing wrong?
> TIA
> Ana
> SQL2005 Express