Viewing 15 posts - 46 through 60 (of 109 total)
I eneded up approaching it from a different angle and used temporary tables in stead
March 28, 2011 at 2:01 am
thanks, that does work. I do have another question related to the same problem though.
Im using an IF ELSE statement, how do i get it to work with a...
March 25, 2011 at 9:33 am
The function actually works if i run the query, but its highlighted in red in the query window of management studio
'cannot find either column 'dbo' or the user defined function...
March 3, 2011 at 9:51 am
and (GetDate() <= (DATEADD( month,CONVERT(INT,Lookup.SubRef),Data_Landline.ModifiedDate)))
i was trying to use this
and (GetDate() <= (DATEADD( month,CONVERT(INT,dbo.UDF_ParseNumChars(Lookup.SubRef)),Data_Landline.ModifiedDate)))
the subref column may contain some text instead of a number, so the calculation wont...
February 28, 2011 at 6:09 am
heres the code
ALTER FUNCTION [dbo].[UDF_ParseNumChars]
(
@string VARCHAR(8000)
)
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @IncorrectCharLoc SMALLINT
SET @IncorrectCharLoc = PATINDEX('%[^0-9]%', @string)
WHILE @IncorrectCharLoc > 0
BEGIN
SET @string = STUFF(@string, @IncorrectCharLoc, 1, '')
SET @IncorrectCharLoc = PATINDEX('%[^0-9]%', @string)
END
IF LEN(@string) = 0
SET @string...
February 28, 2011 at 2:25 am
if you read my post again, youll see that it was prefixed with dbo.
February 26, 2011 at 5:39 am
thanks, that sorted it
February 15, 2011 at 5:51 am
I dont reference the column anywhere in my insert statement, im expecting the database to insert the current date, but it doesnt
September 20, 2010 at 4:03 am
finally managed to solve this, heres the answer
BEGIN TRY
EXEC sp_xml_preparedocument @idoc OUTPUT, @_xml
BEGIN TRANSACTION
UPDATE AdapterTransaction
SET StatusID = @UpdateStatus
FROM OPENXML(@idoc,'/Root/id')
WITH (id bigint '.') xmlTable
WHERE AdapterTransaction.TransactionID = xmlTable.id
EXEC sp_xml_removedocument @idoc
COMMIT
END TRY
September 10, 2010 at 6:13 am
Input XML
<Root>
<id>3756</id>
<id>3757</id>
<id>3758</id>
<id>3759</id>
<id>3760</id>
<id>3761</id>
</Root>
Input Status value = 1
the table has a primary key column 'TransactionID' and a statusID column of...
September 10, 2010 at 5:11 am
Ive followed the suggestion from microsoft (http://support.microsoft.com/kb/315968/en-gb)
but it just will not change any data. Can anyone help ?
BEGIN TRY
EXEC sp_xml_preparedocument @idoc OUTPUT, @_xml
BEGIN TRANSACTION
UPDATE AdapterTransaction
SET StatusID...
September 10, 2010 at 4:27 am
Ive taken another look at the sql and modified it slightly to this
EXEC sp_xml_preparedocument @idoc OUTPUT, @_xml
BEGIN TRANSACTION
UPDATE Table1
SET StatusID = @UpdateStatus
WHERE Table1.ID IN
(SELECT ox.id FROM OPENXML(@idoc,'/Root/id')
WITH (id bigint)...
September 10, 2010 at 2:37 am
Viewing 15 posts - 46 through 60 (of 109 total)