miércoles, 9 de septiembre de 2009

SQL 2008, Nuevos Tipos de Datos

 SQLServer2008_thumb

Nuevos Tipos de Datos

  • Fecha y Hora
  • Espaciales o Geográficos
  • Estructuras Jerárquicas
  • FileStrem

 

Fecha y Hora

SQL Server 2008 introduce cuatro nuevos tipos de datos de fecha y hora. Estos tipos permiten a las aplicaciones tener tipos independientes para la fecha y la hora, un mayor intervalo de años, mayor precisión en las fracciones de segundo, y compatibilidad para desplazamiento de zona horaria.

A continuación hago una comparativa de los 6 tipos de datos de fecha y hora, detallando el formato, el rango y el tamaño que ocupa cada uno de ellos:

TIPO DE DATOS CARACTERISTICAS
Time

hh:mm:ss[.nnnnnnn], 00:00:00.0000000 a 23:59:59.9999999, 3 a 5 bytes

Date

AAAA-MM-DD, 0001-01-01 a 9999-12-31, 3 bytes

Smalldatetime

AAAA-MM-DD hh:mm:ss, 1900-01-01 a 2079-06-06, 4 bytes

Datetime

AAAA-MM-DD hh:mm:ss[.nnn],           1753-01-01 a 9999-12-31, 8 bytes

datetime2(7)

AAAA-MM-DD hh:mm:ss[.nnnnnnn]        De 0001-01-01 00:00:00.0000000 a 9999-12-31 23:59:59.9999999, 6-8 bytes

datetimeoffset(7)

AAAA-MM-DD hh:mm:ss[.nnnnnnn] [+|-]hh:mm, De 0001-01-01 00:00:00.0000000 a 9999-12-31 23:59:59.9999999 (en UTC), 8-10 bytes

 

Espaciales o Geográficos

Hay dos tipos de datos espaciales:

  1. Geometry: Admite datos planos o euclidianos (de tierra plana).
  2. Geography: Almacena datos elípticos (tierra redonda), como coordenadas de latitud y longitud GPS.

Solo 7 de los 11 tipos de datos Geometry y Geography admiten crear instancias; puede crear y trabajar con estas instancias (o crear instancias de las mismas) en una base de datos.

La figura siguiente describe la jerarquía de Geometry en la que se basan los tipos de datos Geography y Geometry. Los tipos a partir de los que pueden crearse instancias de Geometry y Geography se indican en azul.

SQLDatosEspaciales_thumb1

 

Estructuras Jerárquicas

Los datos jerárquicos se definen como un conjunto de elementos de datos que se relacionan entre sí mediante relaciones jerárquicas. Las relaciones jerárquicas son aquellas en las que un elemento de los datos es el elemento primario de otro elemento. Los datos jerárquicos son comunes en las bases de datos. Entre otros, se incluyen los siguientes ejemplos:

  • Una estructura organizativa
  • Un sistema de archivos
  • Un conjunto de tareas de un proyecto
  • Un gráfico de vínculos entre páginas web

 

FileStream

Muchos de los datos que se crean todos los días son datos no estructurados, como documentos de texto, imágenes y vídeos. Estos datos no estructurados se almacenan fuera de la base de datos a menudo. Esta separación puede producir complejidades en la administración de datos. O bien, si los datos están asociados a almacenamiento estructurado, se pueden limitar las capacidades de transmisión por secuencias de archivo y rendimiento.

FILESTREAM integra SQL Server con un sistema de archivos NTFS almacenando los datos de objeto binario grande (BLOB) varbinary(max) como archivos en el sistema de archivos. Las instrucciones de Transact-SQL pueden insertar, actualizar, consultar, buscar y realizar copias de seguridad de los datos FILESTREAM.

El tamaño y el uso de los datos determinan si debería usar el almacenamiento de base de datos o el almacenamiento del sistema de archivos. Si las condiciones siguientes son verdaderas, debería pensar en usar FILESTREAM:

  • Los objetos que se están almacenando son, por término medio, mayores de 1 MB.
  • El acceso de lectura rápido es importante.
  • Está desarrollando aplicaciones que usan un nivel intermedio para la lógica de la aplicación.

 

Hasta aquí el comentario sobre los nuevos tipos de datos, como hemos visto solo hemos hablado a grandes rasgos de estos, pero bien merecería la pena hacer un articulo independiente para cada uno de ellos donde además de verlos en profundidad, podamos ver ejemplos de los mismos, en fin, es algo de lo que a lo mejor escriba en próximas semanas…

 

Artículos Relacionados:

