Forum Replies Created

Viewing 15 posts - 6,421 through 6,435 (of 7,613 total)

  • RE: Is there a way to improve this SELECT statement for performance?

    Sean Lange (8/30/2013)

    NOLOCK hints. They are NOT a performance boost.

    To me, that's not a logical claim. While NOLOCK is clearly dangerous, it DOES in fact reduce overhead by avoiding...

    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: how to alter the existing id values to idetity(1,1)

    kapil_kk (8/30/2013)


    ScottPletcher (8/29/2013)


    ALTER TABLE dbo.tblemployee

    ADD ident int IDENTITY(1, 1) NOT NULL

    Edit: Added "NOT NULL"

    You are adding a new column with IDENTITY property and it works..

    The thing is that we cant...

    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: Float WTF?!

    Float only takes 4 bytes to store if you specify a precision of 24 or less.

    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: Float WTF?!

    WHY IS THE LEN OF THE FLOAT 4?!

    It takes 4 bytes to store a float value (up to 24 digits).

    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: sp_getrecords to get all records from a table

    DOH, just realized, the proc should check for an explicitly specified schema name and parse out the names before adding brackets:

    alter PROC [dbo].[sp_getrecords]

    (

    @TableName sysname

    )

    AS

    declare @SchemaName sysname

    set...

    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: sp_getrecords to get all records from a table

    Sean Lange (8/29/2013)


    ScottPletcher (8/29/2013)


    Here's an idea: let the proc get the schema name for you :-), then you don't even have to type it in at all!

    create PROC [dbo].[sp_getrecords]

    (...

    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: Create a stored procedure on multiple databases

    I was thinking of creating a script file and calling that from a stored procedure on every database?

    Yes, that should work, although it's a lot of extra work and...

    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: Microsoft SQL 2008 R2 Backup and Restore

    Jay Purvis (8/29/2013)


    No, it was a development server, but it is still a pain to not be able to restore system databases.

    Especially when the builds were released only a month...

    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: Commit

    if my statement that I started with begin Tran errors out, will that transaction stay open till I do rollback or commit?

    Yes. Once a transaction begins, it must either...

    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: How to reordering or removing one identity number

    Is it possible?

    No.

    You can't make an IDENTITY skip a specific value(s).

    If you start at -1 and increment by 1, there is always the possibility you will get a 0 in...

    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: sp_getrecords to get all records from a table

    Here's an idea: let the proc get the schema name for you :-), then you don't even have to type it in at all!

    create PROC [dbo].[sp_getrecords]

    (

    @TableName sysname

    )

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

  • RE: Curious thought on how to approach making a query like this "better'

    Row selection is controlled by "only" 4 tables:

    FROM

    ...

    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: how to alter the existing id values to idetity(1,1)

    ALTER TABLE dbo.tblemployee

    ADD ident int IDENTITY(1, 1) NOT NULL

    Edit: Added "NOT NULL"

    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: Replication without primary keys

    Isabelle2378 (8/27/2013)


    Yes, that is correct Scott. The tables have unique clustered indexes that was all added when the ERP system was installed to maintain its referential integrity. 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".

  • RE: Replication without primary keys

    Sean Lange (8/27/2013)


    Isabelle2378 (8/27/2013)


    Hi,

    My tables do not have primary keys and as I understand it, transactional replication requires primary keys so my question is: Has anybody found a 3rd...

    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 - 6,421 through 6,435 (of 7,613 total)