Viewing 15 posts - 1 through 15 (of 46 total)
Here it is. I am not sure how the formatting will hold up.
IF OBJECT_ID('sp_run_xml_proc','P') IS NOT NULL
DROP PROC sp_run_xml_proc
GO
CREATE PROC sp_run_xml_proc
@sql varchar(8000) -- Proc to run
AS
DECLARE @dbname sysname,
@sqlobject...
June 6, 2003 at 10:23 am
SELECT CONVERT(VARCHAR(10),a.DBR_DATE,101)
FROM MDRECHDR
June 5, 2003 at 3:50 pm
Here is one easy way. alter the table adding a identity column update the original column setting it to the new identity column then drop the new identity column.
June 5, 2003 at 3:06 pm
I have a modified version of a Ken Henderson proc that will take a sql statement with for xml auto and put the results into a text field in a...
June 5, 2003 at 2:05 pm
It would be easy if it were xml, but I am guessing it isn't. What format is it in?
June 5, 2003 at 2:00 pm
You can try this. You will obviosuly need to uncomment the exec at the end for it to do anything.
CREATE proc search_tables @table sysname = 'ALL',
@string varchar(8000)
as
declare@sql varchar(8000),
@separator...
June 5, 2003 at 1:56 pm
You are not giving your decimal datatype any precision or scale. Try declaring like this
Declare @percent decimal(4,2)
June 5, 2003 at 8:09 am
No it won't, 5/15/2003 is not between 9/15/2001 and 10/15/2002.
June 4, 2003 at 9:51 pm
It is definitely that horrific IN clause. Pass that string into a proc as xml and join to it using openxml. Or somehow get it into a temp table.
June 4, 2003 at 8:30 am
What do you have @percent declared as?
June 4, 2003 at 7:47 am
I declared the variables, commented out the @gc and @oc stuff and it worked fine for me. I got a @percent of .04
June 3, 2003 at 10:21 pm
PC, you are missing out on a lot since dynamic sql used correctly can yield very good results. Although I did not use it in my example, properly parameterized dynamic...
June 3, 2003 at 9:50 pm
Another quick note about my previous post. The business rule my script follows is that trips after the first duplicate must be within seven days of the first duplicate to...
June 3, 2003 at 12:47 pm
Here is another stab at it. I am assuming you will not have a customer with two trips ending on the same day. If so you need some sort of...
June 3, 2003 at 12:16 pm
I have the exec commented out in my example. It produces a query that has an accurate where clause without all the other extraneous stuff. All you have to do...
June 3, 2003 at 11:39 am
Viewing 15 posts - 1 through 15 (of 46 total)