Viewing 15 posts - 13,936 through 13,950 (of 15,381 total)
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...
September 26, 2011 at 12:31 pm
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...
September 26, 2011 at 12:13 pm
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...
September 26, 2011 at 11:39 am
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...
September 26, 2011 at 11:24 am
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...
September 26, 2011 at 9:05 am
InfiniteError (9/26/2011)
September 26, 2011 at 8:44 am
Here is a thread on this site on the very topic.
http://www.sqlservercentral.com/Forums/Topic305986-92-1.aspx
September 26, 2011 at 8:30 am
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...
September 26, 2011 at 8:22 am
Elliott Whitlow (9/23/2011)
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...
September 23, 2011 at 3:10 pm
duanecwilson (9/23/2011)
September 23, 2011 at 2:14 pm
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....
September 23, 2011 at 1:27 pm
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...
September 23, 2011 at 1:25 pm
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...
September 23, 2011 at 1:23 pm
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...
September 23, 2011 at 1:02 pm
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...
September 23, 2011 at 12:48 pm
Viewing 15 posts - 13,936 through 13,950 (of 15,381 total)