SQL Server 2000 database GETDATE() default for field

I have a SQL Server 2000 database where the createDate field
has a default value of GETDATE() and the data type is datetime. It
is inserting the date just fine, but I do not want to capture the
time along with the date. I only want the date to be entered. How
can I accomplish this? Thanks!

IF you only wanted to store the date, then yes you would use
that as the column default value.
createDate datetime default convert(datetime,
convert(varchar, getDate(), 102), 102)
However, as paross1 cautioned be sure you understand you will
only be capturing the date from now on. If you change your mind
later, and decide you need both the created date and time, you will
be seriously out of luck. A safer choice might be to keep the date
and time, and use convert in your queries instead.

Similar Messages

  • Tell me how to format a date retrieved from a MS SQL Server 2000 database?

    Tell me how to format a date retrieved from an MS SQL Server 2000 database for various uses in my JSP page?

    Or if you want to use JSTL instead of a scriptlet see:
    http://forum.java.sun.com/thread.jspa?threadID=676754&tstart=0

  • Manipulate data of a SQL SERVER 2000 database

    Problem:
    I need to manipulate data of a SQL SERVER 2000 database that it’s installed in a Windows
    from an oracle 8.1.7 database that is installed in a red hat linux server.
    This access has to be made in a procedure created in this Oracle instance.
    The Solution’s Environment:
    - oracle 8.1.7 database - red hat linux server - ORCL INSTANCE
    - SQL SERVER 2000 version 5.0 database - Windows server - SQLSERV INSTANCE
    - Oracle 8.1.7 database - windows 2000 professional server - HSDB INSTANCE
    We did the following steps:
    1) We installed an oracle database 8.1.7 in the windows 2000 professional.
    The name of this instance is HSDB.
    2) We configured the HSODBC resource in this HSDB instance so as to access the SQLSERVER database.
    3) It was created a database link in the ORCL instance (LINUX) so as to access the oracle HSDB instance
    4) It was created a procedure in the ORCL instance that insert data into the SQLSERVER database using the database link.
    This procedure pass through the following instances:
    ORCL Instance (database link) => HSDB Instance (HS Resource) => SQLSERV Instance
    5) When I execute this simple procedure of the ORCL Instance, the process takes a long time. Although if I run this insert on a SQL Plus, the transaction ends fast. Why it’s happening?
    PROCEDURE PRC_TESTE(P_CD_CMC7 IN VARCHAR2) IS
    BEGIN
    BEGIN
    INSERT INTO VSolicitacaoRetirada@MSSQLDB
    ("CMC7")
    VALUES
    (P_CD_CMC7);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR '||SQLERRM);
    END;
    COMMIT;
    END;
    Tranks

    I modified the PRC_TESTE procedure and worked fine when I made the following change.
    In spite of using the P_CD_CMC7 parameter on the INSERT command, I included a fixed value. Althoug I can´t use this fixed value. What it can be?
    Example:
    CREATE OR REPLACE PROCEDURE PRC_TESTE(P_CD_CMC7 IN VARCHAR2)
    IS
    BEGIN
    BEGIN
    INSERT INTO VSolicitacaoRetirada@MSSQLDB
    ("CMC7")
    VALUES
    ('123456');
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERRO NO INSERT '||SQLERRM);
    END;
    COMMIT;
    END;
    ------------------------------------------------------------

  • Problem converting captured SQL Server 2000 database to Oracle

    Java(TM) Platform     1.6.0_17
    Oracle IDE     2.1.1.64.45
    Versioning Support     2.1.1.64.45
    After creating MWREP user, granting it privileges and creating the migration repository, I have captured a small SQL Server 2000 database (1 table), but after performing "Convert to Oracle", I get the message that it has transformed correctly, but no converted model is shown. I was originally using the JRE supplied with SQL Developer 2.1.1, but replaced that with 1.6 U17 after researching the problem here.
    The only message in the Migration Log is as follows:
    Catalog RAC, Schema dbo coalesced to single schema dbo_RAC
    The following message appears in the console:
    SELECT DISTINCT(REF_ID_FK), REF_TYPE FROM MD_ADDITIONAL_PROPERTIES WHERE PROP_KEY IN (?) AND CONNECTION_ID_FK = ?
    I have tried this with a more complex database, with no luck.
    Any thoughts?

    I did an offline capture.
    I used Tools->Migration->Third Party Database Offline Capture->Create Database Capture Scripts to generate scripts OMWB_OFFLINE_CAPTURE.BAT, SS2K_BCP_SCRIPT.BAT and sqlserver2000.ocp. Then the SQL Server DBA ran OMWB_OFFLINE_CAPTURE.BAT and sent me the output.
    I used Tools->Migration->Third Party Database Offline Capture->Load Database Capture Scripts Output to capture the model into the repository successfully.

  • How can i connect to a SQL Server 2000 database usgin JSP?

    I need (URGENT) to connect to SQL Server 2000 databse using JSP. I do not know how to program using JSP, so if anyone has any code snippet please let me see it. What i need is to give my site some login/password security.
    Anyone?
    Thx.

    just create an ODBC of your database from control pannel -> administrative tools -> data sources (ODBC) ,double click it .....
    go to the tab SYstem DSN , click on ADD button. select the driver for your connection. it will be the last one in the list "SQL Server".
    click Next then give ur DSN name there, description and Server Name , on next give your username and password of SQL server. when it will be connected to the server celect your database from there and hence there will be an ODBC bridge same as in case of MS Access.
    code for connecting to ODBC is
    // DSN-NAME same as in System DSN.
    // username and password are of your databse
    try
              url = "jdbc:odbc:DSN-NAME";
              Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
              connect = DriverManager.getConnection( url,"username","password" );
              catch ( ClassNotFoundException cnfex ) {
                        setErrorMsg( cnfex.getMessage() );
              catch ( SQLException sqlex ) {
                        setErrorMsg( sqlex.getMessage() );
              catch ( Exception ex ) {
                        setErrorMsg( ex.getMessage() );
    Now you are connected to the SQL Server ..... use connect object for further processing .........

  • Connecting to an SQL Server 2000 Database

    Hi!
    I am trying to make a connection to a database created from SQL Server 2000. However, I don't know how to do it. Can anyone please help? How would the Java code different from the code we use to connect to a database created from MS Access?
    jt

    Hi Hartmut,
    I have a program which inserts a date into a table.
    I use a dsn configured to a database (as you've
    suggested). In my case, it's MS Access:
    private boolean writeToMSAccess(Hashtable ht) {
        // Build sql statement;
        // we use of # around the date, for MS Access.
        String sql =
            "INSERT INTO Broadcast (Author, BroadcastTime, Title, Length, BroadcastGroup,Link) " +
            "VALUES ('" + (String)ht.get("author") + "', " +
            "#" + date + "#, " +
            .... + "')";
            // Connect to the database, execute the sql.
            // dsn is passed into the program
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String url = "jdbc:odbc:" + dsn;
            Connection conn = DriverManager.getConnection(url, login, password);
            Statement  stmt = conn.createStatement();
            stmt.executeUpdate(sql);
            stmt.close();
            conn.close();
            return true;
        }Now if I point my DSN to SQL Server for example,
    it won't work b/c of the # marks. I'd have to change:
        String sql =
            "INSERT INTO Broadcast (Author, BroadcastTime, Title, Length, BroadcastGroup,Link) " +
            "VALUES ('" + (String)ht.get("author") + "', " +
            "#" + date + "#, " +
            .... + "')";to:
        String sql =
            "INSERT INTO Broadcast (Author, BroadcastTime, Title, Length, BroadcastGroup,Link) " +
            "VALUES ('" + (String)ht.get("author") + "', " +
            "'" + date + "', " +
            .... + "')";My question is, is there a way to detect which database
    my dsn points to, so that I can determine at run-time
    whether or not to use the # marks?
    Or is there another way around this problem?
    Any help is greatly appreciated!
    -alex

  • Which is the best way to migrate the SQL SERVER 2000 Database to SQL SERVER 2003 Database?

    Hi,
        I  need to migrate the Production database sql server 2000 to Sql server 2003, Please give me the best idea to migrate the database without any loss data, credentials and  Objects. 
    Nandha Kumar

    SQL server does not have any version named SQL server 2003 please check the version correctly it should be either SQL 2005,2008,2008 R2,2012
    You can use the backup/restore to upgrade the SQL 2000 database to till SQL 2005,2008,2008R2
    For SQL Server 2000 to 2012
    First upgrade from SQL 2000 database to either SQL 2005, 2008 or 2008R2 and than upgrade it to SQL 2012.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/eaa1eb44-729f-466b-8233-cb768fbb4208/upgrading-to-sql-server-2008-from-sql-server-2000?forum=sqlsetupandupgrade
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/4fac7511-2c75-46a0-802b-807dd26b12bf/sql-2012-will-not-convert-a-sql-2000-database?forum=sqlservermigration
    And after migration to SQL 2005 or 2008, if you want to script the database than can generate scripts pick DB and check off "script all objects in the selected database".
    http://blog.sqlauthority.com/2011/05/07/sql-server-2008-2008-r2-create-script-to-copy-database-schema-and-all-the-objects-data-schema-stored-procedure-functions-triggers-tables-views-constraints-and-all-other-database-objects/
    You can upgrade from SQL Server 2005, SQL Server 2008, and SQL Server 2008 R2 to SQL Server 2012.
    http://msdn.microsoft.com/en-us/library/ms143393(v=sql.110).aspx
    Please click the Mark as answer button and vote as helpful if this reply solves your problem

  • Tomcat - SQL Server 2000 Database connectivity - Need Help

    Hi
    I am new to java and Apache Tomcat, can anyone help me how to connect SQLServer 2000 Database. thru .jsp, in my pc I have installed XP Prof. with SP2, SQL Server 2000 Developer Ed. with SP4, Apache Server 2.2 Tomact 5.5., Microsoft SQL Server 2000 Driver for JDBC. Please help me out.. I want to know all settings for SQL connectivity & sample code.
    Thanks in advance.
    Bharat Gajjar

    So why don't you search for the documentation? Tomcat is one of the few apache java projects that is actually decently documented.
    http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
    That should be all you need to get up and running. For the correct JDBC settings, the microsoft website has an article, as do many other websites.
    http://msdn2.microsoft.com/en-us/library/ms378672.aspx

  • Error migrating SQL Server 2000 database to Oracle.

    Hi,
    I am new in SQL Developer.
    I read most of the help manuals available on the net.
    I am able to create connections to both SQL Server and Oracle database.
    I am also able to create the migration repository on the Oracle database.
    SQL server connection - TestSQL
    Oracle database connection - TestOracle
    Migration Repository - Migration_Repository.
    Here is the problem am facing:
    When I start Migrate to Oracle wizard, by right clicking the TestSQL database, I followed all the required steps and enter the necessary information. -
    It starts creating the project - say, TEST but after that it gave the following error:
    Migration actions have failed. Check the migration report for more details. : ORA-01400: cannot insert null into ("MIGRATIONS"."MD_PROJECT_ID").
    Please help.

    Thanks for your reply.
    You are correct, there were some permission missing on the migration repository user.
    I have given permissions and it worked fine.
    but I can say that required permission mentioned in other posts and blogs on the Internet are not sufficient.
    One has to provide more admin priviligies to this user.

  • Sql server 2000 type4 driver for jdbc connection error

    hello,
    I am trying to connect m ms sql server 2000 database server with type 4 driver.But I am getting an connection error like *"Error Establishing Socket"* .Can any one please help me out?

    Well i personally prefer usage of open source MS SQL SERVER 2k jdbc driver called jtds instead of the driver provided by MS themselves(which is proproteriry) as i had similar problem which i personally encountered when i was using it.
    go through the below link for further info.
    http://jtds.sourceforge.net/
    REGARDS,
    RaHuL

  • Using MS SQL Server 2000 for WLCS 3.50 DB

    I'm using WebLogic 6.0sp1 with Commerce Server 3.5 and I've successfully
    installed the demo. I would like to create another commerce server
    installation, this time using Microsoft SQL Server 2000 as the database
    instead of Cloudscape. I've downloaded and installed the BEA jDriver
    for MS SQL 7/2000 and tested it using dbping. My question is: where are
    the db scripts for creating and populating the commerce database? I've
    found the WLCS_320_DB_DDL_1.1.zip file on the BEA downloads site, but
    I'm concerned that this schema is for Version 3.20 of Commerce Server.
    Is there a similar file for WLCS 3.50? If not, is it safe to use this
    one?
    If this is posted in the wrong place, please let me know and I'll repost
    to the appropriate newsgroup as required.
    Sincerely,
    Michael Schulz

    Hi Michael,
    At this time SQL Server 2000 is not certified for WLCS 3.5. Since the
    schema has changed between 3.2 and 3.5, running the 3.2 scripts is not a
    good idea.
    I can tell you that certification is in progress for SQL Server 2000. Your
    best bet is to contact your Sales Representative to get an idea of when
    certification might be coming.
    I hope this helps.
    - Ginny
    "Michael Schulz" <[email protected]> wrote in message
    news:[email protected]..
    I'm using WebLogic 6.0sp1 with Commerce Server 3.5 and I've successfully
    installed the demo. I would like to create another commerce server
    installation, this time using Microsoft SQL Server 2000 as the database
    instead of Cloudscape. I've downloaded and installed the BEA jDriver
    for MS SQL 7/2000 and tested it using dbping. My question is: where are
    the db scripts for creating and populating the commerce database? I've
    found the WLCS_320_DB_DDL_1.1.zip file on the BEA downloads site, but
    I'm concerned that this schema is for Version 3.20 of Commerce Server.
    Is there a similar file for WLCS 3.50? If not, is it safe to use this
    one?
    If this is posted in the wrong place, please let me know and I'll repost
    to the appropriate newsgroup as required.
    Sincerely,
    Michael Schulz

  • Where to download the SQL Server 2000 plug-in for Migration Workbench

    Dear All,
    I am new to Migration WorkBench, I want to migrate the SQL Server 2000 database to Oracle 9i. When i start the Migration WorkBench, it requires me to select the plug-in (SQL Server) for the migration source. Before i have download and install the Access plug-in for testing. Can anybody tell me where i can find the SQL Server 2000 Plug-in for migration workbench.
    thx.
    Alan,

    here on OTN; on the same page like all the other plugins:
    http://otn.oracle.com/software/tech/migration/workbench/htdocs/utilsoft.html

  • Creating Database link from Oracle9i to SQL server 2000

    Pls how do I create connectivity from Oracle9i database to query a table in an SQL server 2000 database.
    Pls I need the necessary steps to take.
    Thanx

    There are 2 solutions that you can use:
    1) Transparent Gateway for SQL Server
    2) Generic Connectivity
    Generic Connectivity is free with the database but has less features than the Gateway. For Generic Connectivity you will need to obtain an ODBC driver.
    The steps for using the gateway are available in the gateway manual and the steps for using Generic Connectivity is available in Chap 7 of the Heterogeneous Connectivity Administrator's Guide.

  • Can I pass an array as an input parameter for a stored procedure on SQL Server 2000

    I am trying to pass an array to a stored procedure residing on my SQL Server 2000 database server. Is this even possible? If it is possible, what is the syntax for this?
    Any help would be greatly appreciated.
    Thanks

    I have passed arrays to and from a database using SQL and ActiveX, including to and from stored procedures, but I cannot recall the precise method used to do so. If memory serves, everything is in the form of a string. You need to do a lot of parsing and 'unparsing' to get this data into your stored procedure.
    You are left with a couple of options to get your data to the stored procedure. I recommend using SQL in LabVIEW wherever possible as it saves the amount of external code calls (and believe me, calling ActiveX procedures developed by someone else in Visual Basic is NOT much fun at all...). You can either send the array and other data to the stored procedure (you will find the syntax in the SQL references in LabVIEW help under SQL), or you can send
    the array to the database, and have the database then act upon the array.
    I strongly recommend making routines (subVIs) to handle these operations.
    Sorry I don't have the syntax, I don't have SQL installed on this machine. If you can't find the syntax in the help, please post here again.
    -Mike Du'Lyea

  • JDBC Connection String for MS Sql Server 2000 with Instance Name

    Hi All,
    I am having problems connecting to a MS Sql Server 2000 database using MSSqlServer4
    driver when the database server has an Instance Name. If the database server has
    no instance name then I am able to connect using the connection string
    connection=jdbc:weblogic:mssqlserver4:hansa:1433
    But when I have the MS Sql Server DB with an instance name such as "TestInstance",
    then I am unable to connect with any of the connection strings given below
    connection=jdbc:weblogic:mssqlserver4:hansa\TestInstance:1433 or
    connection=jdbc:weblogic:mssqlserver4:hansa\\TestInstance:1433 or
    connection=jdbc:weblogic:mssqlserver4:hansa:TestInstance:1433 or
    connection=jdbc:weblogic:mssqlserver4:hansa:1433:TestInstance
    Can anybody help me in resolving this issue. Appreciate your help.
    Thanks in advance.
    Vikram

    Vikram wrote:
    Hi All,
    I am having problems connecting to a MS Sql Server 2000 database using MSSqlServer4
    driver when the database server has an Instance Name. If the database server has
    no instance name then I am able to connect using the connection string
    connection=jdbc:weblogic:mssqlserver4:hansa:1433
    But when I have the MS Sql Server DB with an instance name such as "TestInstance",
    then I am unable to connect with any of the connection strings given below
    connection=jdbc:weblogic:mssqlserver4:hansa\TestInstance:1433 or
    connection=jdbc:weblogic:mssqlserver4:hansa\\TestInstance:1433 or
    connection=jdbc:weblogic:mssqlserver4:hansa:TestInstance:1433 or
    connection=jdbc:weblogic:mssqlserver4:hansa:1433:TestInstance
    Can anybody help me in resolving this issue. Appreciate your help.Hi. No type-4 jdbc driver is going to be able to use a name for a DBMS instance.
    Let's assume you have two DBMS instances running on the machine hansa. One
    of them may be listening for tcp connections on port 1433, but the other must not.
    The other most be listening on some other port number you have chosen.
    Therefore, to choose which DBMS instance you want to connect to, use the
    working URL you have, and switch the port number as desired.
    Joe Weinstein
    >
    >
    Thanks in advance.
    Vikram

Maybe you are looking for

  • Brand new iPod Touch, won't charge!

    Hi there, Have posted this under another topic but hope to get some more exposure here. Just as a disclaimer, I work for a retail store in New Zealand. Have taken a returned iPod touch home to try and fix, but am stuck! This iPod still belongs to my

  • Crystal Report 2008 File Open limit

    In Crystal Reports 2008 when selecting File > Open > Enterprise  The number of files listed in each directory looks to be limited to around 25 files. If I have a directory with more then that number of files, I have to move the file to another folder

  • Ipod Screen in Dim

    My ipod's screen is dark even when the battery is fully charged. I can hardly read the screen which makes it pretty hard to use when working out which is when I use it the most. I have checked the settings on the Ipod many times and I have the Bright

  • Best external drive for F900 footage via BM Multibridge Pro.

    Hey guys, I am going to be embarking on another feature in the coming moth that was again shot on hdcam Sony f900 tapes at 1080 23.97. This is again however a low budget show and thus i need some advise. I am currently traveling frequently and was ho

  • [SOLVED] Openjdk installed, but no plugin for Firefox

    Hello, I installed openjdk using: pacman -S openjdk6 but I don't see any plugin installed in /usr/lib/mozilla/plugin. [root@univers ~]# ls -l /usr/lib/mozilla/plugins/ total 10360 -rwxr-xr-x 1 root root 10606256 21 fév 22:00 libflashplayer.so Also, t