Viewing 15 posts - 391 through 405 (of 422 total)
Try this. The issue seems to be that the DATEDIFF and DATEPART functions seem to return an INT value, which at a precision level of 7 gets overflowed. So I...
September 6, 2012 at 12:43 pm
Khades (9/4/2012)
Thank you once again. I appreciate your help.What does the dbo.Tally table hold? I notice we keep querying the N column.
A "Tally" table (sometimes called a "Numbers" table) is...
September 4, 2012 at 3:16 pm
dwain.c (9/2/2012)
SELECT *
FROM @NumberTable
ORDER BY RIGHT('000' +
REPLACE(
SUBSTRING(ItemNumber,...
September 4, 2012 at 12:06 pm
The procedure does several Inserts/Updates, some of which are executions of other stored procedures. If you can identify which table and column is causing the error then check the datatype...
September 3, 2012 at 1:06 pm
Khades (8/31/2012)
The character that was giving me problems is â (0xE2)
Here's a revised version of the function I posted above which in addition to checking for normal ASCII characters will...
August 31, 2012 at 6:39 pm
Keep in mind that just because a column has the Identity property that's no guarantee that values in the column will be unique or consecutive. Usually (but not always) Identity...
August 30, 2012 at 1:05 pm
I didn't write this code and can't remember where I got it so apologies to the original author. In my case I only cared about non-ASCII characters outside the range...
August 24, 2012 at 9:57 am
Try this:
CREATE FUNCTION dbo.svfRemoveLeftMostCharacters
(
@Source VARCHAR(1000)
,@Char CHAR(1)
)
RETURNS VARCHAR(1000)
AS
BEGIN
/* This function requires a Tally or Numbers table */
/* http://www.sqlservercentral.com/articles/T-SQL/62867/ */
DECLARE
@NewValue VARCHAR(1000)
,@Pos...
August 24, 2012 at 9:16 am
But to answer your question, sometimes XML PATH('') is left blank and other times you can specify a node value as in this example. Notice in the rendered XML how...
August 14, 2012 at 5:05 pm
Another way to create a delimited string from table data WITHOUT using XML. This can easily be turned into a function if so desired. If so, it's best used as...
August 14, 2012 at 4:39 pm
This should have no length limitations since the result is a string.
DECLARE
@s-2 VARCHAR(50)
,@Split CHAR(1)
,@X XML
,@strNewValue...
August 8, 2012 at 11:38 pm
Jeff Moden (8/8/2012)
You might need a bit more criteria because ISDATE isn't going to do it for you. Try this and see...
SELECT ISDATE('3519')
Good point, but I made a quick...
August 8, 2012 at 11:12 pm
I didn't write this function (though I made some minor mods), but picked it up somewhere along the way. It is a standard tool-box item I use on almost every...
August 8, 2012 at 6:35 pm
You can use this in a stored procedure or turn it into a table-valued function.
DECLARE
@s-2 VARCHAR(MAX)
,@Split CHAR(1)
,@X XML
SET...
August 8, 2012 at 6:04 pm
If you want some flexibility to change fiscal year date ranges the case statements are a bit tedious. I happened to need some fiscal year calculations just the other day...
August 7, 2012 at 1:01 am
Viewing 15 posts - 391 through 405 (of 422 total)