Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL insert into field limitation question

Status
Not open for further replies.

FoxT2

MIS
Oct 3, 2003
143
US
Hello,

Is there a limit to how many fields you can specify in a INSERT INTO command? I am trying to build a INSERT INTO command 248 fields and it will not execute.

INSERT INTO table1 (fld1,fld2,fld3,fld4,......,fld248) VALUES (fld1,fld2,fld3,fld4,......,fld248)

----------------
Another question on a different topic; what is the difference between a DATETIME field and a SMALLDATETIME field in SQL server. Why would I use one over the other?


Thanks,

FoxT
 
Values with the datetime data type are stored internally by Microsoft SQL Server as two 4-byte integers. The first 4 bytes store the number of days before or after the base date, January 1, 1900. The base date is the system reference date. Values for datetime earlier than January 1, 1753, are not permitted. The other 4 bytes store the time of day represented as the number of milliseconds after midnight.

The smalldatetime data type stores dates and times of day with less precision than datetime. SQL Server stores smalldatetime values as two 2-byte integers. The first 2 bytes store the number of days after January 1, 1900. The other 2 bytes store the number of minutes since midnight. Dates range from January 1, 1900, through June 6, 2079, with accuracy to the minute.


[bandito] [blue]DBomrrsm[/blue] [bandito]
 
FoxT2: Is there an error message associated with the INSERT problem?
 
Edwin, I figured out what the problem was. I had a syntax error in my string statement. It is a very long statement and was hard to find. However I would still like to know if there is a limit to the number of fields you can specify in a INSERT INTO command. If there is any at all.

Thanks,

FoxT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top