Forum Replies Created

Viewing 15 posts - 13,936 through 13,950 (of 15,381 total)

  • RE: insert DateTime issue

    Using your create statement and your insert it works just fine.

    CREATE TABLE #census_date(

    [id_col] [int] IDENTITY(1,1) NOT NULL,

    [start_dtime] [datetime] NOT NULL,

    [end_dtime] [datetime] NOT NULL

    )

    INSERT INTO #census_date

    ([start_dtime]

    ,[end_dtime])

    VALUES

    ('2013-01-01 00:00:00', '2013-01-31 00:00:00')

    select * from...

  • RE: insert DateTime issue

    You most likely have your ydm order incorrect for your current settings.

    the following is the culprit.

    select cast('2013-01-31 00:00:00' as datetime)

    Now try this:

    set dateformat mdy

    select cast('2013-01-31 00:00:00' as datetime)

    You could...

  • RE: Query question

    The tally table is nothing more than a table with a single column of integers incrementally. The article has an easy way to create it. However, the article is a...

  • RE: Query question

    That sounds like really strange requirement but you can use a tally table pretty easily like this.

    select *

    from test

    join Tally on Tally.N < = test.capacity

    Refer to the article...

  • RE: Person-PersonAddressRelation-Address Is this practical ??

    SwayneBell (9/26/2011)


    L' Eomot Inversé (9/24/2011)


    Burninator (9/23/2011)


    Sorry Evil K – addresses can belong to many users/persons.

    What gave you the impression that Craig thought addresses belonged to only one person? I...

  • RE: Need verification on this matter

    InfiniteError (9/26/2011)


    hey guys, need help on this one. I have a .net application, On sql side,Is it much faster to execute sp rather that inline statement? meaning from .net i...

  • RE: Rebuild index -Timeout error

    Here is a thread on this site on the very topic.

    http://www.sqlservercentral.com/Forums/Topic305986-92-1.aspx

  • RE: Declaring dynamic select query using Cursor

    This is really not too difficult but you need to help me help you. I can do the sql for a set based version pretty quickly but at best it...

  • RE: Temp tables and table variables scope and persistence.

    Elliott Whitlow (9/23/2011)


    Sean,

    I think you have part of that wrong, table variable scrope from BOL is "A table variable behaves like a local variable. It has a well-defined scope. This...

  • RE: Temp tables and table variables scope and persistence.

    duanecwilson (9/23/2011)


    I have a large stored procedure that populates about 6 tables. It creates, populates, and uses many variables, table variables, and temp tables to accomplish this. I need to...

  • RE: Person-PersonAddressRelation-Address Is this practical ??

    vishal.gamji (9/23/2011)


    So, with my proposal of just a Person (PersonId) - Address (PK: AddressId, FK: PersonId), does anyone see any cons with this approach ? Other than the visual redundancy.

    Nope....

  • RE: Person-PersonAddressRelation-Address Is this practical ??

    In light of Tom's response I think he is correct this is not necessarily over normalized but I think we all agree this is not a good data model.

    --edit typos...

  • RE: Person-PersonAddressRelation-Address Is this practical ??

    Well then if they are (foolishly imho) dead set on keeping it over normalized then you have to keep the PersonAddressTypeHowManyJoinsToKeepOutOneOrTwoRedundantPiecesOfDataDoesItTake type of structure. Do they do the same thing...

  • RE: Person-PersonAddressRelation-Address Is this practical ??

    I personally like the approach a Person table and an Address table. The Address table would contain the foreign key to Person and an AddressType field to let you know...

  • RE: Delete duplicate records

    MyDoggieJessie (9/23/2011)


    Sorry Sean, you had posted your reply while I was typing in mine, didn't mean to duplicate the effort! 😉

    No problem. Your code accomplished the exact same thing but...

Viewing 15 posts - 13,936 through 13,950 (of 15,381 total)