Showing posts with label column. Show all posts
Showing posts with label column. Show all posts

Friday, March 30, 2012

IME?

"Derived column transformation editor"

drag and drop a column into the bottom pane

right click on the 'expression' column and it has a menu item called "open IME"

but nothing happens when I do it.

Is it an expression editor?

Strategic thinking:

Microsoft BI

Reporting Services Expression language: VB.net

Integration Services Expression language: "similar to the syntax that the C and C# languages use"

great! Smile

IME - Microsoft Global Input Method Editors (IMEs) - http://www.microsoft.com/windows/ie/ie6/downloads/recommended/ime/default.mspx

It is nothing to do with SSIS, it is just an option that Windows can provide for text boxes. There is no expression editor available for derived columns, just that free entry text box.

As for the new SSIS expression syntax, yes it is a bit annoying it is yet another syntax, but the benefit is that it is very fast and baked into SSIS. Anything else would not be as fast, and in ETL that counts.

sql

Monday, March 26, 2012

Images - Store in a database or file system?

I have recently designed and built my first database using SQL server 2005 express. I have included an image (BLOB) column in one of the database tables. This is a bad idea according to some experts, and some say it is OK!

I am currently carrying out a trial with just 3 pictures via Visual Basic 2005 express forms, and there is no problem so far as the images are displayed for each record. But I anticipate between 300 - 1000 images for the table, and this could pose real problems for SQL server 2005 express and Visual Basic 2005 express, I guess.

I have just been reading that the cost of storing large images in the database is too high! I have also read it's better to store images (BLOB) into the file system because it is cheaper to store them no matter how many there are.

But the question is how I can reference an image in this path: C:\Picture\Product\Grocery\00052745.jpg in the database table, so that when I select a record Visual Basic 2005 forms the image is displayed accordingly, similar as when stored directly in the database table? Your help very much appreciated.

hi Paul,

PaulN wrote:

I have recently designed and built my first database using SQL server 2005 express. I have included an image (BLOB) column in one of the database tables. This is a bad idea according to some experts, and some say it is OK!

yes, this often result in "religious wars" bewteen parts.. I'm with the "all in the db" part , with just one caveat (regarding MSDE and SQLExpress), depending on the "limited" database maximum size of 2gb for MSDE and 4gb for SQLExpress.. this obviously could "limit" the quantity and size of the lobs stored in the database, thus penalizing an architecture of a project..

well.. 4gb are not that "limited" if you store little jpges, but could eventually become a real limit if you have to store a "tipycal" ripped movie of about 700mb..

I am currently carrying out a trial with just 3 pictures via Visual Basic 2005 express forms, and there is no problem so far as the images are displayed for each record. But I anticipate between 300 - 1000 images for the table, and this could pose real problems for SQL server 2005 express and Visual Basic 2005 express, I guess.

actually that's not that bad... it's real a "limited" quantity you should not have problem with..

I have just been reading that the cost of storing large images in the database is too high! I have also read it's better to store images (BLOB) into the file system because it is cheaper to store them no matter how many there are.

this is true.. standard disk space is absolutely cheap. but you incour in other kind of problems.. see later..

But the question is how I can reference an image in this path: C:\Picture\Product\Grocery\00052745.jpg in the database table, so that when I select a record Visual Basic 2005 forms the image is displayed accordingly, similar as when stored directly in the database table? Your help very much appreciated.

thi is the problem with "external" resources... I mean that it's a traditional scenario for this kind of stuff, but this includes an important access tradeoff.. if you have "all your things" within the database, you only need to query it for returning the desired output (including the lob's data).. all is incapsulated within the database... you do not have "particular" security problems as your database permissions schema already includes lobs.. on the contrary, if your "table" just stores the "path" to the actual lob jpeg file, that file should be available among the whole lan (if your scenario involves remote connections), meaning it must reside on a "share" where all potential (remote) users can access it, with read-only and/or read/write permissions on it (depending on the nature) in order to allow both access (read) and modifications (write)...

more, all the automated tasks as you already pointed out are out of scope, you have to load pictures from a stream loaded with the lob's data from the (remote) folder... this last part is not that bad (streaming data), but all the remaining part is (accessing physical NTFS permissions, share, and disk subsystem), IMVHO...

I do prefer to streams lob's data out of a (say) datareader object anyway from the database not directly relying on wizard's bindings as usually data have to be "purged/checked" before presentation (but this is not mandatory, it depends on your design and the actual prj), but all remains "incapsulated" in the db... just a few stored procedures to read/write data in and out and the job is done...

regards|||

I agree with Andrea.

For small photos, store them in the database. You won't 'lose' photos quite as easily as if they are just 'floating' around the file system somewhere. And backups are much easier.

