Is there an easier way to insert date into an MS SQL Server database ?

Is there an easier way to insert date into an MS SQL Server database without using the DateFormat?

USe a PreparedStatement and then the method setDate (or setTimestamp )
http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html

Similar Messages

  • Inserting Data from Oracle to SQL Server on the Real Time Basis.

    Hi Everyone,
    I need to insert data from Oracle to SQL Server on the Real Time basis, we have to fetch data from oracle approx 20 tables, and each table has more than 30 Fields. I need to fetch data in every 15 mins.
    I have created a job using SQL SERVER Agent by writing insert queries for all the tables with conditions that no rows will be inserted which is already in SQL. note that this job is taking only 1 min to execute.
    But in this way our SQL Server getting hanged and it giving problems to other application running in the SQL SERVER.
    So i m requesting all of you that what is the best way to insert huge amount of data on the real time basis.
    Thanx in Advance.

    1) Create Linked server 
    2) insert data using openquery  and set job in sql agent
    3) run job after 15 minutes

  • How to insert data from access to sql server ?

    How to insert data from access to sql server ?
    Please help me
    thanks

    phamtrungkien wrote:
    How to insert data from access to sql server by JAVA?The first four words of my last post:
    masijade wrote:
    JDBC with two connectionsGet a resultset from the jdbc-odbc bridge access connection, cycle through it and add batch insert commands to the jdbc connection to sql server. Give it a try and if the code has an error, then post your code ans ask a question.
    The real question, though, is why you think it absolutely necessary to use Java for this.

  • Insert data into fact table from source database tables

    here i try to insert data into fact table from source database tables here is the query 
    ALTER procedure [dbo].[facttable]
    as
    insert into [pp dw].dbo.Dimfact(Prod_ID,Production_ID,Material_ID,Equip_ID,WC_ID,Recipe_ID,Quantity,costprice)
    select Products.[Product ID],[Production ID],Materials.[Material ID],[Equipment ID],[Work Centre ID],[Recipy ID],Quantity,[cost price]
    from
    [PRODUCTION PLANNING 2].dbo.[Products],
    [PRODUCTION PLANNING 2].dbo.[Production Detail],
    [PRODUCTION PLANNING 2].dbo.[Material category],
    [PRODUCTION PLANNING 2].dbo.[Materials],
    [PRODUCTION PLANNING 2].dbo.[Equipment],
    [PRODUCTION PLANNING 2].dbo.[Working Centre] ,
    [PRODUCTION PLANNING 2].dbo.[Recipies]
    where
    Products.[Product ID] in (13, 14, 15, 16, 17) and
    [Production Detail].[Production ID] in (1, 2, 3) and
    [Materials].[Material ID] in (1, 2, 3, 4, 5) and
    [Equipment].[Equipment ID] in (1, 2, 3, 4) and
    [Working Centre].[Work Centre ID] in (1, 2, 3) and
    [Recipies].[Recipy ID] in (1, 2, 3) and
    [Material category].[Category ID] in (8, 9, 10, 11, 12, 13)
    and when i execute query it shows me error 
    The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Dimfact_Dimproduct". The conflict occurred in database "pp dw", table "dbo.Dimproduct", column 'Prod_ID'.
    ERD IS
    HOW TO SOLVE THIS PROBLEM?

    I cant see any join conditions in your query posted. Whats the purpose of the query above. It will just bring you a cartesian product (cross join) of tables involved subjected to filters. Are you sure this is the correct query?
    The error you're getting may be because you've not yet populated DimProduct or may be because of logic you used in popultaing DimProduct causing it to miss some records which is what query is referring to in above case.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Can not extract data into BW from SQL SERVER

    Dear All,
      I meet a problem to extract data from database(MS SQL Server 2000(sp3)) into BW now and can not extract data into BW ODS, even PSA, In the monitor, display yellow light(0 from 0 record), detail message just display message "data request arranged" "confirmed with: confirmation" in requests(message) step; "missing message: request received" in extract (message)  step; "no data" in processing(data packet) step and so on. but in fact, there are two records in my database test table and DB connection is OK. Even I can extract data from another test oracle database into BW ODS successfully.
       Our BW system has two BW applicaton server and use oracle database. the one application server locates on IBM AIX host. the another one locates on one NT server. the application server on NT server is used for data extration from MS SQL SERVER  database into BW oracle database. and MS SQL SERVER and NT platform application server locate on same one host. DBSL was installed on the NT application server already. and DB connector also was created successfully for MS SQL SERVER and datasource also was generated. DBSL type is Kernel640-WIN-IA32bit-unicode. my BW system is ECC5.0/UNICODE/ORACLE. all table/view/field name of MS SQL server is upcase and have not any specific character. for example: ZDEMO etc.
    wait your help.
    Thanks in advance.
    Billy

    Hi  Ravi,
    Could you help me to get knowledge about the followings:
    approximately how many records    extracting and transfering  from SAP R/3 to BIW  in an organisation. for that how much time  will take .
    How to extract data from  two are three source system  to BIW. Kindly help me with step by step explanation .If any screen shots with documents pls fwd to my ID. "[email protected]"
    Your help highly appreciated.
    Thanks.
    Hema

  • Is there a way to Insert Data into a Lookup Column Type on a SharePoint List Destination in SSIS?

    Greetings.
    I have successfully worked out inserting SQL data (2008 R2) into my 2010 SharePoint list (New, Update, Delete) by creating an SSIS Data Flow Task as outlined here:
    http://fsugeiger.blogspot.com/2010/01/synchronise-sql-table-with-sharepoint.html
    However, the problem I am running into is inserting data into the SharePoint Columns that are "Lookup" column types. I verified that all of the values I am copying from SQL into the SharePoint lookup column exist in the customn list it is pointing to. It
    is important to have this column be a lookup column as it links to another custom list that has many more columns of related information.
    I have read and re-read the SharePoint SSIS Adapters 2011.docx from
    http://sqlsrvintegrationsrv.codeplex.com/ and the only section that seems to apply is this:
    "Looking Up Values in a SharePoint List
    If you have to look up a value in a SharePoint list, you can use the Lookup transformation in your data flow, and use the SharePoint List source to load the lookup table. You may have to add a Derived Column transformation or a Script component that splits
    data in the lookup column on the ";#" delimiter to separate the ID value from the description.
    If you are replacing values in your data with the values that you look up in the list, then loading the changed data back into SharePoint, you only have to include the ID from the lookup column. SharePoint ignores the description if you include it."
    I am not sure if the above statement means that I should be passing the assocaited ID's other than the actual data into the SharePoint List destination. If that is the case, that will not really work as the lookup contains hundreds of rows. Not too mention
    I have several of these lookup column types pointing to several different lists.
    Any guidance in how I can put data into a SharePoint Lookup column type via Data Flow Task would be so much appreaciated.
    Thank you.
    My errors are:
    Error: 0x0 at Data Flow Task, SharePoint List Destination: Error on row ID="1": 0x1 - Unspecified error, such as too many items being updated at once (batch), or an invalid core field value.
    Error: 0xC0047062 at Data Flow Task, SharePoint List Destination [1903]: Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.PipelineProcessException: Errors detected in this component - see SSIS Errors at Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.SharePointListDestination.ProcessInput(Int32
    inputID, PipelineBuffer buffer) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper100 wrapper, Int32 inputID, IDTSBuffer100 pDTSBuffer, IntPtr bufferWirePacket)
    Error: 0xC0047022 at Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "SharePoint List Destination" (1903) failed with error code 0x80131500 while processing input "Component Input" (1912). The identified
    component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will

    I have found a solution to my problem and thought I would share it here in case there are others who are struggling with the above scenario. If you have a better way, I would love to hear about it since my way is a bit tedious.
    In a nutshell, in order to have an SSIS package put data from an OLE DB Source into a SharePoint List Destination Lookup Column, you need to pass the ID of the value that is being looked up, not the value that is in the “master” OLE DB source.
    Rough explanation, OLE DB Source value for column “Approp” is “4005” --> SQL matches “4005” with the ID in the new lookup table (“4005” = ID “5” as defined in the SharePoint lookup list) --> “5” gets passed into SharePoint List destination lookup
    column --> SharePoint displays “4005” and successfully links to the lookup list.
    Funny thing (not really), the error(s) outlined in my original post are not related in getting data into a SharePoint Lookup column as I am now successful in getting data into the system but I am still getting the same above error(s). I think it has to do
    with the ID column in the SharePoint list destination. What I can’t seem to figure out is why since I am not linking any data to that ID column (at least on new records). I am however linking it on Update and Delete and the errors mentioned above disappear
    and things work well.
    There are three tasks that need to get done in order to get data from SQL into a SharePoint lookup column assuming you have already set up your SharePoint lookup lists:
    1. Create new lookup table(s) in SQL that has the IDs from the SharePoint Lookup list and the values coming from the “master” OLD DB Source. You can see the ID column in SharePoint by toggling it on in a view.
    2. Create a SQL command that JOINs all the databases and tables so that the ID is passed and not the value into the SharePoint lookup column
    3. Change the “Data access mode” to “SQL Command” instead of the “Table or view” in the OLE DB Source and paste your command into the “SQL command text:” area.
    Other helpful info is that you may also need to add additional columns in the new lookup tables in SQL for the scenarios when the data is not unique. You can see this two times in my SQL command example for Units and JobTitles:
    SELECT
    pps.SSNm,
    pps.file_updated,
    pps.Employee_id,
    /* pps.CheckDistNm,*/
    Check_Distribution_id = COALESCE( d.ID, 0 ),
    pps.Job_nbr,
    pps.SeqNm,
    pps.action_eff_dt,
    Fund_id = COALESCE( f.id, 0 ),
    Appropriation_id = COALESCE( ap.id, 0 ),
    ActionCode_id = COALESCE( ac.id, 0 ),
    SpecNumber_id = COALESCE( jt.ID, 0 ),
    pps.Employee_id,
    /* pps.Fund,
    pps.Approp,
    pps.Unit,*/
    Unit_id = COALESCE( u.ID, 0 ),
    PosNm,
    PosCode,
    pps.LastName,
    pps.FirstName,
    pps.MI
    FROM
    x_PPS.aReportVw.pps_screens_active AS pps
    LEFT OUTER JOIN dbo.DistributionNumbers AS d ON
    pps.CheckDistNm = d.Check_Distribution
    LEFT OUTER JOIN dbo.Units AS u ON
    pps.Fund = u.Fund AND
    pps.Approp = u.Approp AND
    pps.Unit = u.Unit
    LEFT OUTER JOIN dbo.Appropriations AS ap ON
    pps.Approp = ap.Approp
    LEFT OUTER JOIN dbo.Funds AS f ON
    pps.Fund = f.Fund
    LEFT OUTER JOIN dbo.ActionCodes AS ac ON
    pps.ActionCode = ac.ActionCode
    LEFT OUTER JOIN dbo.JobTitles AS jt ON
    pps.SpecNm = jt.SpecNumber AND
    pps.JurisClass = jt.JurisClass

  • Is there an easy way to insert a page jump link in Muse?

    I have a client that wants to insert embeded videos onto one of his pages.  TWELVE OF THEM!  That is a lot of scrolling and I am wondering if there is an easy way to insert a page jump sot ath users can click at the video description and jump to the video below?

    Hello,
    You can achieve this by using the Anchor option in Muse. You will find the Anchor option between the Effects and Browser Fill options in the toolbar at the top of the Page.
    Please have a look at the screenshot :
    You can follow the steps below to achieve this functionality :
    1) Click on this Anchor option and then scroll down to the video where you wnat to place the anchor.
    2) Now click just beside the audio and it will place the anchor (the anchor icon) there.
    3) Now it will ask you to rename the Anchor. Give it a desired name.
    4) Now select the text which you want to be the trigger (which when clicked should scroll down to the video). Now in the Hyperlink option in the toolbar at the top, you should be able to see an Anchors catagory and all the anchor names (you created) listed there.
    5) Select the desired target Anchor there and this functionality should work fine for you.
    You can create 12 anchors for your 12 videos and place them beside each one of them.
    Note : The Anchor icon is not displayed in Preview/Published output. It is only for design mode. But the functionality will still work.
    Hope this helps.
    Regards,
    Sachin

  • Insert data from oracle  to sql server

    we have running R12.1.1 .
    our company wants to deploy some CRM Application with sql server database. Continuously we have to insert data ( some fields from some tables of Order Management module ) from ORACLE -----------> SQL Server
    My Questions are :
    1. What are possible methods to insert data from ORACLE -----------------> SQL Server ?
    2. What are pros and cons of each method ?
    3. What is performance over load of each method ?
    PLease share your valuable knowledge / ideas / suggestions
    thanks

    What is a maximal latency for data changed in Oracle come into MS SQL?
    this data will be updated in CRM after 24 hours.Does it mean that data replicated from Oracle will be updated in MS SQL and should be replicated back?
    i want to know more details about these APIs etc and middle layer.what API? In MS SQL you can use Linked server and write SQLs that select from Oracle tables via that linked server and insert/update/delete into MS SQL. You can organize these SQLs into T-SQL procedures and run them in jobs.
    Also you can use MS SQL replication, snapshot or transactional, which is ugly because it places triggers on Oracle tables. I doubt that this will be approved by app vendor.
    Also you can use Oracle Streams via Transparent Gateway for MS SQL, which will be quite heavy solution.
    Also, if real-time replication is needed, you can use "middle layer" Oracle Golden Gate, which may be quite pricy for 30 tables.
    Also, if real-time replication is needed, you can use 3-rd party middle layer like DataCurrents or others.

  • Inserting data from Oracle to SQL Server 2008

    Hi All,
    I am using oracle 9.2.0.7 and SQL server 2008 in windows server 2003 operating system.
    My requirment is like below.
    1) I would liek to insert data from the Oracle database to SQL Server.
    For the above requirement we have created the ODBC, then configure the listener file, tns file, and created the db link. This part is working fine as I am able to select the data from the SQL Server.
    But when I am inserting the record from the oracle database to the SQL Server I am getting the error, (ORA-00904) Here oracle can not identified the column name.
    My insert statement is like below.
    insert into test@SQLTEST (name, fullname)
    values ('Oracle', 'Oracle server data');
    Test is the SQL server table name and sqltest is the db link name.
    If I am select the data
    select * from test@SQLTEST from Oralce I am getting the data properly.
    Thanks,
    SUN
    Edited by: User SUN@ on Jun 9, 2010 5:49 PM

    Hi,
    I modify the column name as "f_name" and "l_name";
    Still I am getting the same error;
    Thanks,
    SUN

  • SQL Developer 2.1.0.63 - Export Data menu missing for SQL Server databases

    Hi
    The Export Data menu only appears for Oracle databases in this version, it does not appear for SQL server databases.
    To demonstrate:
    Press F9 to run query
    Right click on Query Result data
    For Oracle an Export Data sub menu appears
    For SQL server no Export Data sub menu appears
    This worked in previous versions.
    Is this functionality going to reappear?
    Thanks
    Dave

    Hi,
    Looks like this is exactly the same problem for third party connections as I have the exact same issue for mySQL.
    I had to apply 1.5.5 version to fix it.
    Hope we're going to have this solved !
    Thanks,
    JP

  • Best way to insert data into a non indexed partitioned table?

    Hi,
    I've a rather basic question that I haven't been able to find an answer to so hope that someone may be able to help.
    We need to insert sales data into a partitioned table that is range partitioned on sales date. The incoming sales data can span a number of days, e.g. 31-JUL-2007 through to 04-AUG-2007 inclusive. I've come up with two approaches and would like to know which you would recommend and why?
    Approach 1: Load data into each individual partition using a statement like:
    INSERT /*+ APPEND */ INTO sales PARTITION (sales_20070731) SELECT * FROM sales_new WHERE sales_date = TO_DATE('31-AUG-2007','DD-MON-YYYY')
    Approach 2: Load data into the entire table using a statement like:
    INSERT /*+ APPEND */ INTO sales SELECT * FROM sales_new
    Thanks

    You need to compare both approaches by creating simple test case.
    But there is no advantages in approach 1until you will have index on sales_date column.
    With index these approaches are comparable and you can choose whatever best fits to your requirements.
    Best Regards,
    Alex

  • Is there an easier way? Import directly into a playlist?

    I am in the middle of ripping all of my 5000+ cd's into iTunes as Apple Lossless files. I'm creating a music server with a Mac Mini, a few 1TB firewire hard drives & a Fubar II dac. I have about 500 done so far and it is becoming a handful. I insist on using playlists because I listen to lots of weird music with a lot of the artists using aliases so I want to be able to group them all together.
    This is what I've been doing. I create a few hundred blank playlists. I import my cd making any changes first using command & I. I then scroll down to where all the untitled playlists are. I then have to scroll all the way to where the songs that were imported are listed alphabetically.I choose them using shift & the mouse dragging them to an untitled playlist. I do it this way because if I found by titling the playlist while it was importing and placing it where it sits alphabetically I was taking to much time trying to drag those tracks to the correct playlist. I was also occasionally dropping them in the wrong playlist altogether.
    Is there really no way to automatically create a playlist using the artist and album info that you set up or what is automatically generated with cddb? Or can I really not create what I want my playlist to be titled and import the cd directly into it? I can't seem to solve this by using a smart playlist either. Any recommendations?

    Here's what I've been doing for years. Its against the grain but so what.
    I have 10,000 ripped files. From this I selected 2265 mp3 files(call these my Favorites) which always get "added to library" whenever I re-do my computer(s) which is very often(my hobby).
    I use the Finder to organize my Music first not itunes. So I make folders and call them for example Metal, Jazz, etc ...within these folders become Artist names for example Beatles, Who , etc....I delete anything that is ahead of the name of the song(such as track number, its embedded anyway), Why? so it fits better in the smallish 'window' of music car player, etc...So what do I have ? A folder with 2265 mp3 files without track numbers and only my favorite mp3 files.
    When I re-do the computer I just set up itunes always unchecking in "advanced preferences" for it to organize and make copies. I do that not itunes. I add to the library. Wait for itunes to do its thing. Set the view options. The only ones I do are, Artist, Album, bitrate, size, Grouping, time & equalizer.
    Once the add is done I do that not itunes automatically, I focus on the Grouping. Examples are Metal, Folk, Smooth Jazz, etc I set these up years ago using itunes. The mp3 hold these id tags except equalizer. I select the Grouping column to arrange the sort, takes 1 second. Then do a select all by grouping and an command + i to set each Grouping equalizer all in one shot. When Equalizer function is completed for all the files then I make playlists. My Playlist is the same name as Grouping, for example Metal Grouping gets Metal playlist. That way I can find the entire Group of Metal and drag them to the playlist. All this sounds complicated, but how to explain? The entire process when I re-do my Mac takes 5 to 10 minutes. The hard work is setting up your MP3 files in the Finder but once done you only need to back up those files. iTunes is out of it. Lastly make sure you id3 tag your files when done in the itunes library using view and setting options. Make sure you drag these tagged files back to your original drive where you back them up. So they retain their tags you gve them.
    Hope this helps

  • Inserting data into table through linked server

    Hi
    I am trying to insert data from a remote database into my database using linked server.
    Below is the syntax that I am using
    set XACT_ABORT on
    INSERT INTO MyTable
    EXEC [172.xx.xx.xxx].MyDatabase.dbo.[MyStoredProc] '2014-10-20','2014-10-26'  
    When I execute the SP (EXEC [172.xx.xx.xxx].MyDatabase.dbo.[MyStoredProc] '2014-10-20','2014-10-26'   ) I get the result.
    but when I try inserting the data into a table using the above code I get the following error
    OLE DB provider "SQLNCLI11" for linked server "172.xx.xx.xxx" returned message "No transaction is active.".
    Msg 7391, Level 16, State 2, Line 59
    The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "172.xx.xx.xxx" was unable to begin a distributed transaction.
    I tried solutions given on
    http://stackoverflow.com/questions/7473508/unable-to-begin-a-distributed-transaction
    but still i get the issue... I don't know whats wrong.

    I think you may need to set the remote proc transaction promotion for linked server option to
    false.
    Please read the articles in below links for more info:
    How to Share Data between Stored Procedures - The Challenges of Linked Servers (Erland)
    How to insert in table from remote stored procedure without creating a distributed transaction?
    Krishnakumar S

  • Is there an easy way to transfer data to Imac from windows

    Ihave exported data files(Quicken) to a flash drive.  When I plug it into my Imac I can see the files but not able to highlight them.

    No I cannot,  Ihave one file able to be moved (addresses) nothing else on tje drive can be moved

  • Is there an easier way to convert bytes into bit(boolean) arrays?

    I am currently using this method to convert bytes into bit arrays:
    /*convert byte to int such that it is between 0-255 this is the bytes[] array
                        if ((bytes/128)==1)
                             bit[c+0]=true;
                        else
                             bit[c+0]=false;
                        if ((bytes[i]-bitInt[c+0]*128)/64==1)
                             bit[c+1]=true;
                        else
                             bit[c+1]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64)/32==1)
                             bit[c+2]=true;
                        else
                             bit[c+2]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32)/16==1)
                             bit[c+3]=true;
                        else
                             bit[c+3]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16)/8==1)
                             bit[c+4]=true;
                        else
                             bit[c+4]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16-bitInt[c+4]*8)/4==1)
                             bit[c+5]=true;
                        else
                             bit[c+5]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16-bitInt[c+4]*8-bitInt[c+5]*4)/2==1)
                             bit[c+6]=true;
                        else
                             bit[c+6]= false;
                        if ((bytes[i]-bitInt[c+0]*128-bitInt[c+1]*64-bitInt[c+2]*32-bitInt[c+3]*16-bitInt[c+4]*8-bitInt[c+5]*4-bitInt[c+6]*2)==1)
                             bit[c+7]=true;
                        else
                             bit[c+7]= false;

    You can loop through and use a bitwise operator instead. Here is an example without the loop.
    byte b = 6 ;
    if( b & Math.pow( 2, 0 ) == Math.pow( 2, 0 ) ) ;
    // the 2^0 bit is on
    if( b & Math.pow( 2, 1 ) == Math.pow( 2, 1 ) ) ;
    // the 2^1 bit is onetc...
    You should get something like 110 when you're done.
    If you're wonder what & does (no, its not a boolean &&), it takes the bits in the two numbers you give it and returns a number with all the bits on that are on for each of them.
    For example:
    10011011 &
    11001101 =
    10001001
    So if we take
    110 (6) &
    010 (2^1, or 2) =
    010 (2 again)
    Which means that the number (6) has the 2^1 bit on.

Maybe you are looking for

  • Share a Gmail calender ?

    Me and my wife each have a iPhone, a 3G and 3GS. We both have a Gmail account and I have created a calender, that I want to share with my wife. I have added my wife to my calender, and when she log into Gmail (on the computer), she can see my calende

  • How can I set up a rule to delete all messages older than 6 months left in Apple Mail's main inbox?

    How can I set up a rule to delete all messages older than 6 months left in Apple Mail's main inbox? I have created other rules to move some of my daily messages into specific folders and I don't wish to auto-delete those. Just the general stuff that

  • [SOLVED] Unresponsive Internet Every Minute

    I recently installed Arch Linux on a new computer from the ISO image provided on the website and upgraded all of the packages to their recent versions. I am having a problem with my internet. The internet is sluggish and every 30 to 60 seconds just s

  • Itunes will not open in windows 7

    itunes will open, but it takes about five minutes for it to do so, and this is the case if I plug in the nano or nothing at all.

  • My messages app crashes when I attempt to send a message, help?

    I have a 3GS, every time that I try and send and text message the entire app shuts down, this just started. I have sync it several times, tried to restore to back up and nothing. I cannot send or recieve any messages. Please help!