Forum Replies Created

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

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

  • RE: Difference of two consecutive datetime rows

    You might need to use ROW_NUMBER() instead, if there is any chance of a gap/missing number in the EntryID column (note that by definition identity columns can have gaps 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: index dmv stats

    Hmm, no point in maintaining indexes for 11 months in which they are not being used.

    But 30 days? That's a different q. Typically it depends on the size...

    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: Delete Vs Truncate difference on rollback

    In Oracle, a TRUNCATE indeed cannot be rolled back. [Oracle uses a fundamentally different way of handling table allocations that would make it essentially impossible for Oracle to rollback...

    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: will not using the statement terminator ';' break code in future?

    GilaMonster (8/27/2013)


    davidandrews13 (8/27/2013)


    good advice. i'll certainly get in the habit and also update Procedures as-and-when i get to them so that, come day zero, it wont be such a big...

    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: LTRIM,RTRIM

    mahavidhya24 (8/26/2013)


    L TRIM removes all the white space from the starting of the pattern and R TRIM removes all the white space at the end of the pattern.:-)

    Sorry, but that's...

    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: String to date conversion issue

    You have to separate the data format the user enters vs. what's stored in the db. It's OK in your app to have the user enter "mon. dd, yyyy"...

    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: Logic to break period of time by month

    mario17 (8/23/2013)


    Thanks, Scott

    Your code works fine, and much easy to digest ( or learn if you will), amazing.. and thanks again to you and Dwain for sharing this, sure you...

    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: Omit Data Length for Numeric Values

    Good points about the Unicode and datetimeoffset (I've never personally used that data type):

    -- list column data type, including len(s), if applicable

    ...

    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: Logic to break period of time by month

    You should use your own tally table, either a permanent one or a dynamically generated one. Since the permanent one would be clustered on the tally value, it might...

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