However, if I were dealing with something like a Contract Photo Agency, with hundreds of thousands of photos, in high resolution (meaning multi-MB photo/file sizes), I would investigate something like 'FileNET', or other of the content management 'systems'.

|||Another good ressource is: To blob or not to blob: http://research.microsoft.com/research/pubs/view.aspx?msr_tr_id=MSR-TR-2006-45

Jens K. Suessmeyer.

http://www.sqlserver2005.de
sql

Images

When you have a column property set to image, does it link to or does it embed the image in the table?

Davids Learning

If you specify the coloumn as image, this simply means that you are storing binary data. The name image is sometime is bit misleading :-)

HTH, jens Suessmeyer.

http://www.sqlserver2005.de|||If you needed to store an image like a tiff,bitmap,jpeg, what would you use?|||

Hi !

If you are in SQL Server 2005, I would prefer the VARBINARY(MAX),as the IMAGE and the TEXT are tro be deprecated in further versions. If you are on SQL Server 2000, I would prefer using either the IMAGE or the TEXT (in common it makes no difference, because they are nearly implemented the same way, beside that the TEXT type has some extra function which on work on that type). In this case, as you appearantly will need no functions of the TEXT type, I would choose IMAGE.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Image storing

How do i store an image in the db?

I guess i have to chose image as the type of the column.

Do i really need to build an application that will fetch the image and put it in a query?

or can i use directly use sql server management studio?

thanks,If you are on SQLServer2005 you should better choose VARBINARY(MAX), IMAGE and Text will be deprecated in the future. YOu have to use an application which will convert the physical file to the actual byte array.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

Jens Suessmeyer wrote:

If you are on SQLServer2005 you should better choose VARBINARY(MAX), IMAGE and Text will be deprecated in the future. YOu have to use an application which will convert the physical file to the actual byte array.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Do you know an application that will convert the file to actual byte? or i have to code it ?|||Hi,

thats realllllyy easy, have a look at this snippet:

http://www.codeproject.com/aspnet/PicManager.asp

HTH; jens SUessmeyer.

http://www.sqlserver2005.de

Image size : 2Gb per row or per column?

Does the limit on an image column mean that I can put up to 2Gb in each row,
or can I only put a TOTAL of 2Gb of image data into a table.
It is 2gb for each row.
hth
Vikram Vamshi
Database Engineer
Eclipsys Corporation
"Jonny D" <Jonny D@.discussions.microsoft.com> wrote in message
news:8B843B3C-CE55-43C6-BA1D-D496C3BDE459@.microsoft.com...
> Does the limit on an image column mean that I can put up to 2Gb in each
> row,
> or can I only put a TOTAL of 2Gb of image data into a table.
|||Thanks!
"Vikram Vamshi" wrote:

> It is 2gb for each row.
> hth
> --
> Vikram Vamshi
> Database Engineer
> Eclipsys Corporation
> "Jonny D" <Jonny D@.discussions.microsoft.com> wrote in message
> news:8B843B3C-CE55-43C6-BA1D-D496C3BDE459@.microsoft.com...
>
>

Image size : 2Gb per row or per column?

Does the limit on an image column mean that I can put up to 2Gb in each row
,
or can I only put a TOTAL of 2Gb of image data into a table.It is 2gb for each row.
hth
--
Vikram Vamshi
Database Engineer
Eclipsys Corporation
"Jonny D" <Jonny D@.discussions.microsoft.com> wrote in message
news:8B843B3C-CE55-43C6-BA1D-D496C3BDE459@.microsoft.com...
> Does the limit on an image column mean that I can put up to 2Gb in each
> row,
> or can I only put a TOTAL of 2Gb of image data into a table.|||Thanks!
"Vikram Vamshi" wrote:

> It is 2gb for each row.
> hth
> --
> Vikram Vamshi
> Database Engineer
> Eclipsys Corporation
> "Jonny D" <Jonny D@.discussions.microsoft.com> wrote in message
> news:8B843B3C-CE55-43C6-BA1D-D496C3BDE459@.microsoft.com...
>
>

Image size : 2Gb per row or per column?

Does the limit on an image column mean that I can put up to 2Gb in each row,
or can I only put a TOTAL of 2Gb of image data into a table.It is 2gb for each row.
hth
--
Vikram Vamshi
Database Engineer
Eclipsys Corporation
"Jonny D" <Jonny D@.discussions.microsoft.com> wrote in message
news:8B843B3C-CE55-43C6-BA1D-D496C3BDE459@.microsoft.com...
> Does the limit on an image column mean that I can put up to 2Gb in each
> row,
> or can I only put a TOTAL of 2Gb of image data into a table.|||Thanks!
"Vikram Vamshi" wrote:
> It is 2gb for each row.
> hth
> --
> Vikram Vamshi
> Database Engineer
> Eclipsys Corporation
> "Jonny D" <Jonny D@.discussions.microsoft.com> wrote in message
> news:8B843B3C-CE55-43C6-BA1D-D496C3BDE459@.microsoft.com...
> > Does the limit on an image column mean that I can put up to 2Gb in each
> > row,
> > or can I only put a TOTAL of 2Gb of image data into a table.
>
>sql

