Forum Replies Created

Viewing 15 posts - 4,411 through 4,425 (of 7,619 total)

  • RE: Database Design Follies: NULL vs. NOT NULL

    kenambrose (2/26/2016)


    there is another very negative consequence of allowing nulls. It is a different kind of performance problem, but a very real one in my experience. You may...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Crazy CASE statement causing major churn on WorkTable

    Btw, you really should strongly consider using ints to represent the StoreNumber and MerchantNumber -- the typical StoreNumberId and MerchantNumberId -- and looking up the 25-byte strings from a separate...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Crazy CASE statement causing major churn on WorkTable

    Do you (almost) always access this table by StoreNumber and MerchantNumber? If so, cluster the table on those columns -- using the code below -- and try again. ...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Query Help

    pietlinden (2/24/2016)


    I did mine differently. I checked for existence of both class types in the "attends" table...

    CREATE TABLE Student(

    StudentID INT IDENTITY PRIMARY KEY,

    FirstName VARCHAR(10) NOT NULL,

    LastName VARCHAR(15) NOT NULL

    );

    GO

    INSERT...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Data Model Design Assistance

    Are the blocks specific to one issue or "shared" across issues? For now, I'll assume that Block is a completely independent entity. [If it's not, we'll need to...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: table design

    hlsc1983 (2/24/2016)


    i meant to write like this: exam_year int,

    The reason why i am using exam_year is because the marksheet that the system must finally print reads something like this:...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: table design

    You need to use the actual semester number to record the grade. Year alone is not enough, nor is "odd/even" (bizarre!).

    It really seems like this is some type of...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Help executing a Stored Procedure

    I think this is the (actual) logic you need, based on analyzing the original code:

    SET ANSI_NULLS ON;

    SET QUOTED_IDENTIFIER ON;

    GO

    ALTER PROCEDURE [dbo].[usp_test_Arrears_BrokenArrangement]

    @PolicyId int,

    @AccountId int,

    @PolicyNodeId int,

    @output bit OUTPUT

    AS

    SET NOCOUNT...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Character string conversion to date type. char(8) to Date ( from char(8) (23022016) to date(dd/mm/yyyy) (23/02/2016)

    ChrisM@Work (2/23/2016)


    spaghettidba (2/23/2016)


    There is no built-in CONVERT style that will handle the format DDMMYYYY. This means that you will have to code it yourself. This should do:

    CONVERT(date, RIGHT(Date1,2) + SUBSTRING(Date1,...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Query Help

    SELECT

    r.ID, r.FULL_NAME, r.FULL_ADDRESS,r.MEMBER_TYPE, r.BIRTH_DATE,

    CONVERT (int,DATEDIFF(hour,r.BIRTH_DATE,GETDATE())/8766)as Age,r.MEETING_TYPE,r.MEETING,r.TITLE,

    r.Parent1_FullName,r.Parent1_Cell,r.Parent1_Email,

    r.Parent2_FullName,r.Parent2_Cell,r.Parent2_Email

    FROM (

    SELECT r2.ID

    FROM IMIS.dbo.vw_csys_registrations r2

    WHERE r2.MEETING_TYPE in ('PADA', 'TSM') AND r2.MEMBER_TYPE LIKE...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Stored procedure running much longer than its statements

    I think this will identity whether or not a row exist and will probably run much more quickly, since no massive join is involved, although a huge sort will be...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: table design

    hlsc1983 (2/23/2016)


    And one more thing. How terrible would it be if I used only one table with a many columns like I said earlier. ? Of course it won't...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: table design

    Below is a more fully sketched out design. Hopefully this is not a homework or project assignment :-D.

    CREATE TABLE dbo.subjects (

    subject_id int IDENTITY(1, 1)

    ...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Using Parameters in a Query is Killing Performance

    Worse, all this query tuning is likely effectively wasted anyway since the clus index is not being correct first. As soon as another column is added to this...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: NULLs to Not NULLs

    I think you should get check all NULLable columns for a given table in a single pass. It could hurt severely hurt performance to have to scan the same...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 15 posts - 4,411 through 4,425 (of 7,619 total)