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

2012年2月25日星期六

BCP call to stored procedure - broke during upgrade from SQL 7.0 to 2000

I have this stored procedure that takes a few parameters like date and
merchant ID, and basically goes through a set of if-then statements to build
a SQL SELECT string.

When we upgraded from SQL Server 7.0 to 2000, the stored procedure still
worked from Query Analyzer, but not in BCP. It used to work in BCP just
fine with 7.0. The error I get now is:

SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]BCP host-files must contain
at least one column

What's really strange is, if I instruct the stored procedure to simply print
the SELECT string, then cut-and-paste it into the end of stored procedure
code (assigning it to the variable that already contains the SELECT string),
then it works from BCP.

Any help would be greatly appreciated.

AstonAston (alau@.selera.com) writes:
> I have this stored procedure that takes a few parameters like date and
> merchant ID, and basically goes through a set of if-then statements to
> build a SQL SELECT string.
> When we upgraded from SQL Server 7.0 to 2000, the stored procedure still
> worked from Query Analyzer, but not in BCP. It used to work in BCP just
> fine with 7.0. The error I get now is:
> SQLState = S1000, NativeError = 0
> Error = [Microsoft][ODBC SQL Server Driver]BCP host-files must contain
> at least one column
> What's really strange is, if I instruct the stored procedure to simply
> print the SELECT string, then cut-and-paste it into the end of stored
> procedure code (assigning it to the variable that already contains the
> SELECT string), then it works from BCP.

If I understand this right you are doing something like:

bcp "exec some_db..some_sp" queryout datafile.bcp -c -T

To find out what columns there are in the query, bcp first submits the
query with SET FMTONLY ON. This command is causes SQL Server to not execute
the statements in the procedure, but return data about any result sets
it finds. However, if you produces a dynamic SQL string and executes it,
there not be anyting executed with FMTONLY ON, and BCP will not find any
result set.

Why this worked in SQL 7, I don't know. (I never worked much with SQL 7,
jumped direct to SQL 2000 from 6.5.)

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

2012年2月11日星期六

Basic Upgrade questions

Hi,
I need a few no nonsense answers to help me with my current SQL setup.
I currently have SQL7.0 Server running on NT4.0 SP6 box and also a SQL7.0
server running on a Windows 2000 SP4 box.
They are not clustered but I want to upgrade the SQL to SQL 2000 on both
boxes and I must also upgrade the NT4 to Win 2000.
What I want to know is, what is the best way to do this so that I can avail
of SQL clustering.
Both SQL instances should be equal so that either server can take requests
automatically if the other fails.
All help would be greatly appreciated.
Some suggestions:
1) Upgrade to Win2K BEFORE doing the upgrade to SQL2K
2) Ensure that you will be running Win2K Advanced Server or Datacenter
server
3) Ensure that you will be running SQL2K Enterprise Edition
4) It sounds like you want a single-instance SQL cluster, formerly known
as Active/Passive
6) Make sure to update statistics WITH FULLSCAN on all of your tables
7) If you have the bucks, go with new hardware and just migrate the
databases to the new cluster
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
"Padraig" <Padraig@.discussions.microsoft.com> wrote in message
news:C17ADBE9-CC8F-4128-9F20-582DA05C073F@.microsoft.com...
Hi,
I need a few no nonsense answers to help me with my current SQL setup.
I currently have SQL7.0 Server running on NT4.0 SP6 box and also a SQL7.0
server running on a Windows 2000 SP4 box.
They are not clustered but I want to upgrade the SQL to SQL 2000 on both
boxes and I must also upgrade the NT4 to Win 2000.
What I want to know is, what is the best way to do this so that I can avail
of SQL clustering.
Both SQL instances should be equal so that either server can take requests
automatically if the other fails.
All help would be greatly appreciated.
|||One more recommendation. Once you are up to where you want to be in
software versions, do a rolling clean install for each node. Wipe each node
and reinstall the OS from scratch. The instructions in BOL for Maintaining
a Failover Cluster list what to if a node completely fails. Just do this
once for each node reusing the 'failed' hardware after a clean install.
This way you guarantee there are no issues lef over from an upgrade, but you
still get the small step benefits of upgrading in place. It is definitely
more work, but I think it leaves a cleaner and more stable system.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:ONTo1vJrEHA.2340@.TK2MSFTNGP11.phx.gbl...
> Some suggestions:
> 1) Upgrade to Win2K BEFORE doing the upgrade to SQL2K
> 2) Ensure that you will be running Win2K Advanced Server or Datacenter
> server
> 3) Ensure that you will be running SQL2K Enterprise Edition
> 4) It sounds like you want a single-instance SQL cluster, formerly
known
> as Active/Passive
> 6) Make sure to update statistics WITH FULLSCAN on all of your tables
> 7) If you have the bucks, go with new hardware and just migrate the
> databases to the new cluster
> --
> Tom
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com
>
> "Padraig" <Padraig@.discussions.microsoft.com> wrote in message
> news:C17ADBE9-CC8F-4128-9F20-582DA05C073F@.microsoft.com...
> Hi,
> I need a few no nonsense answers to help me with my current SQL setup.
> I currently have SQL7.0 Server running on NT4.0 SP6 box and also a SQL7.0
> server running on a Windows 2000 SP4 box.
> They are not clustered but I want to upgrade the SQL to SQL 2000 on both
> boxes and I must also upgrade the NT4 to Win 2000.
> What I want to know is, what is the best way to do this so that I can
avail
> of SQL clustering.
> Both SQL instances should be equal so that either server can take requests
> automatically if the other fails.
> All help would be greatly appreciated.
>

