Showing posts with label copy. Show all posts
Showing posts with label copy. Show all posts

Monday, March 26, 2012

Images

I have a customer that has several thousand images (bmp) stored in a SQL 2000
database. Is there any way to copy the images programmatically to a folder so
they can be viewed using a photo program? Currently they use an Access form
to display the photos and, needless to say, I don't want to copy and paste
4,000 images.
"Paco" <paco6945@.yahooNoSpam.com> wrote in message
news:24B4FEEE-09C8-47E4-AD53-4F51F00DD284@.microsoft.com...
>I have a customer that has several thousand images (bmp) stored in a SQL
>2000
> database. Is there any way to copy the images programmatically to a folder
> so
> they can be viewed using a photo program? Currently they use an Access
> form
> to display the photos and, needless to say, I don't want to copy and paste
> 4,000 images.
>
It's straightforward to do this using a .NET program. When you select rows
from the table you can retrieve the image column as a byte array and save
each byte array to a file.
David

Images

I have a customer that has several thousand images (bmp) stored in a SQL 200
0
database. Is there any way to copy the images programmatically to a folder s
o
they can be viewed using a photo program? Currently they use an Access form
to display the photos and, needless to say, I don't want to copy and paste
4,000 images."Paco" <paco6945@.yahooNoSpam.com> wrote in message
news:24B4FEEE-09C8-47E4-AD53-4F51F00DD284@.microsoft.com...
>I have a customer that has several thousand images (bmp) stored in a SQL
>2000
> database. Is there any way to copy the images programmatically to a folder
> so
> they can be viewed using a photo program? Currently they use an Access
> form
> to display the photos and, needless to say, I don't want to copy and paste
> 4,000 images.
>
It's straightforward to do this using a .NET program. When you select rows
from the table you can retrieve the image column as a byte array and save
each byte array to a file.
Davidsql

Images

I have a customer that has several thousand images (bmp) stored in a SQL 2000
database. Is there any way to copy the images programmatically to a folder so
they can be viewed using a photo program? Currently they use an Access form
to display the photos and, needless to say, I don't want to copy and paste
4,000 images."Paco" <paco6945@.yahooNoSpam.com> wrote in message
news:24B4FEEE-09C8-47E4-AD53-4F51F00DD284@.microsoft.com...
>I have a customer that has several thousand images (bmp) stored in a SQL
>2000
> database. Is there any way to copy the images programmatically to a folder
> so
> they can be viewed using a photo program? Currently they use an Access
> form
> to display the photos and, needless to say, I don't want to copy and paste
> 4,000 images.
>
It's straightforward to do this using a .NET program. When you select rows
from the table you can retrieve the image column as a byte array and save
each byte array to a file.
David

Friday, March 23, 2012

Image save into folder

Dear Professional,
Image saved in the table and I wanna copy that image into any folder let's
say... D:\Image\MineImage.gif
Is it possible ?
Thanks
Hi
You will have to write some VB or c# code to do that. SQL Server has no
native support to write out a BLOB filed to a file.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Roy" <roy@.hotmail.com> wrote in message
news:OnuaCw3cFHA.3932@.TK2MSFTNGP12.phx.gbl...
> Dear Professional,
> Image saved in the table and I wanna copy that image into any folder let's
> say... D:\Image\MineImage.gif
> Is it possible ?
> Thanks
>
>
>
>
|||Okie I am ready to write code in VB... any website is available where I can
find that sort of help.
Thanks
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:O0KTG33cFHA.1036@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> Hi
> You will have to write some VB or c# code to do that. SQL Server has no
> native support to write out a BLOB filed to a file.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Roy" <roy@.hotmail.com> wrote in message
> news:OnuaCw3cFHA.3932@.TK2MSFTNGP12.phx.gbl...
let's
>
|||http://support.microsoft.com/default...b;en-us;194975
http://support.microsoft.com/kb/308042/EN-US/
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Roy" <roy@.hotmail.com> wrote in message
news:uj$FjV4cFHA.2124@.TK2MSFTNGP14.phx.gbl...
> Okie I am ready to write code in VB... any website is available where I
> can
> find that sort of help.
> Thanks
> "Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
> news:O0KTG33cFHA.1036@.tk2msftngp13.phx.gbl...
> let's
>
|||Roy wrote:
> Okie I am ready to write code in VB... any website is available where
> I can find that sort of help.
>
I prefer a book for this. For Vb.Net 2003, I'd recommend "Programming
Microsoft Visual Basic.Net 2003," by Francesco Balena (Microsoft Press).
You're about to get into some very large topics: The .Net 1.1 framework,
Windows Forms, and ADO.Net.
Also, check out http://www.devx.com/
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||here is the simple example for saving images into disk
'=================================
Dim rst As New ADODB.Recordset
Dim Image1() As Byte
Dim ms As New ADODB.Stream
Dim cmd As New ADODB.Command
Dim l As Long
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "proc_getImage" '==== poc_code_look_below
cmd.ActiveConnection = CurrentProject.Connection
cmd.Parameters("@.ID") = ID
Set rst = cmd.Execute
ms.Type = adTypeBinary
ms.Open
l = rst(0).ActualSize
Image1() = rst(0).GetChunk(l + 1)
rst.Close
ms.Write (Image1())
deletefile ("c:\img.jpg")
ms.SaveToFile "c:\img.jpg", adSaveCreateOverWrite
ms.Close
Set cmd = Nothing
Set rst = Nothing
Set ms = Nothing
'================================
create PROCEDURE proc_GetImage
(@.ID int)
AS
BEGIN
SELECT photo
FROM tbl_images
WHERE ([ID] = @.ID)
END
'========================
it is just an example, so it is up to you

