Click here to Skip to main content
15,914,795 members
Home / Discussions / Database
   

Database

 
AnswerRe: need to layout the database Pin
keyboard warrior21-Jul-08 14:16
keyboard warrior21-Jul-08 14:16 
QuestionRe: need to layout the database Pin
Paul Conrad21-Jul-08 14:27
professionalPaul Conrad21-Jul-08 14:27 
AnswerRe: need to layout the database Pin
keyboard warrior21-Jul-08 14:31
keyboard warrior21-Jul-08 14:31 
GeneralRe: need to layout the database Pin
User 171649221-Jul-08 13:18
professionalUser 171649221-Jul-08 13:18 
GeneralRe: need to layout the database Pin
keyboard warrior21-Jul-08 14:33
keyboard warrior21-Jul-08 14:33 
GeneralRe: need to layout the database Pin
Ennis Ray Lynch, Jr.21-Jul-08 15:02
Ennis Ray Lynch, Jr.21-Jul-08 15:02 
QuestionAccessing a "default" database in a linked server Pin
Luis Alonso Ramos21-Jul-08 9:44
Luis Alonso Ramos21-Jul-08 9:44 
AnswerRe: Accessing a "default" database in a linked server Pin
Wendelius21-Jul-08 10:03
mentorWendelius21-Jul-08 10:03 
GeneralRe: Accessing a "default" database in a linked server Pin
Luis Alonso Ramos21-Jul-08 11:41
Luis Alonso Ramos21-Jul-08 11:41 
GeneralRe: Accessing a "default" database in a linked server Pin
Wendelius21-Jul-08 18:01
mentorWendelius21-Jul-08 18:01 
GeneralRe: Accessing a "default" database in a linked server Pin
Luis Alonso Ramos22-Jul-08 8:13
Luis Alonso Ramos22-Jul-08 8:13 
GeneralRe: Accessing a "default" database in a linked server Pin
Wendelius22-Jul-08 9:10
mentorWendelius22-Jul-08 9:10 
QuestionCan we restrict the number of maximum records inserted in a particular table? Pin
Rocky#21-Jul-08 0:24
Rocky#21-Jul-08 0:24 
AnswerRe: Can we restrict the number of maximum records inserted in a particular table? Pin
Krish - KP21-Jul-08 1:12
Krish - KP21-Jul-08 1:12 
GeneralRe: Can we restrict the number of maximum records inserted in a particular table? Pin
Rocky#21-Jul-08 1:19
Rocky#21-Jul-08 1:19 
GeneralRe: Can we restrict the number of maximum records inserted in a particular table? Pin
Mycroft Holmes21-Jul-08 14:22
professionalMycroft Holmes21-Jul-08 14:22 
GeneralRe: Can we restrict the number of maximum records inserted in a particular table? Pin
Rocky#21-Jul-08 19:26
Rocky#21-Jul-08 19:26 
GeneralRe: Can we restrict the number of maximum records inserted in a particular table? Pin
Mycroft Holmes21-Jul-08 19:55
professionalMycroft Holmes21-Jul-08 19:55 
GeneralRe: Can we restrict the number of maximum records inserted in a particular table? Pin
Rocky#21-Jul-08 21:07
Rocky#21-Jul-08 21:07 
AnswerRe: Can we restrict the number of maximum records inserted in a particular table? Pin
nelsonpaixao24-Jul-08 12:34
nelsonpaixao24-Jul-08 12:34 
QuestionConvert Decimal To Date? Pin
obarahmeh20-Jul-08 23:06
obarahmeh20-Jul-08 23:06 
AnswerRe: Convert Decimal To Date? Pin
Rocky#21-Jul-08 0:20
Rocky#21-Jul-08 0:20 
GeneralRe: Convert Decimal To Date? [modified] Pin
Pete O'Hanlon22-Jul-08 9:19
mvePete O'Hanlon22-Jul-08 9:19 
GeneralRe: Convert Decimal To Date? Pin
Rocky#22-Jul-08 18:24
Rocky#22-Jul-08 18:24 
GeneralRe: Convert Decimal To Date? [modified] Pin
Pete O'Hanlon22-Jul-08 22:06
mvePete O'Hanlon22-Jul-08 22:06 
No, no, no. You're just plain wrong.

GETDATE() is a system function, not field data. It's no different in effect to you typing SELECT 3. This doesn't mean that every integer field defaults to 3. Tell you what, as a test, run the following script:
USE [<<database>>]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].Test(
	[ID] [int] IDENTITY(1,1) NOT NULL,
    [Text] NVARCHAR(20) NOT NULL,
	[Created] [datetime] NOT NULL,
 CONSTRAINT [PK_Test] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, 
STATISTICS_NORECOMPUTE  = OFF, 
IGNORE_DUP_KEY = OFF, 
ALLOW_ROW_LOCKS  = ON, 
ALLOW_PAGE_LOCKS  = ON) 
ON [PRIMARY]
) 
GO

INSERT INTO Test([Text])  VALUES ('Hello')

GO
Guess what. Created doesn't get a default value. What you do get is an error:

Msg 515, Level 16, State 2, Line 2
Cannot insert the value NULL into column 'Created', table 'database.dbo.Test'; column does not allow nulls. INSERT fails.
The statement has been terminated.

So no default value there then. Please, before you pass information like this along, will you please check to see if you are right?


[EDIT]Rocky# is right - we are talking at cross purposes here, and he's entirely right to say that there is no date only type in SQL Servers up to 2005. 2K8 has a date type which stores the date only, but datetime does what it says on the tin and has the time portion as part of it.

My apologies for any confusion caused by my misreading of Rocky#'s post.[/EDIT]

Deja View - the feeling that you've seen this post before.

My blog | My articles



modified on Wednesday, July 23, 2008 7:12 AM

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.