Forum Replies Created

Viewing 15 posts - 5,461 through 5,475 (of 7,613 total)

  • RE: How to ignore "String or binary data would be truncated"

    halifaxdal (1/16/2015)


    Lowell (1/16/2015)


    halifaxdal (1/16/2015)


    no way i know of to ignore errors, you have to explicitly use LEFT functions in the SELECT or something to work around this issue.

    based on your...

    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: Constraint syntax

    ALTER TABLE dbo.person_test2

    ADD CONSTRAINT CK_ext

    CHECK ( Pext LIKE REPLICATE('[0-9]', LEN(Pext)) )

    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: user permission issue

    You really shouldn't need full securityadmin just to grant EXECUTE on a proc(s):

    GRANT EXECUTE TO user1 WITH GRANT OPTION

    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: Junction tables - unique rows across 2 columns

    FILLFACTOR directs SQL on how full to make each page of data. 96% leaves 4% -- roughly 300 bytes -- free on each page to allow for new rows...

    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: Should I leave show advanced options to 1 or 0

    Technically it should be left at 0, as that's more secure.

    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: Correct Usage of Try-Catch

    The ROLLBACK could indeed cause an error if a transaction wasn't active at the time. Here's how to correct that:

    IF XACT_STATE() <> 0

    BEGIN

    ROLLBACK;

    END;

    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: Junction tables - unique rows across 2 columns

    You can use a PK or simply a UNIQUE constraint or index. For example:

    CREATE UNIQUE CLUSTERED INDEX Student_Classes__CL

    ON dbo.Student_Classes ( Student_ID, Class_ID ) 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".

  • RE: Backups have more than doubled in size

    T_Peters (1/14/2015)


    No, I didn't turn off compression or make any other changes to the maintenance jobs. Is there any way to query a backup file to see if it used...

    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: Select data from another database without reference

    Or even another view. A view could also explicitly reference objects in a different db.

    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: Backups have more than doubled in size

    Were the backups using compression before and are did not use compression last time for some odd reason?

    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: Cache question - sys.dm_exec_procedure_stats

    The complexity of the plan is also a factor in how much SQL weights keeping a plan in cache (by assigning more complex plans higher initial values).

    Also, I believe ad-hoc...

    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: Is there a better way to write this query.

    curious_sqldba (1/13/2015)


    ScottPletcher (1/13/2015)


    You don't need to re-count the rows every time.

    DECLARE @BatchSize int

    DECLARE @RowRount int

    DECLARE @TableRowCount int

    DECLARE @TableRowLimit int

    SET @BatchSize = 10000

    SELECT @TableRowCount = COUNT(*)

    FROM PtActs WITH (NOLOCK)

    SET @TableRowLimit...

    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: Database design question

    RHJ (1/13/2015)


    I have a working version of this that is limping along by using a UniqueSession table as a bridge between Locations and Sessions. My boss is unhappy 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".

  • RE: Database design question

    Technically you should still be dealing with a logical not a physical design, i.e. "entities" rather than "tables". but let's jump ahead to tables anyway, I guess.

    You're missing at 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".

  • RE: New column in Existing table and uploading data

    I'd try instead to just:

    (1) just in case, as a backup, copy existing key column(s) and data column to be changed to a keyed backup table

    (2) verify that existing data...

    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 - 5,461 through 5,475 (of 7,613 total)