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

2012年3月6日星期二

BCP Error handling

I am running some bcp copies through a Sql job. I am copying 35 tables in individual steps. However, sometimes the bcp step fails to copy the data, and I want the step to fail if the data is not copied properly. Is that possible? If so, how? Any help is greatly appreciated.Are your BCP statements in a stored procedure?|||Here is something I hope will help:

declare
@.FILENAME_C nvarchar(255),
@.sqlstmt2 nvarchar(255),
@.outputcatch varchar(1000)

SET @.FILENAME_C= 'c:\it.txt'
SET @.SQLSTMT2='BCP "SELECT claimnumber from demo.dbo.wcclm1" queryout '+@.FILENAME_C+' /c /t, /r \n /U demo /P demo /S '+@.@.servername
EXEC @.outputcatch=MASTER.DBO.XP_CMDSHELL @.SQLSTMT2, no_output --@.outputcatch=OUTPUT

select @.outputcatch

Note that this sample has a simple select statement. If I change claimnumber to clamnumber @.outputcatch is 1 due to failure. Put it back to claimnumber and it returns 0 which indicates success.

Just keep looking at @.outputcatch and if you get a 1 RETURN.

2012年2月16日星期四

BATCH Update ?

Hi all,

we need to update many single cells with individual MDX Update Statements.
We're doing this with ADOMD now (C# Project) in a loop.
In order to save roundtrips and put things in one transaction
we considered using the <Batch> Element of XMLA.
I could'nt find a example how to use this with MDX Commands.
this doesnt work:
<Batch>
<Command>
<Statement>
UPDATE ..
</Statement>
</Command>
<Command>
<Statement>
UPDATE..
</Statement>
</Command>
</Batch>

The Batch element at line 7, column 22 (namespace urn:schemas-microsoft-com:xml-analysis) cannot appear under Envelope/Body/Execute/Command.

Do you have any hints ?
BTW: what happend to www.xmla.org, its down?
Wher can I find a complete schema file for XMLA?
a lot of questions...
Thanks a lot,
mik

You can update multiple cell values in a single Update statement seperated by commas.

For example:

UPDATE CUBE [Cube1] SET

(USA, Sales) = 100 USE_EQUAL_ALLOCATION,

(Canada, Sales) = 50 USE_EQUAL_ALLOCATION

You can also find some information on XML/A at

http://msdn2.microsoft.com/de-de/library/ms186604.aspx

2012年2月9日星期四

Basic SQL Cluster Question

I am fairly new to administering SQL Server in a cluster environment,
I was kinda confused this morning when I was reading a post where a
individual installed SP2 for SQL 2005 on both the noeds of the
cluster. My understanding was you install the SP2 in just one node and
the cluster service takes care of it. Am I wrong? Do we really need to
install it in both the nodes?
Thanksshub wrote:
> I am fairly new to administering SQL Server in a cluster environment,
> I was kinda confused this morning when I was reading a post where a
> individual installed SP2 for SQL 2005 on both the noeds of the
> cluster. My understanding was you install the SP2 in just one node and
> the cluster service takes care of it. Am I wrong? Do we really need to
> install it in both the nodes?
> Thanks
>
actualy, SP2 instalation does it on other node(s) automaticaly, it just
asks you for a administrator login/password on the other node(s).
Finaly, sp2 instalation asks you for the restart of the node you're
running it on and reminds you to restart other node(s) manualy|||It depends on what you are patching. Some components are cluster-aware and
update all nodes. Some components require updating on each node
individually.
This blog post covers what goes where.
http://weblogs.sqlteam.com/geoffh/archive/2007/10/04/To-Cluster-or-Not-to-Cluster-That-SSIS-the-Question.aspx
--
Geoff N. Hiten
Senior SQL Infrastructure Consultant
Microsoft SQL Server MVP
"shub" <shubtech@.gmail.com> wrote in message
news:1193403686.136330.93900@.o3g2000hsb.googlegroups.com...
>I am fairly new to administering SQL Server in a cluster environment,
> I was kinda confused this morning when I was reading a post where a
> individual installed SP2 for SQL 2005 on both the noeds of the
> cluster. My understanding was you install the SP2 in just one node and
> the cluster service takes care of it. Am I wrong? Do we really need to
> install it in both the nodes?
> Thanks
>

Basic SQL Cluster Question

I am fairly new to administering SQL Server in a cluster environment,
I was kinda confused this morning when I was reading a post where a
individual installed SP2 for SQL 2005 on both the noeds of the
cluster. My understanding was you install the SP2 in just one node and
the cluster service takes care of it. Am I wrong? Do we really need to
install it in both the nodes?
ThanksHi
You would not need to do this normally, you would need to post a link and
give more information.
John
"shub" wrote:
> I am fairly new to administering SQL Server in a cluster environment,
> I was kinda confused this morning when I was reading a post where a
> individual installed SP2 for SQL 2005 on both the noeds of the
> cluster. My understanding was you install the SP2 in just one node and
> the cluster service takes care of it. Am I wrong? Do we really need to
> install it in both the nodes?
> Thanks
>

Basic Replication trouble.

I'm trying to run a simple update script on this database which is
created from a replication agent. Several individual databases are
replicated into one consolidated. I've not worked with replication
before and I was hoping someone could tell me what this error means.

UPDATE
CUSTOMER
SET
[TIMESTAMP]='20060920090453'
[IVBTYPE]='M '
WHERE
[ROWID]='9f83bc89-76f8-4140-a0cc-58fa34962638'

yields:

Server: Msg 208, Level 16, State 1, Procedure
upd_0119B5A9AA624A55AF1B73F2E32A7A0C, Line 14
Invalid object name 'dbo.sysmergearticles'.

Do I have to do something to the database before trying to update it?P.S. I notice I'm missing a comma in there after the first set, missed
it while I was copying it over and didn't notice until I posted.