Monday, March 19, 2012

I'm not sure why this one fails,

I used the following SQL to extract data from our Firms emplyee database and
creates a text file that gets imported into our copy machine controllers.
Output lines look like this:
A|U|4111|MPLS, PBMS|01|0||
A|U|4222|RIC, PBMS|06|0||
A|U|2036|user, name|01|0|N|1234562|
The last number is the last 7 of the persons corporate VISA card. On SQL
2000 this SQL worked:
select 'A|U|' +
RTRIM(EMPLOYEE_CODE) + '|'
+ RTRIM(EMPLOYEE_NAME) + '|'
+ rtrim(offc) + '|0|' +
case position
when 'partner' then 'P'
else 'N'
end
+ '|' , _visano , '|'
from HBM_PERSNL
where INACTIVE = 'N'
and EMPLOYEE_NAME NOT like '%CMS%'
and EMPLOYEE_NAME NOT Like '%billing%'
and EMPLOYEE_NAME NOT Like '%temp%'
On SQL 2005 it doesn't: The sql runs but only delivers those with that
VISA Numeber, where it use to give you both those with and without cards.
Any Ideas?When you don't have a credit card number, are you storing a NULL instead?
Are you getting any errors? How are you creating the file?
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Jay Bukstein" <JayBukstein@.discussions.microsoft.com> wrote in message
news:697B4582-6D4F-47BD-B5DF-F1AD95422D0C@.microsoft.com...
I used the following SQL to extract data from our Firms emplyee database and
creates a text file that gets imported into our copy machine controllers.
Output lines look like this:
A|U|4111|MPLS, PBMS|01|0||
A|U|4222|RIC, PBMS|06|0||
A|U|2036|user, name|01|0|N|1234562|
The last number is the last 7 of the persons corporate VISA card. On SQL
2000 this SQL worked:
select 'A|U|' +
RTRIM(EMPLOYEE_CODE) + '|'
+ RTRIM(EMPLOYEE_NAME) + '|'
+ rtrim(offc) + '|0|' +
case position
when 'partner' then 'P'
else 'N'
end
+ '|' , _visano , '|'
from HBM_PERSNL
where INACTIVE = 'N'
and EMPLOYEE_NAME NOT like '%CMS%'
and EMPLOYEE_NAME NOT Like '%billing%'
and EMPLOYEE_NAME NOT Like '%temp%'
On SQL 2005 it doesn't: The sql runs but only delivers those with that
VISA Numeber, where it use to give you both those with and without cards.
Any Ideas?|||Hi Jay
a quick question, is _visano a column in the HBM_PERSNL table?
I noticed that at the end of the query you are using a comma instead of + to
concat the string, should the query be:
select 'A|U|' +
RTRIM(EMPLOYEE_CODE) + '|'
+ RTRIM(EMPLOYEE_NAME) + '|'
+ rtrim(offc) + '|0|' +
case position
when 'partner' then 'P'
else 'N'
end
+ '|' + _visano + '|'
from HBM_PERSNL
where INACTIVE = 'N'
and EMPLOYEE_NAME NOT like '%CMS%'
and EMPLOYEE_NAME NOT Like '%billing%'
and EMPLOYEE_NAME NOT Like '%temp%'
Lucas
"Jay Bukstein" wrote:

> I used the following SQL to extract data from our Firms emplyee database a
nd
> creates a text file that gets imported into our copy machine controllers.
> Output lines look like this:
> A|U|4111|MPLS, PBMS|01|0||
> A|U|4222|RIC, PBMS|06|0||
> A|U|2036|user, name|01|0|N|1234562|
> The last number is the last 7 of the persons corporate VISA card. On SQL
> 2000 this SQL worked:
> select 'A|U|' +
> RTRIM(EMPLOYEE_CODE) + '|'
> + RTRIM(EMPLOYEE_NAME) + '|'
> + rtrim(offc) + '|0|' +
> case position
> when 'partner' then 'P'
> else 'N'
> end
> + '|' , _visano , '|'
> from HBM_PERSNL
> where INACTIVE = 'N'
> and EMPLOYEE_NAME NOT like '%CMS%'
> and EMPLOYEE_NAME NOT Like '%billing%'
> and EMPLOYEE_NAME NOT Like '%temp%'
> On SQL 2005 it doesn't: The sql runs but only delivers those with that
> VISA Numeber, where it use to give you both those with and without cards.
> Any Ideas?
>|||Sounds like your server or session defaults on '05 yield null on
concatenation; i.e., select 'a' + NULL yields NULL whereas on 2000 select
'a' + NULL yields 'a'.
Suggest to modify the query to
....
'|' + ISNULL(_visano, '') + '|'
...
In fact, this is a good practice for any columns that allow null. That way
changes to server or session settings always yield the same results.
"Jay Bukstein" <JayBukstein@.discussions.microsoft.com> wrote in message
news:697B4582-6D4F-47BD-B5DF-F1AD95422D0C@.microsoft.com...
>I used the following SQL to extract data from our Firms emplyee database
>and
> creates a text file that gets imported into our copy machine controllers.
> Output lines look like this:
> A|U|4111|MPLS, PBMS|01|0||
> A|U|4222|RIC, PBMS|06|0||
> A|U|2036|user, name|01|0|N|1234562|
> The last number is the last 7 of the persons corporate VISA card. On SQL
> 2000 this SQL worked:
> select 'A|U|' +
> RTRIM(EMPLOYEE_CODE) + '|'
> + RTRIM(EMPLOYEE_NAME) + '|'
> + rtrim(offc) + '|0|' +
> case position
> when 'partner' then 'P'
> else 'N'
> end
> + '|' , _visano , '|'
> from HBM_PERSNL
> where INACTIVE = 'N'
> and EMPLOYEE_NAME NOT like '%CMS%'
> and EMPLOYEE_NAME NOT Like '%billing%'
> and EMPLOYEE_NAME NOT Like '%temp%'
> On SQL 2005 it doesn't: The sql runs but only delivers those with that
> VISA Numeber, where it use to give you both those with and without cards.
> Any Ideas?
>

Monday, March 12, 2012

i'm new to dw been to oltp for some time