Basic Upgrade questions

Hi,
I need a few no nonsense answers to help me with my current SQL setup.
I currently have SQL7.0 Server running on NT4.0 SP6 box and also a SQL7.0
server running on a Windows 2000 SP4 box.
They are not clustered but I want to upgrade the SQL to SQL 2000 on both
boxes and I must also upgrade the NT4 to Win 2000.
What I want to know is, what is the best way to do this so that I can avail
of SQL clustering.
Both SQL instances should be equal so that either server can take requests
automatically if the other fails.
All help would be greatly appreciated.Some suggestions:
1) Upgrade to Win2K BEFORE doing the upgrade to SQL2K
2) Ensure that you will be running Win2K Advanced Server or Datacenter
server
3) Ensure that you will be running SQL2K Enterprise Edition
4) It sounds like you want a single-instance SQL cluster, formerly known
as Active/Passive
6) Make sure to update statistics WITH FULLSCAN on all of your tables
7) If you have the bucks, go with new hardware and just migrate the
databases to the new cluster
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
"Padraig" <Padraig@.discussions.microsoft.com> wrote in message
news:C17ADBE9-CC8F-4128-9F20-582DA05C073F@.microsoft.com...
Hi,
I need a few no nonsense answers to help me with my current SQL setup.
I currently have SQL7.0 Server running on NT4.0 SP6 box and also a SQL7.0
server running on a Windows 2000 SP4 box.
They are not clustered but I want to upgrade the SQL to SQL 2000 on both
boxes and I must also upgrade the NT4 to Win 2000.
What I want to know is, what is the best way to do this so that I can avail
of SQL clustering.
Both SQL instances should be equal so that either server can take requests
automatically if the other fails.
All help would be greatly appreciated.|||One more recommendation. Once you are up to where you want to be in
software versions, do a rolling clean install for each node. Wipe each node
and reinstall the OS from scratch. The instructions in BOL for Maintaining
a Failover Cluster list what to if a node completely fails. Just do this
once for each node reusing the 'failed' hardware after a clean install.
This way you guarantee there are no issues lef over from an upgrade, but you
still get the small step benefits of upgrading in place. It is definitely
more work, but I think it leaves a cleaner and more stable system.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:ONTo1vJrEHA.2340@.TK2MSFTNGP11.phx.gbl...
> Some suggestions:
> 1) Upgrade to Win2K BEFORE doing the upgrade to SQL2K
> 2) Ensure that you will be running Win2K Advanced Server or Datacenter
> server
> 3) Ensure that you will be running SQL2K Enterprise Edition
> 4) It sounds like you want a single-instance SQL cluster, formerly
known
> as Active/Passive
> 6) Make sure to update statistics WITH FULLSCAN on all of your tables
> 7) If you have the bucks, go with new hardware and just migrate the
> databases to the new cluster
> --
> Tom
> ---
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com
>
> "Padraig" <Padraig@.discussions.microsoft.com> wrote in message
> news:C17ADBE9-CC8F-4128-9F20-582DA05C073F@.microsoft.com...
> Hi,
> I need a few no nonsense answers to help me with my current SQL setup.
> I currently have SQL7.0 Server running on NT4.0 SP6 box and also a SQL7.0
> server running on a Windows 2000 SP4 box.
> They are not clustered but I want to upgrade the SQL to SQL 2000 on both
> boxes and I must also upgrade the NT4 to Win 2000.
> What I want to know is, what is the best way to do this so that I can
avail
> of SQL clustering.
> Both SQL instances should be equal so that either server can take requests
> automatically if the other fails.
> All help would be greatly appreciated.
>