Forum Replies Created

Viewing 15 posts - 7,216 through 7,230 (of 7,616 total)

  • RE: Can too many comments slow down stored procedure?

    EDIT: removed, posted in wrong thread.

  • RE: Stored Procedure help

    Code below has fewer calcs and does not depend on any SQL date settings.

    DECLARE @year int

    SET @year = 2012 --<<-- chg as needed

    SELECT

    month_start,

    ...

  • RE: Using Print, will it slow down procedure?

    Lynn Pettis (9/14/2012)


    /****** Object: UserDefinedFunction [dbo].[DelimitedSplit8K] Script Date: 09/14/2012 09:43:51 ******/

    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DelimitedSplit8K]') AND type in (N'FN', N'IF',...

  • RE: where clause not working for some values

    SELECT

    TimeFrame / 100, CAST(TimeFrame AS int) % 100

    FROM dbo.TimePeriod

    WHERE

    model= 'A1' AND

    TimeFrame / 100 = (

    ...

  • RE: Using Print, will it slow down procedure?

    Btw, yes, PRINT is exceedingly slow. Use it only when absolutely necessary.

  • RE: T-SQL Help Needed

    ChrisM@Work (9/14/2012)

    It's quite common for a product to "evolve" over time without its' stock code changing - it's rampant in the fashion world. Clients, agents, reps all know an item...

  • RE: What is Proper Steps to Remove FileGroups

    stanlyn (9/13/2012)


    Hi Scott,

    Running your script, it returns:

    Which begs the question on why the Page table has 3 PK_Page_Identity indexes, as it should have only one. That's the only thing...

  • RE: ALTER COLUMN fails when changing datatype of PRIMARY KEY

    Is the PK also a clustered index?

    Is the identity column used in any another index?

    Please post the DDL for the filtered index.

  • RE: linked database opinion?

    patrickmcginnis59 (9/13/2012)

    The approach of applications having their own databases is probably the norm

    Perhaps, perhaps not. But is that a good way to do it, regardless of how common it...

  • RE: What is Proper Steps to Remove FileGroups

    You can use this to check for files that still exist in a given filegroup(s):

    SELECT

    FILEGROUP_NAME(a.data_space_id) AS File_Group,

    OBJECT_NAME(p.object_id) AS Table_Name,

    ...

  • RE: Data Comparison

    SELECT

    Item,

    MAX(CASE WHEN [Group ID] = @group1 THEN Permission ELSE '' END) AS Group1_Permission,

    MAX(CASE WHEN [Group ID] =...

  • RE: T-SQL Help Needed

    Lynn Pettis (9/13/2012)


    ScottPletcher (9/13/2012)


    but if you are creating a table of product groups (<'BK','Books'>,<'SH','Shoes'>,<'BG','Bags'>) etc.. I would put an ID field on that and use that instead, otherwise if someone...

  • RE: T-SQL Help Needed

    but if you are creating a table of product groups (<'BK','Books'>,<'SH','Shoes'>,<'BG','Bags'>) etc.. I would put an ID field on that and use that instead, otherwise if someone decides they need...

  • RE: T-SQL Help Needed

    A company I worked for produces clothing catalogues. Each catalogue has a 2 character reference. They produce about 130 catalogues/adverts a year, but not all letters get used...

  • RE: T-SQL Help Needed

    Eugene Elutin (9/12/2012)


    Greg Snidow (9/12/2012)


    Jeff Moden (9/12/2012)


    Greg Snidow (9/11/2012)


    The 'id' column in every table was a bit annoying to work with.

    It's even more annoying when you need it and it's...

Viewing 15 posts - 7,216 through 7,230 (of 7,616 total)