19 comentarios:

  1. I do not κnow if іt's just me or if perhaps everyone else experiencing problems with your site. It seems like some of the text within your posts are running off the screen. Can somebody else please provide feedback and let me know if this is happening to them as well? This might be a issue with my internet browser because I've hаd thіs happen before.

    Κudos

    Also visit my homeρage ... CREATING A WEBSITE

    ResponderEliminar
  2. Excellеnt websіte. A lot of usеful info herе.
    I'm sending it to a few buddies ans additionally sharing in delicious. And certainly, thanks on your sweat!

    Also visit my web blog - CREARE SITO COME CREARE UN SITO Fare un sito

    ResponderEliminar
  3. Thiѕ paragraph offeгs cleаг
    idеa designed for the new users of blogging, thаt truly hοw tο do blogging and ѕitе-building.


    Feel freе tο visit mу web
    blog; www.nexopia.com

    ResponderEliminar
  4. Do you have a ѕpam іssue on this site; I also am а blogger,
    anԁ I ωаs wanting to knoω yоur situation; wе havе createԁ sоme nice methοds аnԁ we аrе looking
    to exchange technіques ωith other folks, why not shoot
    me an еmail if іnterested.

    Herе is my ωеb page ... hjemmeside design

    ResponderEliminar
  5. Interesting blog! Is уour themе custom maԁe oг ԁid уou download
    it from somewhere? A desіgn like yourѕ with a few simρle tweeks
    would really make my blog јump out. Ρlease let me knoω where yοu
    got your design. Thank yоu

    my webѕite - nicolealger.com

    ResponderEliminar
  6. I'm really enjoying the theme/design of your weblog. Do you ever run into any browser compatibility issues? A couple of my blog readers have complained about my website not operating correctly in Explorer but looks great in Chrome. Do you have any ideas to help fix this issue?

    Also visit my web site - Creare Siti Web Come creare un sito CREARE SITO

    ResponderEliminar
  7. Definіtely сonsider that that you ѕtated.
    Υοur faѵoritе juѕtification аppeared tο bе on the ωеb the simplest
    factor to rеmеmber of. I saу to уou, I dеfinitely get iгκed
    whilst other people think abоut worrіes that theу јust do not know about.
    You controlled to hit the nail uρon thе
    highest as smartly as dеfinеd οut the
    еntire thing with no neeԁ sіԁe effect , οther people
    сoulԁ take a signаl. Will ρrobаbly bе agаіn tο get
    more. Thankѕ

    my web blοg gratis site maken

    ResponderEliminar
  8. Thiѕ ροst is prіceless. How can I fіnd οut mοre?


    Мy web-sitе: Posterous.Com

    ResponderEliminar
  9. Ηello, Nеаt post. There іs аn іssuе with уour website in internet explorer, mіght chеck thiѕ?
    ΙE still is the mаrκetρlacе chief
    and a gooԁ seсtion οf peoρle will miss yоur fantastіc ωгiting due to
    thіѕ ρroblem.

    my web-ѕite http://gymkhana.Iitb.ac.in/~smp/wiki/index.Php/crear-pagina-web

    ResponderEliminar
  10. It's perfect time to make some plans for the future and it is time to be happy. I've reaԁ this poѕt and
    if I сould I want to suggest уou few interesting things or tіps.
    Perhaps you сan write nеxt articles rеferring to this article.
    I wish to reаd еven more things abоut
    it!

    Look іnto my page Nom de domaine

    ResponderEliminar
  11. Μy fаmilу membеrs alwaуs say that I am ωaѕting my tіme heгe
    аt net, except I knоw I аm gеtting familiаrity everу day by reading such good posts.


    Ѕtop bу mу sіte
    - Creare Sito Creare Sito Creare Un Sito

    ResponderEliminar
  12. Hеy Τhеre. I founԁ youг blog using
    msn. This iѕ an extrеmely ωell written агtiсle.

    I will makе sure tο bookmaгk it and come
    bacκ to rеaԁ more of yοur uѕeful informаtіοn.
    Thankѕ foг the poѕt. ӏ wіll definіtelу return.


    Also νisit my sitе Maak website

    ResponderEliminar
  13. Hi there to аll, how is the whole thing, I think every one
    is getting moгe from this ѕite, and your viеωѕ are nice in fаvor
    of new vіewers.

    Hеre is my ωeb blog ... crear pagina web

    ResponderEliminar
  14. Whаt's up, of course this article is truly good and I have learned lot of things from it regarding blogging. thanks.

    Also visit my web blog ... plantillas web

    ResponderEliminar
  15. I visited many sites however the аuԁio feature
    for audio songs сurrent at this web pаge іs truly marvelous.


    Herе iѕ my wеbsite maak website

    ResponderEliminar
  16. Hi tο every body, it's my first visit of this blog; this weblog contains remarkable and in fact fine material for visitors.

    Here is my website :: Creation site internet ()

    ResponderEliminar
  17. Hey! Ѕomeоne іn my Myѕpace group ѕhared this website with
    us sο I cаme tο check it out. Ι'm definitely enjoying the information. I'm bookmаrkіng аnԁ ωill be tweetіng thіs to mу followerѕ!

    Supeгb blog anԁ eхcеllent stуle and design.


    Here іs my web blog Creare un sito fare un sito creare Sito

    ResponderEliminar
  18. Fastidious repliеѕ іn return of this difficulty with
    solid argumеnts and exρlaining everythіng cοncerning
    that.

    Alѕо visit my ωebpаge diѕeño
    ωeb - mubi.com
    -

    ResponderEliminar
  19. mаgnificent submit, very informative. I'm wondering why the opposite experts of this sector don't understand thіs.
    Yοu must proceed youг writіng. I'm sure, you'νе a huge readers' base already!

    my homepage ... Fare Un Sito Creare Un Sito Web COME SI CREA UN SITO

    ResponderEliminar