SQL Server - data types on a migration, SQL question

Asked By Janis
08-Mar-10 07:19 PM
I am creating a table in SQL that  I am migrating data to from an ODBC
datasource.  I have to convert the data types in the external source to SQL
Server data types.
The fields have dates in this format, 3/8/2010.  I am assuming a datetime
data type is correct?
Do I have to put quotes around dates or anything?

Another question is can you put pictures in SQL Server, for example, jpeg's?
Would you use the sql_variant data type?

I want to remove the "identity" property on a field.  It is not a key field.
It is a regular field.
I did it accidentally in SQL Server.
I try in the properties to change the key field property to false but the
property by just clicking on the object in sQL Server Mgmt studio.

thanks,
SQL Server
(1)
Varbinary
(1)
Varchar
(1)
Date
(1)
Datetimes
(1)
Mgmt
(1)
Filestream
(1)
Identity
(1)
  Andrew J. Kelly replied to Janis
08-Mar-10 09:12 PM
Datetimes are stored internally as 2 4 byte integers and not as a character.
The tool or driver you use to import has to be able to read the source and
convert it to a datetime.  For images you should look at varbinary(max) or
the filestream dataypes.  You need to drop and re add the column to remove
an identity. This is usually done behind the scenes with SSMS by creating a
new table, copying the data, dropping the original and renaming the new one
to the old name.

--

Andrew J. Kelly   SQL MVP
Solid Quality Mentors
  Janis replied to Andrew J. Kelly
08-Mar-10 11:02 PM
That is weird I just altered the date fields to varchar for now.  I can
change it in sql server later.  The object explorer does not reflect the data
type change but if you look in properties it
is changed.  Why is that?
Create New Account
help
What's the go with sql server SQL Server I was just saying today that sql server is full of silly limitations and I seem to hit on a new one every features with more ways to manipulate things than you can poke a stick at. In sql server we don't even have a full range of date functions (a pretty basic feature
Field type in MS SQL Server SQL Server Hi There, is anyone know what is the field type in MS SQL database? I am trying to insert all kind of file in DB (.pdf, .doc, .jpeg and I dont know what the exact field type in sql server DB. is it varbinary? Thanks SQL Server Programming Discussions SQL Server 2008 (1) SQL Server 2005 (1) SQL Server
toring WAV file in SQL Server SQL Server I am trying to store a WAV file in my SQL Server database connected to a C# client. This is my very first experience with SQL prograqmming and I am stuck. I convert the WAV into a Bytearray and then try to store that as varbinary (MAX). The error I get is InvalidCastException was unhandled Failed to convert parameter value from
SQL Server 2005 Installation with SQL Server 2000 SQL Server I have approximately 20 databases on a SQL Server 2000 enterprise edition on a windows 2003 server. I would like to install SQL Server
How to save an image from SQL Server to a file using SQL SQL Server Question In SQL Server 2005, I have a table with images (data type: image). Using only SQL, how do I save an image as a file (on the same server that SQL