Friday, March 23, 2012

Image save to SQL server

When I am trying to save byte[] of an image to SQL server which is having an image column, I am getting an error like this " A severe error occured on the current command. The results, if any, should be discarded.". I am trying to save through a stored procedure.
In the sp also, the datatype is image.

Can you give a reply to this?Try this:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q240194

Wednesday, March 21, 2012

Image in Page Header

I'm running into an problem where I have an image in the page header of my report and I added sorting options to my column headers. When I sort the column when viewing the report, the image in the page header does not appear anymore (the little red box appears instead of the image.) Has anyone run into this same problem and figured out to fix it?

Thanks!

I think you want to post your question to SQL Server Reporting Services (http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=82&SiteID=1)

Ovidiu

Image Date Types

Hi,
Can any one tell me how to change an existing
Image column in a table to binary type. I am looking at
the T-SQL .
Thanks and Regards,
SajeevCREATE TABLE Tmp_myImageTable ( imagefield binary(1000) )
GO
EXEC ('INSERT INTO Tmp_testimage (im)
SELECT CONVERT(binary(1000), imagefield) FROM myImageTable ')
GO
DROP TABLE myImageTable
GO
EXECUTE sp_rename N'Tmp_myImageTable', N'myImagetable', 'OBJECT'
GO
Nathan H.O.

Image Data Type

I have a column that has audit details stored as an image data type. How do i convert that into meaningful data that i can read.
Example:
0x78F992BD69BF23BE243134839506265892223083981A6104 A389A1B1918129B6303035B434C7748FAF63508887A33B99CB AE4C8C4C8D71B68DCC8CCC8C0D4D71350040B246C603309AEE 1810E0EAE8437046C3C440D7C48892414E007B1F8BED
I am guessing this is text with fomatting instructions. Because in the software that utilized this database, this field seems to be interpreted as a hierarachial table showing the audit details of an event.

please offer any suggestions you can.
thanks so muchActually this is binary data. The only way to access or read it is through an application. See www.asp.net for some examples of how to access the data.|||Is this a BLOB file that i can use a filestream object to import into a VB application? Sorry for my newbieness.

thanks

Mardi|||Yes, an IMAGE is a blob. Typically, it is at least an 8 kb blob in order to use the database space effectively, although it can be smaller.

-PatP

Image Data Type

In one of the table I have a column"XMLCompressed" with Image data type. I
don't know which type of file it is. I have tried with .xml, .svg, .jpeg etc
.
Is there any way to see what is stored inside that columnHi
Data is stored in binary format
best Regards,
Chandra
http://chanduas.blogspot.com/
http://groups.msn.com/SQLResource/
---
"Snehal" wrote:

> In one of the table I have a column"XMLCompressed" with Image data type. I
> don't know which type of file it is. I have tried with .xml, .svg, .jpeg e
tc.
> Is there any way to see what is stored inside that column|||I don't want data in binary format. It should be in some understandable form
at
"Chandra" wrote:
> Hi
> Data is stored in binary format
> --
> best Regards,
> Chandra
> http://chanduas.blogspot.com/
> http://groups.msn.com/SQLResource/
> ---
>
> "Snehal" wrote:
>|||To SQL Server, data stored with the image datatype is pure binary data. SQL
Server doesn't care what
you put in there, and SQL server doesn't know what format you have in there.
I.e., there's no help
for SQL Server to be expected to understand the format of the data. Consider
having another column
in the table where you specify which format you have for each row (assuming
you have different
formats for different rows).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Snehal" <Snehal@.discussions.microsoft.com> wrote in message
news:92F5954C-728E-4B8B-B45F-4F3FEEE93AE5@.microsoft.com...
>I don't want data in binary format. It should be in some understandable for
mat
> "Chandra" wrote:
>|||Yes I aggree. But what different formats it can have? I just want to see the
contents of image data column. As the name of the column "xmlCompressed"
suggest it may have XML doc in it.
"Tibor Karaszi" wrote:

> To SQL Server, data stored with the image datatype is pure binary data. SQ
L Server doesn't care what
> you put in there, and SQL server doesn't know what format you have in ther
e. I.e., there's no help
> for SQL Server to be expected to understand the format of the data. Consid
er having another column
> in the table where you specify which format you have for each row (assumin
g you have different
> formats for different rows).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Snehal" <Snehal@.discussions.microsoft.com> wrote in message
> news:92F5954C-728E-4B8B-B45F-4F3FEEE93AE5@.microsoft.com...
>
>|||Hi,
You can use image field in sql server as data type field , but I have
another approach to save your data and to be viewable by using ole control
from vb 6 (toolbox) or unbound-bound control in MSACCESS , and later you can
insert object and select as paintbrush object , so you can view this data by
screen or by report.
NB1 : Ole control dropped from VS 2005 (so be careful when you use this
approach)
NB2: Database will upsize quickly.
Thanks,
Tarek Ghazali
"Snehal" <Snehal@.discussions.microsoft.com> wrote in message
news:D92F9D18-088F-41C8-9B54-BBBADB65A10F@.microsoft.com...
> In one of the table I have a column"XMLCompressed" with Image data type. I
> don't know which type of file it is. I have tried with .xml, .svg, .jpeg
> etc.
> Is there any way to see what is stored inside that column|||I adjusted my title (Email from) instead of Microsoft news it's Tarek
Ghazali right now.
Hi,
You can use image field in sql server as data type field , but I have
another approach to save your data and to be viewable by using ole control
from vb 6 (toolbox) or unbound-bound control in MSACCESS , and later you can
insert object and select as paintbrush object , so you can view this data by
screen or by report.
NB1 : Ole control dropped from VS 2005 (so be careful when you use this
approach)
NB2: Database will upsize quickly.
Thanks,
Tarek Ghazali
"Snehal" <Snehal@.discussions.microsoft.com> wrote in message
news:D92F9D18-088F-41C8-9B54-BBBADB65A10F@.microsoft.com...
> In one of the table I have a column"XMLCompressed" with Image data type. I
> don't know which type of file it is. I have tried with .xml, .svg, .jpeg
> etc.
> Is there any way to see what is stored inside that column|||> But what different formats it can have?
The person to ask this is the one who designed the table. Nobody else will k
now (for sure). We can
guess:
XML then zipped
XML then compressed to other standard formats
XML then compressed with some own compression algorithm
XML stored in a compressed format, defined by a standard body
I'd start with the last one. I did a Google on XML compressed and found hits
. I'd check first if
there is an accepted standard for storing XML data in a compressed format.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Snehal" <Snehal@.discussions.microsoft.com> wrote in message
news:D92B416E-1BA3-4682-B822-2A726DAE4085@.microsoft.com...
> Yes I aggree. But what different formats it can have? I just want to see t
he
> contents of image data column. As the name of the column "xmlCompressed"
> suggest it may have XML doc in it.
> "Tibor Karaszi" wrote:
>|||Thanks.
It will realy help me to move ahead.
Will you please ellobarate how to proceed with the guesses? I am also trying
to break as the person who designed the table is not available for my compan
y
right now.
"Tibor Karaszi" wrote:

> The person to ask this is the one who designed the table. Nobody else will
know (for sure). We can
> guess:
> XML then zipped
> XML then compressed to other standard formats
> XML then compressed with some own compression algorithm
> XML stored in a compressed format, defined by a standard body
> I'd start with the last one. I did a Google on XML compressed and found hi
ts. I'd check first if
> there is an accepted standard for storing XML data in a compressed format.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Snehal" <Snehal@.discussions.microsoft.com> wrote in message
> news:D92B416E-1BA3-4682-B822-2A726DAE4085@.microsoft.com...
>
>

Image Data Type

How do I extract the text or readable data from a column
that is defined as an image data type?Is the READTEXT supposed to return Hex values?
select ImageData from afw_image where imageid = '1998-02-
11 12:49:30.283'
GO
DECLARE @.ptrval varbinary(16)
SELECT @.ptrval = TEXTPTR(ImageData)
FROM afw_image
WHERE imageid = '1998-02-11 12:49:30.283'
READTEXT afw_image.ImageData @.ptrval 1 25
GO
ImageData
---
---
---
---
--
0x204D41494C494E472041444452455353204348414E474520393630343
232204546464543544956452030342F31352F393620504C454153452020
20200D0A495353554520414E20454E444F5253454D454E5420574954482
05448452020464F4C4C4F57494E47204348414E4745533A202020504C45
41534520200D0A414D45
(1 row(s) affected)
ImageData
---
---
---
---
--
0x4D41494C494E472041444452455353204348414E4745203936
(1 row(s) affected)
>--Original Message--
>Dave,
>Refer READTEXT in BooksOnLine.
>--
>Dinesh.
>SQL Server FAQ at
>http://www.tkdinesh.com
>"Dave M" <dmunsterman@.appliedsystems.com> wrote in message
>news:8f5a01c35b6f$64f3e9b0$a001280a@.phx.gbl...
>> How do I extract the text or readable data from a column
>> that is defined as an image data type?
>
>.
>

Monday, March 19, 2012

Image Column Data and Backup

I have a table (SQL Server 2000) that stores icon files in an Image
field. I have no problem storing and retrieving the images on my system.
When I back up the database however the rows in that table do not seem
to get backed up. In other words when I restore the database on another
server there are no rows in that one table.
I have used the sp_tableoption to turn "in row text" on for the table
etc. Anyone have a clue what I might be doing wrong? This table will
eventually need to be recreated at a customer site with the data intact
and I was planning on just backing the database up and then restoring it.
Bob PorterA restored database will be exactly like the original, less uncommitted
transactions. A common cause of the problem you describe is that multiple
backups exist in the same backup file and the first (oldest) is restored by
default. You can list the backup file contents with RESTORE HEADERONLY:
RESTORE HEADERONLY
FROM DISK='C:\Backups\MyDatbase.bak'
You can then specify the desired backup with the FILE specification:
RESTORE DATABASE MyDatabase
FROM DISK='C:\Backups\MyDatbase.bak'
FILE=2
Hope this helps.
Dan Guzman
SQL Server MVP
"Robert Porter" <rhysliam@.noemail.nospam> wrote in message
news:ud2nToCbFHA.2128@.TK2MSFTNGP15.phx.gbl...
>I have a table (SQL Server 2000) that stores icon files in an Image field.
>I have no problem storing and retrieving the images on my system. When I
>back up the database however the rows in that table do not seem to get
>backed up. In other words when I restore the database on another server
>there are no rows in that one table.
> I have used the sp_tableoption to turn "in row text" on for the table etc.
> Anyone have a clue what I might be doing wrong? This table will eventually
> need to be recreated at a customer site with the data intact and I was
> planning on just backing the database up and then restoring it.
> Bob Porter|||Dan Guzman wrote:
> A restored database will be exactly like the original, less uncommitted
> transactions. A common cause of the problem you describe is that multiple
> backups exist in the same backup file and the first (oldest) is restored b
y
> default. You can list the backup file contents with RESTORE HEADERONLY:
> RESTORE HEADERONLY
> FROM DISK='C:\Backups\MyDatbase.bak'
> You can then specify the desired backup with the FILE specification:
> RESTORE DATABASE MyDatabase
> FROM DISK='C:\Backups\MyDatbase.bak'
> FILE=2
>
It did! Thanks, sorry for the newbie question I knew better... sigh...|||No problem. You're certainly not the first to run into this :-)
Hope this helps.
Dan Guzman
SQL Server MVP
"Robert Porter" <rhysliam@.noemail.nospam> wrote in message
news:%23J0MYlDbFHA.464@.TK2MSFTNGP15.phx.gbl...
> Dan Guzman wrote:
> It did! Thanks, sorry for the newbie question I knew better... sigh...

Image , text , ntext..

Is there any way I can comapre the new value of text, ntext and image with
the existing text, ntext and image column value. I have to do validation if
that text is not exist then it should inserted otherwise not..
Anyway I can do this validation?
Thanks in advance.
Hello,
You may check for NULL but cannot compare the values.
Example:
SELECT * FROM SomeTable WHERE TextColumn IS NULL
Hope that helps.
Amit Basu
"Rogers" wrote:

> Is there any way I can comapre the new value of text, ntext and image with
> the existing text, ntext and image column value. I have to do validation if
> that text is not exist then it should inserted otherwise not..
> Anyway I can do this validation?
> Thanks in advance.
>
>
|||Hello,
You may check for NULL but cannot compare the values.
Example:
SELECT * FROM SomeTable WHERE TextColumn IS NULL
Hope that helps.
Amit Basu
"Rogers" wrote:

> Is there any way I can comapre the new value of text, ntext and image with
> the existing text, ntext and image column value. I have to do validation if
> that text is not exist then it should inserted otherwise not..
> Anyway I can do this validation?
> Thanks in advance.
>
>
|||Hello,
You can check for existence of data only and not compare values like:
select * from SomeTable where TextColumn is null
Hope that helps.
Amit Basu
"Rogers" wrote:

> Is there any way I can comapre the new value of text, ntext and image with
> the existing text, ntext and image column value. I have to do validation if
> that text is not exist then it should inserted otherwise not..
> Anyway I can do this validation?
> Thanks in advance.
>
>

Image datatype

Hi,

I created a table with one column being that of an 'image' data type. The problem is I don't know how to insert an image into that column. Pleas Help.

Hello aniait,

Here is a step-by-step example of storing and retrieving image files in sqlserver 2005 express!

http://chiragrdarji.wordpress.com/2007/03/05/storing-and-retrieving-image-in-sql-server/

Hope this helps!

I'm retarded and need help with Derived Column or Script Task

I am moving data from an oracle database to sql server. Two of the source fields are dates, which sometimes contain values I know to be incorrect ('0001/01/01' and '1900/01/01').

I'd like to use either the derived column or script task (or any other appropriate one) to update these incorrect values (in both columns) to null before inserting into sql server, smalldatetime field.

In sql 2000 dts, I would simply use a VBScript IF statement, but I'm somewhat clueless when it comes to .Net.

Does anyone have any ideas or sample code that may help?

Thank you much.

In a derived column you could do a comparison expression such as:

[ORACLE_COL] == (DT_DBTIMESTAMP)"0001/01/01" || [ORACLE_COL] == (DT_DBTIMESTAMP)"1900/01/01" ? NULL(DT_DBTIMESTAMP) : [ORACLE_COL]

|||

That worked perfectly, thank you. However it also looks like it's slowing me down quite a bit. I'm moving a lot of data, 16 million records, from oracle to sql server. Moving this into a temp table without the derived column task only took 8 minutes. After adding the new task I can see it would take far longer.

Do you know of any good learning resources for SSIS besides Books on Line?

Thank you.

|||

www.sqlis.com is the recognised community site.

The guys that run it (Darren and Allan) are also running a new wiki site: http://wiki.sqlis.com/

-Jamie

|||I found that the WROX press book "SQL Server 2005 Integration Services",, ISBN 0-7645-8435-9 is a very good resource. I normally do not like using anything other than online resources either.

Monday, March 12, 2012

Ill try this again

The 'when run' column of the report manager website is blank. the reports
have been run. i can also look in the ExecutionLog table of the reporting
database and it is properly reflecting the dates and times that a report is
run. it is not as important that i can see the times and dates run there,
but they are also not displaying in sharepoint webpart. Im assuming for the
same reason.
Can some one help me understand why the times are not being displayed on the
website.
TIA
MattThis may be a bug. While you are waiting for a closure on this, consider
changing the GetAllReportProperties stored procedure to get the last
execution time from table ExecutionLog. In general, you should abstain from
making changes to the report catalog, but when there is a will, there is a
way...
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"Matt" <Matt@.matt.com> wrote in message
news:uowTZGU6FHA.2176@.TK2MSFTNGP14.phx.gbl...
> The 'when run' column of the report manager website is blank. the reports
> have been run. i can also look in the ExecutionLog table of the reporting
> database and it is properly reflecting the dates and times that a report
> is
> run. it is not as important that i can see the times and dates run there,
> but they are also not displaying in sharepoint webpart. Im assuming for
> the
> same reason.
> Can some one help me understand why the times are not being displayed on
> the
> website.
> TIA
> Matt
>

Friday, February 24, 2012

IIF Statement to Case but getting error

I tried converting the statement below, which is just one of many statements
in a view. This one poplulates one column in the view:
IF(DATEDIFF(dd, MAX(INVOICE_DA), GETDATE())<=30 AND
COUNT([CUSTOMER__])>=5,YES,NO)
to:
CASE WHEN DATEDIFF(dd, MAX(INVOICE_DA), GETDATE())<=30 AND
COUNT([CUSTOMER__])>=5 THEN 'YES' ELSE 'NO'
I'm getting an error that says the query designer does not support the CASE
sql construct. Any thoughts on how I can rewrite the IIF statement so that i
t
can work in a sql view? THANKS!!Mike,
Where are you creating the view?. Use Query analyzer.
AMB
"Mike C" wrote:

> I tried converting the statement below, which is just one of many statemen
ts
> in a view. This one poplulates one column in the view:
> IF(DATEDIFF(dd, MAX(INVOICE_DA), GETDATE())<=30 AND
> COUNT([CUSTOMER__])>=5,YES,NO)
> to:
> CASE WHEN DATEDIFF(dd, MAX(INVOICE_DA), GETDATE())<=30 AND
> COUNT([CUSTOMER__])>=5 THEN 'YES' ELSE 'NO'
> I'm getting an error that says the query designer does not support the CAS
E
> sql construct. Any thoughts on how I can rewrite the IIF statement so that
it
> can work in a sql view? THANKS!!|||Mike C a écrit :
> I tried converting the statement below, which is just one of many statemen
ts
> in a view. This one poplulates one column in the view:
> IF(DATEDIFF(dd, MAX(INVOICE_DA), GETDATE())<=30 AND
> COUNT([CUSTOMER__])>=5,YES,NO)
> to:
> CASE WHEN DATEDIFF(dd, MAX(INVOICE_DA), GETDATE())<=30 AND
> COUNT([CUSTOMER__])>=5 THEN 'YES' ELSE 'NO'
END missing in CAS structure :
CASE
WHEN DATEDIFF(dd, MAX(INVOICE_DA), GETDATE()) <=30
AND COUNT([CUSTOMER__]) >= 5 THEN 'YES'
ELSE 'NO'
END as YesNoCol

> I'm getting an error that says the query designer does not support the CAS
E
> sql construct. Any thoughts on how I can rewrite the IIF statement so that
it
> can work in a sql view? THANKS!!
A +
Frédéric BROUARD, MVP SQL Server, expert bases de données et langage SQL
Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com
Audit, conseil, expertise, formation, modélisation, tuning, optimisation
********************* http://www.datasapiens.com ***********************|||Alejandro,
Thank you. That worked. The problem I'm left with is how to run this report
automatically. I've been using DTS to export a view to an Excel sheet but it
looks like that won't work in this case. I guess I could try to put this in
an sp (which I haven't done much of and should probably start mastering) and
either DTS the sp result or I could just throw the results in a web-based
datagrid and export the datagrid to Excel on demand. Do you have any
recommendations on how to make the query results available to users? Thanks
again for the earlier suggestion.
MC
"Alejandro Mesa" wrote:
> Mike,
> Where are you creating the view?. Use Query analyzer.
>
> AMB
> "Mike C" wrote:
>|||I actually had END in the view but I forgot to type it into my question.
"SQLpro [MVP]" wrote:

> Mike C a écrit :
> END missing in CAS structure :
>
> CASE
> WHEN DATEDIFF(dd, MAX(INVOICE_DA), GETDATE()) <=30
> AND COUNT([CUSTOMER__]) >= 5 THEN 'YES'
> ELSE 'NO'
> END as YesNoCol
>
> A +
> --
> Frédéric BROUARD, MVP SQL Server, expert bases de données et langage SQ
L
> Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com
> Audit, conseil, expertise, formation, modélisation, tuning, optimisation
> ********************* http://www.datasapiens.com ***********************
>

IIF Statement

Below I'm trying to return the larger column. If the SUM of UnitsInStock is
greater than the SUM of UnitsOnOrder, then return SUM(UnitsInStock) AS
largerUnits and vice versa.
This is in northwind, can someone help me correct my syntax? I wasn't sure
how to do it with CASE.
CODE
SELECT IIf(SUM(UnitsInStock)>SUM(UnitsOnOrder), SUM(UnitsInStock) AS
largerUnits, SUM(UnitsOnOrder) AS largerUnits), ProductName
FROM Products
GROUP BY ProductNameTry this (untested):
SELECT case when SUM(UnitsInStock) > SUM(UnitsOnOrder)
then SUM(UnitsInStock)
else SUM(UnitsOnOrder)
end AS largerUnits
,ProductName
FROM Products
GROUP BY ProductName
ML
http://milambda.blogspot.com/|||On Fri, 23 Dec 2005 18:22:17 -0600, Scott wrote:

> Below I'm trying to return the larger column. If the SUM of UnitsInStock i
s
>greater than the SUM of UnitsOnOrder, then return SUM(UnitsInStock) AS
>largerUnits and vice versa.
>This is in northwind, can someone help me correct my syntax? I wasn't sure
>how to do it with CASE.
>CODE
>SELECT IIf(SUM(UnitsInStock)>SUM(UnitsOnOrder), SUM(UnitsInStock) AS
>largerUnits, SUM(UnitsOnOrder) AS largerUnits), ProductName
>FROM Products
>GROUP BY ProductName
>
SELECT CASE WHEN SUM(UnitsInStock) > SUM(UnitsOnOrder)
THEN SUM(UnitsInStock)
ELSE SUM(UnitsOnOrder) ) AS largerUnits),
ProductName
FROM Products
GROUP BY ProductName
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Forgive me for dipping my fly into your ointment, but your CASE expression i
s
missing its END. ;)
ML
http://milambda.blogspot.com/|||thanks.
"ML" <ML@.discussions.microsoft.com> wrote in message
news:63517235-3C00-4A10-9FD3-1963051A3411@.microsoft.com...
> Try this (untested):
> SELECT case when SUM(UnitsInStock) > SUM(UnitsOnOrder)
> then SUM(UnitsInStock)
> else SUM(UnitsOnOrder)
> end AS largerUnits
> ,ProductName
> FROM Products
> GROUP BY ProductName
>
> ML
> --
> http://milambda.blogspot.com/|||Just one thought - how will you ditinct between the two values in the client
application? After all, those are just numbers, but this query returns them
in a single column, although they originate in two different sources...?
Another CASE maybe?
SELECT case when SUM(UnitsInStock) > SUM(UnitsOnOrder)
then SUM(UnitsInStock)
else SUM(UnitsOnOrder)
end AS largerUnits
,case when SUM(UnitsInStock) > SUM(UnitsOnOrder)
then 'InStock'
else 'OnOrder'
end AS largerSource
,ProductName
FROM Products
GROUP BY ProductName
ML
http://milambda.blogspot.com/|||thanks, in my case, i just needed the larger of the 2.
"ML" <ML@.discussions.microsoft.com> wrote in message
news:3442E4F6-D752-4708-BB0A-A65416DE9755@.microsoft.com...
> Just one thought - how will you ditinct between the two values in the
> client
> application? After all, those are just numbers, but this query returns
> them
> in a single column, although they originate in two different sources...?
> Another CASE maybe?
> SELECT case when SUM(UnitsInStock) > SUM(UnitsOnOrder)
> then SUM(UnitsInStock)
> else SUM(UnitsOnOrder)
> end AS largerUnits
> ,case when SUM(UnitsInStock) > SUM(UnitsOnOrder)
> then 'InStock'
> else 'OnOrder'
> end AS largerSource
> ,ProductName
> FROM Products
> GROUP BY ProductName
>
> ML
> --
> http://milambda.blogspot.com/|||On Fri, 23 Dec 2005 17:05:02 -0800, ML wrote:

