Paging in JSP using SQL SERVER 2000

Hi!!
How to do paging in JSP using SQL SERVER 2000.
In my SQL we can fire query like
ResultSet resultado = declaracao.executeQuery("Select * from tbl_livro limit 20,5 ");
It means that it fetches 20 onwards 5 records..
how to do same thing in SQL SERVER 2000 please help it's pretty urgent

here is the link for paging, what i already post reg this topic
http://forum.java.sun.com/thread.jspa?threadID=5194183try to avoid multipost next time

Similar Messages

  • JSP w/ SQL Server 2000

    Hi,
    I have experience with J2SE but not so much J2EE, including JSP, so I would like some input from those who are better equipped to solve this problem. My employer purchased an SQL Server 2000 and asked me to build a solution to access the database. Instantly, the .NET platform comes to mind, but the company has invested quite a bit of money to build a J2EE infrastructure (which I don't exactly know what it means). I would like to know, first if it is possible to build a JSP/J2EE solution, and if so, what the advantages and disadvantages of building a JSP/J2EE solution. If I'm using any terms incorrectly, feel free to correct me, and I would appreciate any input.
    Thanks in advance!

    There really isn't a problem accessing MS/SQL from Java. Microsoft even provides a reasonable driver to allow you to run the Java on any platform and talk to the SQL server.
    I'm guessing that asking a J2EE vs. .net opinion in a Java forum will show bias and my answer should be taken in that light.
    One of the first things to understand is that there are levels of J2EE. The entire J2EE spec is gigantic. JSP's and Servlets are a fairly small part of that. With an application server such as Tomcat you can take advantage of some pretty powerful concepts like JSP's and Servlets without diving into some of the more complicated parts.
    The disadvantage to that is that you will need to plug some other object to relational mapping to talk to your database. For a small database this is pretty easy. When you get to have a large DB it can be a pain.
    Based on the way you've asked this I presume that you are in a Microsoft only shop. It may be that a .net solution would work. But if there is already some amount of J2EE based code it seems like it would be easier to continue down that path. From my perspective the huge advantage is that you're not limited to one platform. You're welcome to use MSFT O/S's but you don't have to.
    It sound like a disadvantage is your personal background. You sound tentative about it and are maybe more comfortable in the MSFT world. Java works very well under recent Microsoft O/S's and I feel that the quality of the development environments (IDE's) are pretty much up to par with Microsoft's. This may fall down a little when it comes to HTML builders but it is pretty close.
    Good luck!

  • Using SQL Server 2000 XA Driver

    first off, I am a newbie
    I installed Workshop 8.1, and setup a Domain to use by creating a Weblogic Domain
    and then extending it with a Workshop extension.
    I want to use it to connect to a SQL Server 2000 backend (I am imitating the Java
    Control tutorials without using the Tutorial part to see what problems I encounter).
    I want to used the 4xa driver, but none of them work, although if I try to use
    the non-xa driver it is fine.
    I remember reading the Workshop can only have one non-xa driver, and that it also
    must use the cgDatasource via pointbase.
    I would be very happy to use the s2k 4xa driver, but when I try it with an XA
    in weblogic I always get "no suitable driver found", regardless of whether it
    is weblogics, data-directs, j-net-directs, etc. This happens even if it is the
    only pool, so I know it is not connected to pointbase.
    I even ran the osql command to set my sql server up for stored procedure support.
    For now what I have done is switched the cgPool over to an xa driver, and have
    the sql as a non-xa (which works fine).
    Any ideas?
    thanks!
    m

    Matt,
    Then lesson learnt is a good. Always use the console to modify services on
    an existing domain.
    Cheers,
    Raj Alagumalai
    WebLogic Workshop Support
    "Matt" <[email protected]> wrote in message
    news:[email protected]...
    >
    >
    thanks for the suggestion!
    What I ended up doing was playing around and I determined what I think Iwas doing
    that was causing the problem. I was using the Weblogic ConfigurationWizard to
    change the JDBC pools and test them. When they did not work there Icancelled
    it out.
    I think what this did was change the pointbase location in thepointbase.ini in
    my server to go to the %bea_home%\common\eval\pointbase. Since theworkshop db
    was located in my server dir, and not that one, it was throwing an error.
    I got around it by copying back the old config.xml, making some changesthere
    and also to the pointbase.ini, and also launching the pointbase manuallyfrom
    my server dir when configuring it.
    So I have learned my lesson, use the console, not the configurationwizard, after
    initial setup. If I had the time I would try to recreate it so I could letBEA
    know, but I am just happy that it is working...
    thanks again for your help!
    m
    "Raj Alagumalai" <[email protected]> wrote:
    Matt,
    We did have some pointbase issues in v1, one workaround is to create
    a
    backup of the pointbase files, after an install, and then unzip them,
    if a
    crash occurs.
    Hope this helps.
    Thanks
    Raj Alagumalai
    WebLogic Workshop Support
    "Matt" <[email protected]> wrote in message
    news:[email protected]...
    thanks, I guess I assumed that because the type 4 driver worked, thetype
    4xa should,
    and have the files already included via the weblogic.jar. oops.
    I added the wlsqlserver.jar, wlutil.jar, and wl.base.jar to my
    classpath.
    Now
    it appears to work... yeah!
    Unfortunately I have encountered a problem that has happened to meat
    least three
    times. The "workshop" db in pointbase is gone. The only solution Iknow of
    at
    this point is to uninstall and reinstall. I can not laundh the
    piontbase
    console
    because it requires the db "workshop", or at least appears to - acatch-22.
    I also can't simply reinstall BEA over the top because it will notlet me,
    and
    I am not sure what part to uninstall, reinstall to get that db back,short
    of
    uninstalling/reinstalling the whole thing. Since this has happenedto me
    three
    times (I am a master at breaking things - I have also wiped out theconfig.xml
    through extending the domain a couple of times), I should probablystart
    experimenting
    since I suspect that I will unfortunately do this again.
    Thanks for your help, it appears that the classpath inclusion of thosefiles might
    have been exactly what was needed for the 4xa to work!
    m
    "Raj Alagumalai" <[email protected]> wrote:
    Hello Matt,
    A driver being listed in the connection pool drop down, doesn't
    necessarily
    mean that the driver is on the classpath.
    Can you try placing the driver jar in the server classpath ?
    The requirement of one non xa driver is due to the fact that JMS
    cannot
    work
    with an XA data source.
    Hope this helps.
    Regards,
    Raj Alagumalai
    WebLogic Workshop Support
    "Matt" <[email protected]> wrote in message
    news:[email protected]...
    first off, I am a newbie
    I installed Workshop 8.1, and setup a Domain to use by creating
    a
    Weblogic
    Domain
    and then extending it with a Workshop extension.
    I want to use it to connect to a SQL Server 2000 backend (I am
    imitating
    the Java
    Control tutorials without using the Tutorial part to see what
    problems
    I
    encounter).
    I want to used the 4xa driver, but none of them work, although if
    I
    try to
    use
    the non-xa driver it is fine.
    I remember reading the Workshop can only have one non-xa driver,
    and
    that
    it also
    must use the cgDatasource via pointbase.
    I would be very happy to use the s2k 4xa driver, but when I try
    it
    with an
    XA
    in weblogic I always get "no suitable driver found", regardless
    of
    whether
    it
    is weblogics, data-directs, j-net-directs, etc. This happens even
    if
    it is
    the
    only pool, so I know it is not connected to pointbase.
    I even ran the osql command to set my sql server up for stored
    procedure
    support.
    For now what I have done is switched the cgPool over to an xa
    driver,
    and
    have
    the sql as a non-xa (which works fine).
    Any ideas?
    thanks!
    m

  • Creating a connection pool using SQL Server 2000, Sun ONE Application Serve

    Has any one succesfully configured SQL Server 2000 to work with Sun ONE Application Server 7 on Windows 2000 server service pack 4? I am embarking on a new J2EE project and I need to configure it as soon as possible.
    The problem I am having is that, when I ping the data souce name, there is a connection error.
    I have set the data source name and other details as follows:
    Under JDBC, I have set the parameters for the connection pool as follows:
    Data Source Name:      com.microsoft.jdbc.sqlserver.SQLServerDriver
    Database Name:          jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=Test
    User:               test
    Password:          test
    In the JVM settings page, I have set the prefix class path as follows for the location of the Microsoft JDBC
    drivers that I downloaded as follows:
    c:\microsoft\drivers/lib/msbase.jar
    c:\microsoft\drivers/lib/msutil.jar
    c:\microsoft\drivers/lib/mssqlserver.jar
    Under JVM Options, there is a strange setting which I don't understand: perhaps this is the cause of the
    connction error?
    -Djdbc.drivers=com.pointbase.jdbc.jdbcUniversalDriver
    Please help????

    I'm in a similar boat...
    Trying to setup AS7 JDBC and followed the instructions on the link you provided and get the following exception. I kept the case the same, thinking 'setpassword" was incorrect, so I tried changing the property to "Password", but get the same exception but it points to "setPassword" instead.
    SEVERE: RAR5041:Cannot get jdbc connection
    com.sun.enterprise.repository.J2EEResourceException
    java.lang.NoSuchMethodException: setpassword
    at com.sun.enterprise.repository.JdbcConnectionPool.createDataSource(JdbcConnectionPool.java:243)
    at com.sun.enterprise.resource.JdbcUrlAllocator.createResource(JdbcUrlAllocator.java:80)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.createSteadyResources(IASNonSharedResourcePool.java:856)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.initPool(IASNonSharedResourcePool.java:416)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:625)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:520)
    at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:263)
    at com.sun.enterprise.resource.JdbcXAConnection.<init>(JdbcXAConnection.java:74)
    at com.sun.enterprise.resource.Jdbc10XaAllocator.createResource(Jdbc10XaAllocator.java:94)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.createSteadyResources(IASNonSharedResourcePool.java:856)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.initPool(IASNonSharedResourcePool.java:416)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource(IASNonSharedResourcePool.java:625)
    at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource(IASNonSharedResourcePool.java:520)
    at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:263)
    at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:170)
    at com.sun.enterprise.resource.JdbcDataSource.internalGetConnection(JdbcDataSource.java:241)
    at com.sun.enterprise.resource.JdbcDataSource.getConnection(JdbcDataSource.java:98)
    at com.rvi.database.jdbcConnection.getConnection(jdbcConnection.java:93)
    at com.webapp.database.ArticlesDAO.selectByYear(ArticlesDAO.java:102)
    at com.webapp.actions.ArticleAction.list(ArticleAction.java:96)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
    at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)

  • Can i use sql server 2000 instead of oracle9i or aoracle 10g

    presently i am working in oracle10g it work fine. for retiveing the data, know requirement is sql server 2000 so please guide can i do it if so how to configure, its very ergent for me,

    Hi;
    Yes you can run against any DB if you have latest JDBC driver installed.
    Please see this 2 thread which give you the idea.
    Re: Configuring XML Publisher for Standalone EnterpriseOne 8.12
    connection to sqlserver
    Again - You need to have latest SQLServer JDBC driver and placed/installed in right directory.
    HTH
    Shaun S

  • ERROR using SQL Server 2000, FOR UPDATE clause problem

    Hi All,
    Because our main target for RDBMS mostly SqlServer2000, I try to use ADF BC with one. I successfully run the BC with Tester, scrolling up and down, BUT when i try to make changes and do commit, I receive ERROR, I have tried both JDBC Driver from Microsoft and jTDS, both FAILS.
    I have set the 'Default Locking Mode ..' to 'optimistic'
    (default is 'pessimistic'), it doesn't help.
    Here is the error :
    With Microsoft JDBC Driver :
    (oracle.jbo.DMLException) JBO-26080: Error while selecting entity for Departments
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer] FOR UPDATE cannot be specified on a READ ONLY cursor.
    With jTDS JDBC Driver :
    (oracle.jbo.DMLException) JBO-26080: Error while selecting entity for Departments
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.
    Pls any body help...
    Thank you,
    Krist

    Krist,
    we added a new SQL Flavor 'SQLServer' in JDeveloper 10.1.2
    This was implemented to handle special SQL syntax of SQLServer, different from SQL92 (among others the FOR UPDATE problem you're facing).
    For new projects, you can select this flavor during their creation. For projects that were defined with Flavor SQL92, you can switch to SQLServer at runtime by setting the parameter jbo.SQLBuilder=SQLServer (in your Application Module configuration or as a java option -Djbo.SQLBuilder=...)
    Regards,
    Didier.

  • Paging in JSP using

    Hi!!
    How to do paging in JSP using SQL SERVER 2000.
    In my SQL we can fire query like
    ResultSet resultado = declaracao.executeQuery("Select * from tbl_livro limit 20,5 ");
    It means that it fetches 20 onwards 5 records..
    how to do same thing in SQL SERVER 2000 please help it's pretty urgent

    http://forum.java.sun.com/thread.jspa?threadID=5194183

  • How To Use Reporting Services On SQL Server 2000 ?

    Hi all .
    Today , I has a issue .
    Normal , if the customer use SQl Server 2005 , it is no proplem , so if use SQL Server 2000 ,  Now , I want to use Reporting services on SQL Server 2000 , but , I am searching  on Internet , so I know , if I want to use SQL 2000 reporting server , I must have license of SQL server 2000 .
    is Every body  idea for this issue  ? .
    Please help me .
    Thanks alot .

    Ok ,anyway thanks alot ,.

  • Regarding ReCreating Catalog in SQL Server 2005 which was existing in SQL Server 2000

    Hello
    I was using SQL SERVER 2000 ... In one table I've created FULL TEXT SEARCHING ( Full text catalog along with full text indexing)
    Now we had to install our db in SQL SERVER 2005 standard edition. But while taking script it gave me two lines like:
    if (select DATABASEPROPERTY(DB_NAME(), N'IsFullTextEnabled')) <> 1
    exec sp_fulltext_database N'enable'
    GO
    if not exists (select * from dbo.sysfulltextcatalogs where name = N'DEV_CAS_DiagnosisCatalog')
    exec sp_fulltext_catalog N'DEV_CAS_DiagnosisCatalog', N'create'
    GO
    so I used this in the new db creation script...
    But I couldn't get where it actually is in SQL SERVER 2005 standard edition.
    and also plz help how should we create if it doesn't exist...
    What could be the problem....
    Thanks In advance

    if (select DATABASEPROPERTY(DB_NAME(), N'IsFullTextEnabled')) <> 1
    exec sp_fulltext_database N'enable'
    GO
    if not exists (select * from dbo.sysfulltextcatalogs where name = N'DEV_CAS_DiagnosisCatalog')
    exec sp_fulltext_catalog N'DEV_CAS_DiagnosisCatalog', N'create'
    GO
    sp_fulltext_catalog [ @ftcat= ] 'fulltext_catalog_name' ,
    [ @action= ] 'action'
    [ , [ @path= ] 'root_directory' ]
    Full-text catalog and index data is stored in files created in a full-text catalog directory(not on SSMS). The full-text catalog directory is created as a sub-directory of the directory specified in
    @path or in the server default full-text catalog directory if
    @path is not specified. The name of the full-text catalog directory is built in a way that guarantees it will be unique on the server. Therefore, all full-text catalog directories on a server can share the same path.
    Refer the path column by running the below query. full text catalog file is created under the root directory by default if the path is not specified.
    select * from dbo.sysfulltextcatalogs where name = N'DEV_CAS_DiagnosisCatalog'
    Refer
    http://technet.microsoft.com/en-us/library/ms189520(v=sql.90).aspx
    Regards, RSingh

  • Can't registerOutParameter of cursor type in SQL Server 2000

    Hi, there,
    I'm using SQL Server 2000 and a type 4 JDBC driver for it from JRun 3.1. I wrote a stored procedure which has a Cursor (ResultSet) as an output parameter. But I used callStmt.registerOutParameter(1, java.sql.Types.OTHER);
    I got an exception:
    callable stmt class: allaire.jrun.db.jdbc.base.BaseCallableStatement
    java.sql.SQLException: [JRun][SQLServer JDBC Driver]The specified SQL type is not supported by this driver.
    I definitely want the cursor to be an output parameter in my SQL 2000 store procedure, rather than defining a store procedure without an output Cursor parameter and then use callStmt.getResultSet();
    Does any one knows a way to register an output parameter of type CURSOR in SQL Server 2000 JDBC?
    I know that with in Oracle JDBC driver, you can do this:
    callStmt.registerOutParameter(1, OracleTypes.CURSOR);
    ButI failed to find a equivalent in SQL Server 2000 JDBC driver.
    Thanks a lot.

    If you found any solution to this, would you please let me know too? It'll help a tonne.

  • Sql server 2000 connection error

    Hi everyone ,
    I am trying to connect Sql server 2000 using ODI and trying to pass the parameters.
    com.microsoft.jdbc.sqlserver.SQLServerDriver
    jdbc:microsoft:sqlserver://localhost:1433;SelectMethod=cursor;databaseName=Northwind;integratedSecurity=false
    username : sa
    password : *******
    error :
    connection failed
    com.sunopsis.sql.c: com.microsoft.jdbc.sqlserver.SQLServerDriver
    can some one help me to make it worked out especially enabling IPaddress in Sql server 2000. both for the Server and network utility have 1433 as the port for tcp/ip .
    Thanks

    Firstly, this message normally means that you do not have the JAR files for the driver in your classpath. The classpath is created dynamically at startup of the ODI process, so the jar needs to be in the drivers directory before you start.
    Second, even if you are using SQL Server 2000, the recommendation is to use the SQL Server 2005 driver, available from the Microsoft site (http://msdn.microsoft.com/en-us/data/aa937724.aspx). It is much more capable and reliable. Note that you will need to use a different Driver name, and the URL format is also slightly different.
    Driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
    URL: jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]]

  • SQL Server 2000 Enterprise Edition Compatability with Latest Operating Systems

    Hi Team,
    My client is using SQL Server 2000 Enterprise edition for the database in the Production.
    Now,We are planning to load that data from SQL 2000 to SQL 2012 and test the functionality.
    Can you please tell me on which operations systems the SQL Server 2000 is compatible to Install ?
    like Windows Server 2012/ 2012 R2/ Windows 7/ 8 etc.
    Thanks
    Srikrishna

    Installing SQL Server 2000 on Windows 2008 or later is not supported, but your question is about compatibility rather than support.  SQL Server 2000 may work with the database engine but not with some other features and you'll probably need
    to click through warnings installation. Proceed at your own risk if you want to go down that path.
    I suggest you install on Windows 2003 for your migration testing to avoid obstacles.  Not that support ends for Windows Server 2003 in a few months.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • SQL Server 2000-2005/2008 Upgrade

    I was wondering if there was anyone out there who had been using SQL Server 2000, and upgraded it to SQL 2005/2008 during a tools upgrade? We are currently on tools 8.44 and performance is bogging down at times on SQL 2000. Curious to see if and what your experiences were? Also has anyone had any success data archiving with tools 8.44?
    Appreciate replies

    Hi,
    I have successfully done an upgrade from tools 8.44 to 8.49 (also sql server 2000 to 2005 sp3) in 2009
    The performance was way better in 2005, also managing the database :).. also you wont hav to face the dreadful deadlock problem in 2005
    I should say that this activity was part of an application+tools upgrade

  • SQL SERVER 2000 RESTORE STATUS

    Hi
    Is there any query to find the restore percentage on the Database?
    thanks in advance.
    Regards, Pradyothana DP http://www.dbainhouse.blogspot.in/

    If you are still using SQL Server 2000, then you need to quickly check on migrating to later version. Microsoft will no longer be supporting SQL Server 2000.
    Hello,
    I agree with Latheesh's opinion. I strongly recommend you consider upgrading SQL Server 2000 to higher version. Here are some articles for your reference, please see:
    Migration SQL Server 2000 to SQL Server 2012:
    http://blogs.technet.com/b/mdegre/archive/2012/06/15/migration-sql-server-2000-to-sql-server-2012.aspx
    SQL Server Upgrade Advisor: Considerations when upgrading from SQL 2000 to SQL 2012:
    http://blogs.msdn.com/b/mspfe/archive/2012/12/06/sql-server-upgrade-advisor-considerations-when-upgrading-from-sql-2000-to-sql-2012.aspx
    Regards,
    Elvis Long
    TechNet Community Support

  • How can I export image column from SQL Server 2000

    Hi everybody,could someone tell me how can I export an entire column( pictures type) to a folder on disk?I've tried the textcopy.exe under the SQL installation's binn folder,it can only export one picture a time,I'm trying to find an automated way to export
    the whole colum's images to a folder,I'm using SQL Server 2000.

    Vishal,thanks for the replay,I've tried the BCP method but it seems does not work on my Sql Server 2000,also the SSIS package method is demonstrated with Sql Server 2008 R2 and my machine does not have the visual application to try it.In the BCP method,I
    got prompt  indicating me that I wrote something wrong in the grammer,and I'm pretty sure that maybe I made something wrong in the below part,the grammer makes me confused
    INSERT
    INTO @sqlStatements
    SELECT 'BCP "SELECT Photograph_Data FROM [ALBSCH_Trial].[dbo].[Photograph] WHERE Photograph_ID = '''
    + CAST(Photograph_ID AS VARCHAR(500)) + '''" queryout ' + @OutputFilePath
    + CAST(Photograph_ID AS VARCHAR(500)) + '.jpg -S localhost\SQLEXPRESS2008 -T -f C:\SQLTest\Images.fmt'
    FROM dbo.Photograph

Maybe you are looking for