Viewing 15 posts - 166 through 180 (of 356 total)
Hi poratips,
Sorry, I don't have much experience in using Database Mail since I don't use this feature at work.
--Andrew
April 8, 2009 at 5:03 pm
Agree entirely with Jeff.
My previous post was wrong on a couple of points and wouldn't even have fixed up the OPs problem as a temporary workaround. I've corrected my post,...
April 8, 2009 at 4:16 pm
You can convert this string format into a datetime if you are happy to use the following dates for the 4 quarters:
Q1: YYYY-01-01
Q2: YYYY-04-01
Q3: YYYY-07-01
Q4: YYYY-10-01
DECLARE @dateString char(5)...
April 8, 2009 at 2:20 pm
Seems an odd requirement, but this is an alternative:
SELECT SUBSTRING(Field1, 8, 8 - PATINDEX('%[1-9]%', REVERSE(Field1)))
FROM (
SELECT '05380101010000' AS Field1 UNION ALL
SELECT '05380101020000' UNION...
April 8, 2009 at 1:02 pm
EDIT: Sorry this previous posting was wrong on a couple of aspects. I've fixed it up below.
The timestamp data type aka rowversion (which is a much better name for it),...
April 8, 2009 at 10:34 am
If you're looking to retrieve the filename from a path, then this seems to do the job:
SELECT FieldA, COALESCE(RIGHT(FieldA, NULLIF(CHARINDEX('\', REVERSE(FieldA)) - 1, -1)), FieldA, '') AS Filename
FROM (
...
April 8, 2009 at 8:08 am
+05:30 means 5 hours 30 minutes, not 5.30 hours
I blame the Babylonians 😉
April 8, 2009 at 7:05 am
1) You cannot use dynamic SQL from user-defined functions written in T-SQL.
2) You could potentialy avoid the above restriction if this were a stored procedure instead of a UDF, but...
April 8, 2009 at 6:02 am
kruti (4/8/2009)
thanks guys for helping me.
The problem in my code was, i was converting date with approx value in floating point terms. At last, we all come to...
April 8, 2009 at 5:38 am
Here's the test data taken from your attachment:
CREATE TABLE #FileData (
File_ref int,
tran_datetime datetime
)
INSERT #FileData (File_ref, tran_datetime)
SELECT 324329, '20090406 10:47:00' UNION ALL
SELECT 324329,...
April 7, 2009 at 12:00 pm
The T-SQL below queries your StoreRoleMapping table to generate the XML. You can specify the StoreRoleMappingID (?primary) column value of any row where the StoreRoleLevelID column value is 3 (Region),...
April 7, 2009 at 10:38 am
If I wanted to display all stores under District1 only using StoreRoleMappingID 5, then it should display stores under StoreRoleMappingID 9 and 10.
What XML do you want to be generated...
April 7, 2009 at 8:06 am
James,
Glad to be of assistance.
Thanks for your feedback.
--Andrew
April 7, 2009 at 6:57 am
I've changed your table to include ID and ParentID columns, which allow the parent-child relationship of the rows to be properly defined. Note that this amended table still has the...
April 6, 2009 at 6:38 pm
SELECT 'Region1' AS Description,'NULL' AS StoreID,'NULL' AS CompanyID,0 AS Level UNION ALL
SELECT 'District1','NULL','NULL','1' UNION ALL
SELECT '111/12345','111','12345','2' UNION ALL
SELECT '222/12345','222','12345','2' UNION ALL
SELECT 'District2','NULL','NULL','1' UNION ALL
SELECT '333/3456','333','3456','2'
There's no way of determining...
April 6, 2009 at 5:32 pm
Viewing 15 posts - 166 through 180 (of 356 total)