Rats! Sometimes it's SO SIMPLE!
I've written your sample about 5 times.
Every time I wrote it, it failed!
BUT, I did not use a BIGINT
Changed my code from int to bigint.
Shazam!
Worked first time!
So close, yet so far!
Thanks MrDenny!
Faced a similar problem ... what we did was write a transformation script to convert "bad-dates" into nulls. Here's that script. Hope it helps.
Function Main()
D_Date = DTSSource("Col009")
If Trim(D_Date) <> "" And Trim(Left(D_Date, 10)) <> "" And Not Isnull(D_Date) Then...
This is only a guess, but, what type of DSN are you creating? User, System, File ... and is the DSN actually resident on the same physical box running the SQL Server?
Quick answer ... write not allowed in UDFs
Quote from BOL ...
"You may have included a statement in the BEGIN-END block that has side effects, which is not allowed in user-defined functions. Function side effects are any permanent changes to the state of a resource that has a scope outside the...
Quote from BOL ...
"If the statement fires one or more triggers that perform inserts that generate identity values, calling @@IDENTITY immediately after the statement returns the last identity value generated by the triggers."
I believe
... UPDATE orders SET fy ...
causes @@IDENTITY to reset...
Sorry, I do not believe EXECute can be used to return a value. There are limits to what dynamically compiled SQL queries can do.
The only solution I might suggest is a UDF (User Defined Function) Start by taking the inner action and make a UDF function like this...
Indexes in general can be imagined as a very tall stack of hierarcial GREATER-THAN LESS-THAN branches. To find a particular node, you start at the top and do a GREATER/LESS plunge down the tree.
What happens if the tree is originally build in perfect alphabetical order. Then every node has a...
I suddenly remember how hard this problem was to solve. (smile)
So, I'm also sending the related schema. Note: I've turned off most of the referential integrity but left stubs. Run the script, then using Enterprise Manager, create a new diagram and drop all these table into the new diagram...
I should also mention, our MenuItems table has two URL columns. If a user gets View-Only access, we use the PageURLView for the hyperlink. Else we use the PageURLEdit.
We use the above technique ... a LOT. Works great.
======================
As examples, here's a function we built to convert a Comma Separated Value list of integers into a table. We use this silly little function in about 30 stored procs.
======================
ALTER FUNCTION...
This is a difficult task. Hierarcial structures of 'N' depth are not SQL server's strong point. We use a single table to store 100's of menu items. Each User can be a member of one or more groups. Each group has a different set of menu items allowed. Thus, to get a User's dynamic hierarcial menu...
Need advice on the "best-approach" to accomplish this ...
I'm using TEXT var types in a MS SQL 8.0 database. My TEXT fields can contain (literally) up to 2 gb each. I need to find every instance of "Hello World" appearing anyplace in the 2gb text field.
Finding which particular records, happen...
Are our users more-or-less stupid than average users?
We've been told our web application must give INSTANT visual feedback to the user when the user should STOP and wait for a refresh, postback, navigation to finish ....
Bottom line ... we need to execute Client-Side JavaScript at TWO exact...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.