Forum Replies Created

Viewing 15 posts - 196 through 210 (of 395 total)

  • RE: Default Constraint Not Reflected on Table

    But you couldn't apply a NOT NULL constraint to a column containing nulls, could you?

  • RE: Default Constraint Not Reflected on Table

    It looks OK to me:

    You couldn't get NULL in Gen_DATE when it's defined as NOT NULL.

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    IF OBJECT_ID('dbo.tblGen') IS NOT NULL

    DROP TABLE dbo.tblGen;

    CREATE TABLE [dbo].[tblGen](

    [PROCESS_ID] [bigint] NOT...

  • RE: Default Constraint Not Reflected on Table

    I can't see ImportDate there?

  • RE: Search levels

    --======== TEST DATA ==========

    IF OBJECT_ID('dbo.ParentRegionList') IS NOT NULL

    DROP TABLE dbo.ParentRegionList;

    CREATE TABLE [ParentRegionList](

    [RegionID] [int] NOT NULL,

    [RegionType] [nvarchar](50) NULL,

    [RegionName] [nvarchar](255) NULL,

    [ParentRegionID] [int] NULL

    )

    INSERT INTO [ParentRegionList] ([RegionID],[RegionType],[RegionName],[ParentRegionID]) VALUES (1,'Continent','Europe',0)

    INSERT INTO [ParentRegionList] ([RegionID],[RegionType],[RegionName],[ParentRegionID]) VALUES...

  • RE: Date Comparison Error

    Cannot see any problem with this. Can you look at supplied code & explain how yours differs.

    Thanks

    --Today I face a problem in Date Comparison please help me in out...

  • RE: Default Constraint Not Reflected on Table

    Can you post the definition of the table? This will make it clear.

    Select the table, 'Script table as' > 'Create to' > 'new query editor window' & post the...

  • RE: find increase/decrease amount

    What are the rules for calculating increase & decrease?

    It's not obvious from the expected results.

  • RE: GROUP BY conundrum

    Is this right?

    declare @jobs as table (product_id int, job_date date, holiday int, qty_delivered int);

    insert @jobs values (1, '01 Sep 2012', 1, 25);

    insert @jobs values (1, '01 Sep 2012', 1, 25);

    insert...

  • RE: GROUP BY conundrum

    It's [j.holiday].....

    Right -

  • RE: GROUP BY conundrum

    I'm getting an error trying to run the query.

    Are you sure it's right?

    declare @jobs as table (product_id int, job_date date, holiday int, qty_delivered int);

    insert @jobs values (1, '01 Sep 2012',...

  • RE: The dreaded 8000 character limit strikes again

    PiMané (9/28/2012)


    laurie-789651 (9/28/2012)


    This column starts off as Nvarchar(Max) & the data is concatenated in - so that's why it works.:-)

    Yep... like laurie says somewhere in your query the data isn't...

  • RE: Trying to use Case Statement to get value into a GL Account with periods in the format

    How about this then:

    If GL Code is 19, the max possible length of the data will be 22 (7+8+5 + 2 full stops)!

    --BU is varchar(7)

    --SUBSIDIARY is varchar(8)

    --OBJECT is varchar(5)

    --GL Acct...

  • RE: The dreaded 8000 character limit strikes again

    PiMané (9/28/2012)


    Hi,

    Doing this

    DECLARE @str NVARCHAR (MAX);

    ;WITH CTE_Count AS

    (

    select counter = 1

    union all

    select counter = counter+1

    ...

  • RE: KEY LOOKUP

    Including 20 columns out of 40 might be a bit of an overhead.

    If you create a covering index, the order of the included columns doesn't matter as long as the...

  • RE: The dreaded 8000 character limit strikes again

    Its something like:

    Varchar(max) can hold 2 GB, but the string(s) you load it with can only hold 8000 bytes, so you have to concatenate them to get the (max) size...

    Even...

Viewing 15 posts - 196 through 210 (of 395 total)