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

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月11日星期六

Basic steps as how to web usage mine in sql server 2005

Hi there,

I am doing a project on web usage mining of my universities server logs and im just wondering how i go about mining them in sql server 2005?

Do i mine them in one table? do i normalise the web log data? what algorithms will i use on them as im trying to get usage patterns from the users and also where most of the users come from.

Thanks in advance

Gary

Hi

Here’re some thoughts that might help you design your Data Mining for weblogs:

1. You can put the data in one or more tables as per the semantics of the data. Data which is an entity by itself should be put in a flat table with one key per entry (user sessions on the web server for example), whereas some data naturally will have a many to one relation with the primary data (page visits per session for example) and can be put in a separate table with primary/foreign key relationship. SQL Server 2005 will model them as case table/nested table for the purpose of mining.

2. Normalize: Depends on what your data looks like. If you want to run clustering algorithm and your data has two attributes, A and B and A is 10 times more important than B, you should normalize accordingly. If the actual values of A are in order of thousand and actual values ob B are in order of tens and they are equally important, you should again normalize. However, if you want to use the as-is value without a weight, you do not have to normalize the data.

3. Usage Patterns, like a sequence of page visits can be modeled using sequence clustering algorithm. User categorization based on attributes might be a clustering algorithm. If you have more information on what you want to find out, I might be able to suggest more specific choices.

Hope this helps

Shuvro

2012年2月9日星期四

Basic Security Steps

Hi Folks,
Even I know all the different anserwers for the questions,
still I wanted the best one for this query. As I was being
asked in an interview recently...
Q1: What would be the TOP TEN Steps You would do to Secure
SQL Server 2000 Database.
Thanks
Dan !They may have thought of that question from this page -
http://www.microsoft.com/technet/tr...
t/sql2ksrg.asp
HTH
Ray Higdon MCSE, MCDBA, CCNA
--
"Dan" <anonymous@.discussions.microsoft.com> wrote in message
news:220701c3e084$eb6d7570$a501280a@.phx.gbl...
quote:

> Hi Folks,
> Even I know all the different anserwers for the questions,
> still I wanted the best one for this query. As I was being
> asked in an interview recently...
> Q1: What would be the TOP TEN Steps You would do to Secure
> SQL Server 2000 Database.
> Thanks
> Dan !