Forum Replies Created

Viewing 15 posts - 811 through 825 (of 7,619 total)

  • Reply To: Reclaim space after setting varbinary(max) column to NULL

    That should reclaim space from that table back to the database itself.

    I think you'll still need to run SHRINKFILE to free the space the database itself back to the disk.

    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: Are the data types I've chosen the best choices?

    Does the system need to prevent duplicate responses to a Ticket?  That would be complex to do at the very least.

    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: Are the data types I've chosen the best choices?

    frederico_fonseca wrote:

    ScottPletcher wrote:

    Jeff Moden wrote:

    ScottPletcher wrote:

    Remember, too, that the logical data model should be easily understood and use by business people.  In fact, if possible, keep all developers out of the...

    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: explicite alternative to FORMAT() concerning DATE

    You could just use the 1st for the day, which would mean it was still a valid date:

    CONVERT(varchar(10), DATEADD(MONTH, DATEDIFF(MONTH, 0, Tab.date), 0), 120)

    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: Are the data types I've chosen the best choices?

    Jeff Moden wrote:

    ScottPletcher wrote:

    Phil Parkin wrote:

    This link gives a few reasons for choosing shorter varchar lengths.

    In terms of storage, CHAR(n) columns are always n characters long.

    VARCHAR(n) columns are anything between 2...

    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: Are the data types I've chosen the best choices?

    Jeff Moden wrote:

    ScottPletcher wrote:

    Remember, too, that the logical data model should be easily understood and use by business people.  In fact, if possible, keep all developers out of the first one...

    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: Are the data types I've chosen the best choices?

    Jeff Moden wrote:

    Mr_X wrote:

    Thank you for your reply.

    Jeff Moden wrote:

    I took a look at your spreadsheet and immediately found a pretty nasty issue... about 2/3rds of the rows have duplicated Ticket Numbers.

    Scott...

    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: Are the data types I've chosen the best choices?

    frederico_fonseca wrote:

    Ticket response - can you have more than one response per ticket?

    If Yes then its PK should be TicketResponseID and the Ticket Number should be a FK to Ticket

    No,...

    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 can I generate a key for this column which is part of a database model?

    You can.  That's the two choices for a code column: use a view to encode/decode and/or use a separate lookup table.  A lookup table is technically a better design, but...

    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: Are the data types I've chosen the best choices?

    Jeff Moden wrote:

    1. There is no way that I'd ever create column names with spaces in them.  It relegates you to always have to use brackets around every column name that...

    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 confirm if the replication is using Push/Pull subscription?

    In the distribution db, query view dbo.syssubscriptions

    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 can I generate a key for this column which is part of a database model?

    Mr_X wrote:

    Hi Scott. Thanks for your reply. I understood most of what you said. I'd kindly like to ask for some clarification on some parts. But here is what 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: Tables with constant data

    In general I agree, although in a truly normalized design the number of tables can get truly overwhelming (like SAP!).

    Certain simple things do not need tables.  Instead, you can use...

    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 can I generate a key for this column which is part of a database model?

    There are two main approaches:

    (1) use a generic number for all codes, typically generated automatically by an identity column

    So, type code = 1 might be 'Issue', = 2 might 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".

  • Reply To: Tables with constant data

    Be careful!  The problems with a generic lookup table, structured like this:

    ( table_id smallint NOT NULL, data_code varchar(50) NOT NULL, description varchar(1000) NULL )

    are:

    (1) the data_code (key) must be made...

    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 - 811 through 825 (of 7,619 total)