2012年3月29日星期四
bcp.exe installation
more appropriate place)
I'm using the bcp utility to create a text file from a view. The text file
is used by a 3rd party program for other processing.
bcp installs on the server machine with sql 2k (or in my case MSDE) just
fine but of course it's not automatically on any of the client machines. But
that's where I need it because those are the users that create and make use
of this text file.
My qustion is how to install bcp on the client machines without installing
MSDE. I thought it would work to just copy the file to an appropriate
location but apparently it needs to be installed. How do I go about that?
Thanks,
Keith
Never mind. I found a very nice inexpensive 3rd party control for use with
Delphi that will export datasources to all sorts of output formats. This is
a better solution since now I have no need at all for bcp.
Keith
2012年2月23日星期四
BCP and Date Problems
We have a job that, every night, imports mail logs into SQL Server for processing. We receive these mail logs from the mail group, so we have no say in how the log should be formatted, basically we are given what we are given.
Our problem started occurring on Oct-01, and has occured every day since then.
The log file may contain rows with dates such as follows (don't ask me why there isn't a consistant format)
1) 2003-10-01 00:18:5
2) 2003-9-01 00:8:6
3) 2003-9-1 00:9:6
4) 2003-9-1 0:09:6
5) 2003-10-1 00:18:6
6) 2003-10-01 0:19:6
7) 2003-10-01 00:8:6
Now, 1-4 import. 5-7 don't.
From what I can see.
If the month is a single digit month, i.e. September above, then it will import basically all formats (e.g. 1 digit for the hour, 1 digit for the minute or 1 digit for the day).
If the month is a double digit month, i.e. October above, then it will not import unless the date is perfectly formatted (e.g. 2 digits for the hour AND 2 digits for the minute AND 2 digits for day).
An excerpt from the format file we are using is listed below.
Why does SQL Server allow 'bad' dates with single digit months, but not double digit months? It's really confusing me. I know the obvious solution, tell the Mail guys to properly format their files, but are there any other solutions?
Thanks heaps. Hope I've asked this clearly.
Format File
----
8.0
11
1 SQLCHAR 0 0 "" 0 TBL_MAIL_LOG_ID ""
2 SQLCHAR 0 0 "" 0 LOG_FILE_ID ""
3 SQLCHAR 0 1 " " 3 DATE ""
The last line reads (broken into individual lines below)
3
SQLCHAR
0
1
" " <-- there is a space in there
3
DATE
""Howdy
Sadly it appears its a quirk in SQL - unless a '1' is an '01' it seems to get its knickers in a knot, especially at the start of a column of information.
Try importing the raw data into another table that uses CHAR instead of datetime for the dates, then add the '0' to any dates required, then transfer across to final table. Its time consuming, but in the long run more robust.
Cheers
SG
2012年2月18日星期六
BCP
I have a question. If some one in our group (who are the admins, we use
trusted connection to SQL Server 2000) runs BCP and pull the data, is that
can be logged. i have never seen any events in the logs (like bcp ran, DTS
ran).
advise me any good plans.
Thanks,
Jay.John wrote:
> HI ALL,
> I have a question. If some one in our group (who are the admins, we
> use trusted connection to SQL Server 2000) runs BCP and pull the
> data, is that can be logged. i have never seen any events in the logs
> (like bcp ran, DTS ran).
> advise me any good plans.
> Thanks,
> Jay.
The log does not contain select access to data, just data that has
changed in some way. What are you looking see here? Maybe you need to
use Profiler to capture specific types of access to the database.
--
David Gugick
Imceda Software
www.imceda.com
BCP
I have a question. If some one in our group (who are the admins, we use
trusted connection to SQL Server 2000) runs BCP and pull the data, is that
can be logged. i have never seen any events in the logs (like bcp ran, DTS
ran).
advise me any good plans.
Thanks,
Jay.
John wrote:
> HI ALL,
> I have a question. If some one in our group (who are the admins, we
> use trusted connection to SQL Server 2000) runs BCP and pull the
> data, is that can be logged. i have never seen any events in the logs
> (like bcp ran, DTS ran).
> advise me any good plans.
> Thanks,
> Jay.
The log does not contain select access to data, just data that has
changed in some way. What are you looking see here? Maybe you need to
use Profiler to capture specific types of access to the database.
David Gugick
Imceda Software
www.imceda.com
2012年2月16日星期四
BC30451 Name 'whatever' is not declared
group header, have a formula that shows that group's total as a % of
the grand total. Example:
Name Sales % of total
Tom 5 25%
Joe 15 75%
so, in my table, I have a table footer with a textbox "textbox1" with
the formula
=SUM(Fields!SALES.Value )
and in the group1 header, i have a textbox "textbox2". For the formula,
i put:
=Fields!SALES.Value / textbox1.value
This works in access, but apparently not in RS (?). I get an error
message that textbox1 is not declared. It seems like I must be missing
something simple here. Any Ideas? I could put subqueries in my dataset
I suppose, but that seems like an awfully long way around to do what I
need. Thanks in advance...
EricWill ReportItems!Textbox1.Value work?
Steve MunLeeuw
<c-eric.geil@.mci.com> wrote in message
news:1161292630.251749.186250@.k70g2000cwa.googlegroups.com...
> I'm migrating a report from access to RS. What I want to do is for each
> group header, have a formula that shows that group's total as a % of
> the grand total. Example:
> Name Sales % of total
> Tom 5 25%
> Joe 15 75%
> so, in my table, I have a table footer with a textbox "textbox1" with
> the formula
> =SUM(Fields!SALES.Value )
> and in the group1 header, i have a textbox "textbox2". For the formula,
> i put:
> =Fields!SALES.Value / textbox1.value
> This works in access, but apparently not in RS (?). I get an error
> message that textbox1 is not declared. It seems like I must be missing
> something simple here. Any Ideas? I could put subqueries in my dataset
> I suppose, but that seems like an awfully long way around to do what I
> need. Thanks in advance...
>
> Eric
>|||that worked...thanks!
What's the deal with the expression builder? It seems like it would
have some functions and/or controls listed in there to give the user
some clue as to their verbiage...
thanks again..
eric
2012年2月9日星期四
basic sql question
I need to add all the records being counted for all groups.
I would like to add this count for each group into a total for all
groups( the 8 rows). Is this possible?
MSG_CD MSG_TEXT
COUNT(CCHDBA.III_SYNC_RESULT.I
-- ----------------
----------
E1349 SID NOT FOUND IN CCH DATA
254
E1350 STATUS FLAG DOES NOT MATCH
19
E1351 FBI NUMBER IN CCH DOESNT EXIST IN FBI SYNC TAPE
47
E1352 FBI NAME NOT FOUND IN CCH
227
E1353 FBI DOB DOESNT MATCH DOB IN CCH
2
E1354 FBI SEX CODE DOESNT MATCH IN CCH
46
E1355 FBI RACE CODE DOESNT MATCH IN CCH
2998
E1379 SID IN CCH NOT IN FBI SYNC - FBI NUMBER DOES EXIST
25
8 rows selected
SQL
SELECT
CCHDBA.III_RESULT_MESSAGE_XREF.MSG_CD,
CCH_MESSAGE.MSG_TEXT,
count(CCHDBA.III_SYNC_RESULT.III_RESULT_ID)
FROM CCHDBA.III_SYNC_RESULT,
CCHDBA.III_RESULT_MESSAGE_XREF,
CCH_MESSAGE
WHERE ( III_SYNC_RESULT.III_RESULT_ID =
CCHDBA.III_RESULT_MESSAGE_XREF.III_RESULT_ID )
AND ( III_RESULT_MESSAGE_XREF.MSG_CD = CCH_MESSAGE.MSG_CD )
GROUP BY CCHDBA.III_RESULT_MESSAGE_XREF.MSG_CD,
CCH_MESSAGE.MSG_TEXT;
Inappropriate post?
If so, Red Flag it!jwa6 (jwagans@.yahoo.com) writes:
> I need to add all the records being counted for all groups.
> I would like to add this count for each group into a total for all
> groups( the 8 rows). Is this possible?
I will have to admit that I don't understand what you are looking
for.
The standard recommendation for this type of question is to include:
o CREATE TABLE statements for your table.
o INSERT statements with sample data (just enough rows to demonstrate
the problem.)
o The desired result given the sample.
o A short narrative of what you are trying to achieve.
This permits people to post a tested solution to your problem.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"jwa6" <jwagans@.yahoo.com> wrote in message
news:1111693328.831625.88890@.f14g2000cwb.googlegro ups.com...
> hi
> I need to add all the records being counted for all groups.
> I would like to add this count for each group into a total for all
> groups( the 8 rows). Is this possible?
If I understand you correctly, you could add WITH ROLLUP to the GROUP BY
clause. Having said that, your post looks rather like Oracle, not MSSQL - if
so, you should probably post in an Oracle group to get a better answer. If
you are using MSSQL, then as Erland said, please post some code to show
exactly what you want.
Simon