>Forgive me for dipping my fly into your ointment, but your CASE expression
is
>missing its END. ;)
Hi ML,
So it is. Thanks for the correction.
I really shouldn't write any more replies after 1 AM....
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||But then again - the level of inspiration is usually at its highest point at
1 AM.
ML
http://milambda.blogspot.com/|||For fun, I thought I would try a sql clr function to simulate IIF. Not
quite as elegant as the real IIF, but maybe more concise then a Case.
-- Usage example
declare @.n1 int
declare @.n2 int
set @.n1 = 1
set @.n2 = 2
select dbo.IIF(sum(@.n1), '>', sum(@.n2), 100, 200) -- Just to show using
sum(), does not make sense in this usage.
select dbo.IIF(@.n1, '>', @.n2, 'n1 is > n2', 'n1 is not > n2')
select dbo.IIF(@.n1, '<', @.n2, 'n1 is < n2', 'n1 is not < n2')
select dbo.IIF(@.n1, '>=', @.n2, 'n1 is >= n2', 'n1 is not >= n2');
select dbo.IIF(@.n1, '<=', @.n2, 'n1 is <= n2', 'n1 is not <= n2')
select dbo.IIF(@.n1, '==', @.n2, 'n1 is == n2', 'n1 is not == n2')
select dbo.IIF(@.n1, '!=', @.n2, 'n1 is != n2', 'n1 is not != n2')
select dbo.IIF(@.n1, '<>', @.n2, 'n1 is <> n2', 'n1 is not <> n2')
//
// The SQL Clr UDF IIF code.
//
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
public partial class UserDefinedFunctions
{
/// <summary>
/// Returns one of two objects, depending on the evaluation of an
expression.
/// </summary>
/// <param name="lside">The left side comparand.</param>
/// <param name="op">The conditional operator to use for
testing.</param>
/// <param name="rside">The right side comparand.</param>
/// <param name="truePart">Returned if Expression evaluates to
True.</param>
/// <param name="falsePart">Returned if Expression evaluates to
False.</param>
/// <returns>Returns one of two objects, depending on the evaluation of
an expression. </returns>
[Microsoft.SqlServer.Server.SqlFunction]
public static object IIF(object lside, string op, object rside, object
truePart, object falsePart)
{
if (lside == null || rside == null)
return falsePart;
if (lside is DBNull || rside is DBNull)
return falsePart;
if (op == null)
throw new ArgumentNullException("op");
IComparable cLeft = (IComparable)lside;
IComparable cRight = (IComparable)rside;
/*
CompareTo results:
Less than zero - This instance is less than obj.
Zero - This instance is equal to obj.
Greater than zero - This instance is greater than obj.
*/
switch (op)
{
case ">":
if (cLeft.CompareTo(cRight) > 0)
return truePart;
return falsePart;
case ">=":
if (cLeft.CompareTo(cRight) >=0)
return truePart;
return falsePart;
case "<":
if (cLeft.CompareTo(cRight) < 0)
return truePart;
return falsePart;
case "<=":
if (cLeft.CompareTo(cRight) <= 0)
return truePart;
return falsePart;
case "==":
if (cLeft.CompareTo(cRight) == 0)
return truePart;
return falsePart;
case "!=":
case "<>":
if (cLeft.CompareTo(cRight) == 0)
return falsePart;
return truePart;
default:
throw new ArgumentException("op");
}
}
};
William Stacey [MVP]
"Scott" <sbailey@.mileslumber.com> wrote in message
news:ua%230dECCGHA.216@.TK2MSFTNGP15.phx.gbl...
> Below I'm trying to return the larger column. If the SUM of UnitsInStock
> is greater than the SUM of UnitsOnOrder, then return SUM(UnitsInStock) AS
> largerUnits and vice versa.
> This is in northwind, can someone help me correct my syntax? I wasn't sure
> how to do it with CASE.
> CODE
> SELECT IIf(SUM(UnitsInStock)>SUM(UnitsOnOrder), SUM(UnitsInStock) AS
> largerUnits, SUM(UnitsOnOrder) AS largerUnits), ProductName
> FROM Products
> GROUP BY ProductName
>