Forum Replies Created

Viewing 15 posts - 106 through 120 (of 347 total)

  • RE: Create Unique identifier from text

    Got it!

    ALTER TABLE Table1 ADD CONSTRAINT DF_UID DEFAULT (NEWID()) FOR PUID;

    Thanks for the pointers.

  • RE: Create Unique identifier from text

    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...

  • RE: Create Unique identifier from text

    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

  • RE: SQL 2012 Grant execute rights to user on specific SQL Agent Job

    Ok, I will try that. Do I still need to grant SQLAgentUSerRole to her login for msdb database ?

    Thanks,

    PSB

  • RE: CASE statement

    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...

  • RE: CASE statement

    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 =...

  • RE: CASE statement

    Getting a "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as...

  • RE: CASE statement

    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

  • RE: CASE statement

    I have used cast as date in both

  • RE: CASE statement

    Can anyone help me with the last condition ?

    IF from #Table1 , getdate() between startdate and enddate , then use (Cumulative) value where TimeOfDay = Getdate()

  • RE: CASE statement

    It should pick 30.400000 for TimeOfDay 2016-08-05 00:00:00.000 .

  • RE: CASE statement

    Need help when getdate() between startdate and enddate , then the query should use (Cumulative) value where TimeOfDay = Getdate()

    Thanks,

    PSB

  • RE: Comma separated

    Thank You. It worked perfectly.

  • RE: -5 Hours from HH:MM:SS

    Thank You.

  • RE: -5 Hours from HH:MM:SS

    I am using DATEADD(HOUR,-5,Runtime) and am getting 1900-01-01 07:00:01.000

Viewing 15 posts - 106 through 120 (of 347 total)