Viewing 15 posts - 106 through 120 (of 347 total)
Got it!
ALTER TABLE Table1 ADD CONSTRAINT DF_UID DEFAULT (NEWID()) FOR PUID;
Thanks for the pointers.
August 25, 2016 at 10:12 am
I need to insert new rows into a table with fake UIDs . I was thinking of using this string to generate UID . How else can I auto generate...
August 25, 2016 at 10:00 am
The field where I am trying to insert is a UNIQUEIDENTIFIER and I am receiving the following error :
Conversion failed when converting from a character string to uniqueidentifier
August 25, 2016 at 9:49 am
Ok, I will try that. Do I still need to grant SQLAgentUSerRole to her login for msdb database ?
Thanks,
PSB
August 15, 2016 at 6:06 am
Sample data :
CREATE TABLE #Table1
(
ID1 UNIQUEIDENTIFIER,
ID2 UNIQUEIDENTIFIER,
TimeOfDay DATETIME,
Cumulative DECIMAL (38,6)
)
INSERT INTO #Table1 (ID1,ID2,TimeOfDay,Cumulative )
SELECT '14F10A98-0CBE-E511-A5EF-B00594F948C7','4E0B8F0C-0CBE-E511-A5EF-B00594F948C7','2016-05-06...
August 8, 2016 at 6:28 am
Subquery value should be based on Id2 value from #Table1 or Id1 from #Table2
IF from #Table1 , getdate() between startdate and enddate , then use (Cumulative) value where TimeOfDay =...
August 8, 2016 at 5:55 am
Getting a "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as...
August 8, 2016 at 5:42 am
Desired result:
SELECT 'AD556826-4444-E611-8426-80000B9AEB87','2016-08-03' AS TaskStartDate,76.400000 AS Cumulative_Original
SELECT '17E1C3C6-7E39-E611-8860-80000B9B5293','2016-09-13' AS TaskStartDate,0.000000 AS Cumulative_Original
SELECT '4E0B8F0C-0CBE-E511-A5EF-B00594F948C7','2016-05-03' AS TaskStartDate,44.329000 AS Cumulative_Original
Thanks,
PSB
August 7, 2016 at 3:57 pm
Can anyone help me with the last condition ?
IF from #Table1 , getdate() between startdate and enddate , then use (Cumulative) value where TimeOfDay = Getdate()
August 5, 2016 at 11:45 am
It should pick 30.400000 for TimeOfDay 2016-08-05 00:00:00.000 .
August 5, 2016 at 10:56 am
Need help when getdate() between startdate and enddate , then the query should use (Cumulative) value where TimeOfDay = Getdate()
Thanks,
PSB
August 5, 2016 at 10:48 am
I am using DATEADD(HOUR,-5,Runtime) and am getting 1900-01-01 07:00:01.000
July 19, 2016 at 6:33 am
Viewing 15 posts - 106 through 120 (of 347 total)