I'm new to dw i'm just confuse with the terms
1. what is a warehouse?
Is it just a copy of an OLTP database that has been cleased and transformed
is this a SQL server DB and not an AS DB
or is it the AS DB
thanks
Jose de Jesus Jr. Mcp,Mcdba
Data Architect
Sykes Asia (Manila philippines)
MCP #2324787
Before explaining a data warehouse you need to think of the
opposite, a transaction system. If your company sells things
then you will likely have a transaction system which stores
details of all your customers, what they have bought, how
much they owe, what products you are selling etc.
But this transaction system is ever changing, and it is almost
impossible to find out if, for example, you are selling more this
month that you did last month, or if you are owed more money
this month than last month, or if the sales of a certain product
has increased because of the marketing campaign you ran in
the north for the last three months.
So with a data warehouse you take a 'snapshot' of the data at
a particular time:- hourly, daily, weekly, monthly etc. Gradually
you build up a history of what was in your transaction database
and you can then perform 'business intelligence' on that data to
try to help you run your company better.
This business intelligence is done with 'query and reporting' tools
of which there are many, but products such as Excel, Access, Brio,
Business Objects, Crystal Reports, Cognos etc can all be used.
You can also aggregate and summarize the data as you go along,
so that users do not see all the detail, but just a summary of all
the products sold in the north, or the west and so on.
Of course you store this data warehouse on a different machine,
and in a different relational database server. This is because you
do not want to impact the performance of your transaction system
when people are doing end-user queries on the data warehouse.
Now the hard part is deciding what data to put in your data
warehouse, how often to put it there, even finding out what all
your data means (many companies do not actually know what
all the data in their database means).
Of cours you can also build an OLAP cube, which is a form of
a data warehouse. Here all the data is pre-aggregated to produce
very fast query results, but of course you can only query what is
in the 'cube'.
In SQL Server an OLAP cube is held in relational tables (fact tables
and dimensions tables) but you do not query the tables directly
but via the 'cube'. Some products, such as Hyperion Essbase, do not
hold their cube in relational tables.
Building a data warehouse or OLAP cube, can be a long and
complex job (just finding out what data a company has, where it
is, and how to access it, can be a major job).
There are plenty of books about data warehouse if you look
for them
Alan
|||Hi Jose,
I have published a lot of materials for 'newbies' on my personal
website www.peternolan.com. If you have anything else you would like
to see on my website please let me know as I am always interested in
hearing feedback on what is there.
By the way, I notice you are in Manila. I used to work with Remax
International and they are great people. You might want to call them
and see if they can come and present to your company about BI/DW...I
could not find their web site...I did find
this..http://www.celerant.com/Internationa...ssPartners.cfm
Remax was in Makati district..I'm sure you will be able to find them in
your local web sites or phone books...
Best Regards
Peter Nolan...

i'm new to dw been to oltp for some time

I'm new to dw i'm just confuse with the terms
1. what is a warehouse?
Is it just a copy of an OLTP database that has been cleased and transformed
is this a SQL server DB and not an AS DB
or is it the AS DB
thanks
Jose de Jesus Jr. Mcp,Mcdba
Data Architect
Sykes Asia (Manila philippines)
MCP #2324787Before explaining a data warehouse you need to think of the
opposite, a transaction system. If your company sells things
then you will likely have a transaction system which stores
details of all your customers, what they have bought, how
much they owe, what products you are selling etc.
But this transaction system is ever changing, and it is almost
impossible to find out if, for example, you are selling more this
month that you did last month, or if you are owed more money
this month than last month, or if the sales of a certain product
has increased because of the marketing campaign you ran in
the north for the last three months.
So with a data warehouse you take a 'snapshot' of the data at
a particular time:- hourly, daily, weekly, monthly etc. Gradually
you build up a history of what was in your transaction database
and you can then perform 'business intelligence' on that data to
try to help you run your company better.
This business intelligence is done with 'query and reporting' tools
of which there are many, but products such as Excel, Access, Brio,
Business Objects, Crystal Reports, Cognos etc can all be used.
You can also aggregate and summarize the data as you go along,
so that users do not see all the detail, but just a summary of all
the products sold in the north, or the west and so on.
Of course you store this data warehouse on a different machine,
and in a different relational database server. This is because you
do not want to impact the performance of your transaction system
when people are doing end-user queries on the data warehouse.
Now the hard part is deciding what data to put in your data
warehouse, how often to put it there, even finding out what all
your data means (many companies do not actually know what
all the data in their database means).
Of cours you can also build an OLAP cube, which is a form of
a data warehouse. Here all the data is pre-aggregated to produce
very fast query results, but of course you can only query what is
in the 'cube'.
In SQL Server an OLAP cube is held in relational tables (fact tables
and dimensions tables) but you do not query the tables directly
but via the 'cube'. Some products, such as Hyperion Essbase, do not
hold their cube in relational tables.
Building a data warehouse or OLAP cube, can be a long and
complex job (just finding out what data a company has, where it
is, and how to access it, can be a major job).
There are plenty of books about data warehouse if you look
for them
Alan|||Hi Jose,
I have published a lot of materials for 'newbies' on my personal
website www.peternolan.com. If you have anything else you would like
to see on my website please let me know as I am always interested in
hearing feedback on what is there.
By the way, I notice you are in Manila. I used to work with Remax
International and they are great people. You might want to call them
and see if they can come and present to your company about BI/DW...I
could not find their web site...I did find
this..http://www.celerant.com/Internation...essPartners.cfm
Remax was in Makati district..I'm sure you will be able to find them in
your local web sites or phone books...
Best Regards
Peter Nolan...