Thursday, March 22, 2012
CLASSPATH variable?
MS article # 3323200 "How to get started with ms jdbc" says I need to set
the CLASSPATH variable to point to my jdbc.jar file location.
Where do I go to make this setting. Apparently it is not set like the PATH
variable.
Thanks
Jim Shaw wrote:
> I'm running Win/2003 Server, SQL Server 2000, and Sun Java 1.5.
> MS article # 3323200 "How to get started with ms jdbc" says I need
to set
> the CLASSPATH variable to point to my jdbc.jar file location.
> Where do I go to make this setting. Apparently it is not set like
the PATH
> variable.
You have to add the driver jar (or jars, in the case of the MS driver
-- msutil.jar, mssqlserver.jar, msbase.jar) to the CLASSPATH system
variable. It's exactly the same as setting the PATH system variable
(the only difference might be that the CLASSPATH variable is not yet
defined, so you should add it).
I would also recommend jTDS ( http://jtds.sourceforge.net/ ) instead of
the MS driver. But that's just my oppinion.
Alin,
The jTDS Project.
|||Thanks Alin.
I initally tried to use jtds. I like its features a lot. I even joined
sourceforge and downloaded jtds, but I could not find any documentation on
how to install and use it. I'm an experienced programmer, but new to both
SQL Server and the Java language. I'm in the process of self teaching them
to myself, so I need some simple documentation to get started. I'm finding
that at MS, so I downloaded their driver for starters. Does jtds have such
documentation, or must I complete my Java learnings and then read the jtds
source code to figure out how to use it?
Jim
"Alin Sinpalean" <alin@.earthling.net> wrote in message
news:1107866811.028206.24460@.g14g2000cwa.googlegro ups.com...
> Jim Shaw wrote:
> to set
> the PATH
> You have to add the driver jar (or jars, in the case of the MS driver
> -- msutil.jar, mssqlserver.jar, msbase.jar) to the CLASSPATH system
> variable. It's exactly the same as setting the PATH system variable
> (the only difference might be that the CLASSPATH variable is not yet
> defined, so you should add it).
> I would also recommend jTDS ( http://jtds.sourceforge.net/ ) instead of
> the MS driver. But that's just my oppinion.
> Alin,
> The jTDS Project.
>
|||Jim Shaw wrote:
> Does jtds have such
> documentation, or must I complete my Java learnings and then read the
jtds
> source code to figure out how to use it?
jTDS has all the documentation you need to get started with it (both
online and in the distribution package -- the web site contents are
part of the distribution). There are also README files for each feature
that needs special configuration/installation, such as SSL, Windows
Single Sign On or XA distributed transactions. Start with the FAQ:
http://jtds.sourceforge.net/faq.html
Alin.
Sunday, March 11, 2012
Choose path to travel on!!
Hi there
I am up against a condition where my control flow should be divided into threads and depending on value of a variable i have to choose 1 of the threads.
Its something like
if a =1 then execute this
else execute this one.
Thanks and Regards
Rahul Kumar, Software Enggineer
You need conditional precedence constraints. This article explains them:
Introduction to Expressions on Workflow
(http://www.sqlis.com/default.aspx?306)
-Jamie
|||
Thanks a lot,
Regards
Rahul Kumar, Software Engineer
Friday, February 24, 2012
Checking the type of a variable in SQL
if a variable is a float or a string.
Thanks,
RamziHi
I assume you mean that you want to check the contents of a string to see if
it is a numeric value. There is a ISNUMERIC function (see books online) but
to avoid problems with comma being recognised as a decimal point then you
may want to use patindex instead and check for any character then is not 0-9
or decimal point. Such as http://tinyurl.com/45ejw
John
"Ramzi Abboud" <ramziabb@.gmail.com> wrote in message
news:a5617e65.0410261046.6f18c9f3@.posting.google.c om...
> Is there a way to check the type of a variable in SQL? I want to know
> if a variable is a float or a string.
> Thanks,
> Ramzi
Checking the state of a variable as first step of package?
Am I correct in thinking that I need to place a dummy script component which does nothing in order to route logic depending on the value of a variable?
ie. I want to output to a file if a Parent variable is a certain value, or i want to load a table if its a different value.
Unfortunately, yes.
checking the error code
I am sending a list of comma separated codes as a parameter to stored
procedure. As I parse the list, I put them in the table variable (or temp
table) using insert statement.
For example if the parameter is 1001,3233,4444,2223,4452,5523, after the
parsing, the table variable will contain 6 rows with the respective code.
Now, do I need to check @.@.ERROR after each insert statement whether it was
successful or not even though I am dealing with table variable?
Of course I am trying to avoid following approach
WHILE EndOfListCondition
BEGIN
BEGIN
INSERT tblCode(Code) VALUES(@.ParsedCodeID)
SET @.ErrorCheck = @.@.ERROR
IF @.ErrorCheck <> 0 GOTO ERR_HANDLER
END
END
and use
WHILE EndOfListCondition
BEGIN
BEGIN
INSERT @.tableVariable(Code) VALUES(@.ParsedCodeID)
-- ? Do I need error check here?
END
END
INSERT tblCode(Code)
SELECT Code
FROM @.tableVariable
Thanks
JJustin (jyang@.ioutsource.info) writes:
> I am sending a list of comma separated codes as a parameter to stored
> procedure. As I parse the list, I put them in the table variable (or temp
> table) using insert statement.
> For example if the parameter is 1001,3233,4444,2223,4452,5523, after the
> parsing, the table variable will contain 6 rows with the respective code.
> Now, do I need to check @.@.ERROR after each insert statement whether it was
> successful or not even though I am dealing with table variable?
Now that is a good question. Fortunately, the answer in SQL 2005 is
simple: set up a TRY-CATCH handler that embraces the entire procedure
as a matter of routines.
In SQL 2000, it's worse. My own approach is that I always check
@.@.error after every INSERT, DELETE and UPDATE although that I know
that some of them just can go wrong. Then again, I'm not checking
error after SELECT, despite a lot of our client code is running with
SET LOCK_TIMEOUT 29000. (Which is a stpuid idea.)
What I do to make this easier, is that I have some clips in my editor
(Textpad), so that I can easily add error checking. I'm also formatting
it compactly, so that it does not take up too much space.
Error handling in SQL Server 2000 is a boring business. For more
advice, my article http://www.sommarskog.se/error-handling-II.html
could be of interest.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
Checking that an object is not empty
Hi,
Does anyone know the correct syntax to check the contents of an object variable. I want to do this as part of a constraint,
TIA
R
Variables of type Object are not support in expressions -
"The data type of variable "User::Variable" is not supported in an expression."
|||Thanks for your reply.
I have a problem then. I want to pass in this object to use in an ExecuteSQL task, as my input parameter. However, because of some conditional execution, there may not be anything to update. This means that the object has nothing in it, and at the moment. This is causing my task to fail.
Any ideas?
|||You could read the object variable inside a script task, and check for it equalling Nothing.
Then set a boolean variable indicating whether it is populated or not and put an expression on the precedence constraint that checks the boolean variable to see whether it should execute or not.
-Jamie
Thursday, February 16, 2012
Checking conditional in SSIS
I am converting a DTS package to SSIS.
DTS has the following steps:
1. SQL task that returns a variable ( a count ).
2. ActiveX script:
Function Main()
If DTSGlobalVariables("gsPrevProcessCount").Value > 0 Then
MsgBox "The data for one or more of your members has already been processed. Please review your data files and remove the processed files from the data directory."
Main = DTSTaskExecResult_Failure
Else
Main = DTSTaskExecResult_Success
End If
End Function
In SSIS, I have an Execute SQL Task that returns a variable PrevProcessedCount. Now, I am stuck. How do I display a message to the user (or maybe just put it in the audit log) and how to I check the variable and stop processing my package?
Linda
See if this helps any:http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1699966&SiteID=1|||Spiffy! Thanks!