Forum Replies Created

Viewing 15 posts - 436 through 450 (of 7,613 total)

  • Reply To: Are the posted questions getting worse?

    Dennis Jensen wrote:

    Sure COBOL had about a 12 year head start on C (1959ish versus 1972ish) but I would find it hard to be convinced that anything written in the 1973...

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

  • Reply To: Need help with a Query logic

    For a specific day, then:

    Select
    Name
    ,Login_Email_Address
    ,CAST(Date AS date) AS Date
    from User_acticvity
    Group By Name, Login_Email_Address, CAST(Date AS date) AS Date
    Having Sum(Case When action = 'Login' Then 1 Else 0...

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

  • Reply To: Database Design Help

    I suggest you consider "ingredients" as an entity rather than separate "items" and "fluids". ingredient would be a super-type, with sub-types of either item or fluid, while allowing for other...

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

  • Reply To: Calculate a sum based on time periods in CASE statement

    Since you didn't put aliases on the column names, I (we) have NO idea which table each column comes from; therefore, I had to use xx. as a dummy/generic alias.

    I...

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

  • Reply To: Update in an Insert Trigger

    Cool, I can help more/fully with SQL Server:

    SET ANSI_NULLS ON;
    SET QUOTED_IDENTIFIER ON;
    GO
    CREATE TRIGGER dbo.trigger_name
    ON dbo.table_name
    AFTER INSERT
    AS
    UPDATE tn
    SET col1=GETDATE(), col2=0, col3='' /*, ...*/
    FROM dbo.table_name tn
    INNER JOIN inserted i...

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

  • Reply To: Update in an Insert Trigger

    Which dbms are you using?  SQL Server? Access? Oracle?

    This is a SQL Server forum.  Someone here might be able to help you with another dbms, but less so than with...

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

  • Reply To: Creating multiple identical indexes

    That's very odd.  Could you provide the CREATE INDEX command you are using (naturally change names as needed to protect your actual object/column names).

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

  • Reply To: Update in an Insert Trigger

    Normally you'd just specify a default value rather than having to use a trigger for that.

    For example, say you have table "tableA" that you want to add a default value...

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

  • Reply To: How to return '0' for no rows (no information) in the table

    You can adjust the SUM(s).  I wasn't sure if you wanted to list only the net or all three; if you want only the net, remove the first two "OH"...

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

  • Reply To: How to Improve Database Design to Speed Up SQL Queries

    I admit that for Medicare patients, as specified by the author, SSN might be valid to use (to be eligible, a person would need an SSN (or perhaps a TIN)). ...

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

  • Reply To: Log File continue growing

    More specifically, if you need to fully shrink a log, do something like this:

    --assume you want log to be 3GB after shrink
    USE database_name;
    DBCC SHRINKFILE(2);

    --explicitly increase the log...

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

  • Reply To: Log File continue growing

    Jeffrey Williams wrote:

    ScottPletcher wrote:

    Jeffrey Williams wrote:

    datkop wrote:

    @deubel_m log file is still growing after every shrink... so it doesnt work

    Change the size to a fixed MB - then shrink the file to as...

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

  • Reply To: Log File continue growing

    Jeffrey Williams wrote:

    datkop wrote:

    @deubel_m log file is still growing after every shrink... so it doesnt work

    Change the size to a fixed MB - then shrink the file to as small as...

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

  • Reply To: Index help - Performance issue

    SQL can usually imbed the conditions into the query plan to access the table rather than scanning the entire table first.  Of course you'd have to look at the query...

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

  • Reply To: Log File continue growing

    This does look like something maybe outside of SQL Server?!

    Although, in order to truncate the log, a checkpoint must be taken after backup.  So step 4b. should be a CHECKPOINT,...

    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 - 436 through 450 (of 7,613 total)