Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

SELECT INTO FILESTREAM Expand / Collapse
Author
Message
Posted Tuesday, May 28, 2013 9:13 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 12:01 PM
Points: 33,188, Visits: 15,326
Comments posted to this topic are about the item SELECT INTO FILESTREAM






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1457565
Posted Tuesday, May 28, 2013 9:38 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 6:38 PM
Points: 1,371, Visits: 1,560
Interesting question Steve. I had no idea about this, except the connection of VARBINARY and FILESTREAM. Luckily was able to guess the correct answer

~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter

Post #1457569
Posted Wednesday, May 29, 2013 1:02 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, August 4, 2014 5:38 AM
Points: 945, Visits: 558
I don't have idea about filestream but i'm sure other than IDENTITY property no other attributes will be copied to new table. So i guessed it should be varchar(max) but it was wrong , could have gone through the BOL before answering.

--
Dineshbabu
Desire to learn new things..
Post #1457598
Posted Wednesday, May 29, 2013 2:20 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, July 25, 2014 12:34 AM
Points: 1,888, Visits: 2,326
Dineshbabu (5/29/2013)
I don't have idea about filestream but i'm sure other than IDENTITY property no other attributes will be copied to new table. So i guessed it should be varchar(max) but it was wrong , could have gone through the BOL before answering.

Same thing happened with me



_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1457608
Posted Wednesday, May 29, 2013 3:29 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 4:11 PM
Points: 5,969, Visits: 8,228
I am not surprised that SELECT ... INTO loses the FILESTREAM attribute. However, I was surprised to find that varchar(max) with FILESTREAM would be converted to varbinary(max).
So then I did a bit more research, and found that FILESTREAM is not even permitted with varchar(max) - so not really a surprise that all FILESTREAM columns get converted to varbinary(max), since that already was their data type!



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1457627
Posted Wednesday, May 29, 2013 3:57 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, August 22, 2014 2:30 AM
Points: 88, Visits: 322
Interesting question Steve. I had no idea about this, except the connection of VARBINARY and FILESTREAM. Luckily was able to guess the correct answer

~ Lokesh Vij


+1, except I guessed wrong. Thanks for the question.


Dave Morris

"Measure twice, saw once"
Post #1457642
Posted Wednesday, May 29, 2013 4:38 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 1:03 PM
Points: 13,606, Visits: 10,489
Easy one, thanks Steve!



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1457656
Posted Wednesday, May 29, 2013 5:38 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 7:29 AM
Points: 3,914, Visits: 5,092
Excellent question, thanks Steve - discovered this while doing an investigation for the implementation of FILESTREAM in my environment

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1457675
Posted Wednesday, May 29, 2013 9:20 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 12:11 PM
Points: 21,639, Visits: 15,308
Hugo Kornelis (5/29/2013)
I am not surprised that SELECT ... INTO loses the FILESTREAM attribute. However, I was surprised to find that varchar(max) with FILESTREAM would be converted to varbinary(max).
So then I did a bit more research, and found that FILESTREAM is not even permitted with varchar(max) - so not really a surprise that all FILESTREAM columns get converted to varbinary(max), since that already was their data type!


Thanks Hugo.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1457799
Posted Wednesday, May 29, 2013 9:38 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 8:31 AM
Points: 8,707, Visits: 9,255

Nice question.

Dineshbabu (5/29/2013)
I don't have idea about filestream but i'm sure other than IDENTITY property no other attributes will be copied to new table. So i guessed it should be varchar(max) but it was wrong , could have gone through the BOL before answering.

But why did you think the source type was varchar(max) filestream? varchar(max) isn't a BLOB type any more that text was it's LOB but not BLOB, so varchar(max) filestream doesn't exist.


Tom
Post #1457809
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse