Changing SQLServer Date
Sep 8, 2006
Where can i change the date stored internally to SQL Server. It is this value which is displayed when we execute getdate() function. But, Changing the system date doesn't change the result of getdate() function. I want to get a different value for getdate(). Is it possible ?
Mohan
View 2 Replies
ADVERTISEMENT
Feb 23, 2005
Hello,
By default, Microsoft sqlserver has a pagesize of 8k. Is it possible to change this default pagesize? If yes how can I change it after SQlserver is installed. What are some of the factors to take in to consideration before changing it? For example the operating system etc.
Regards,
Albert.
View 1 Replies
View Related
Sep 3, 2004
We have received a DB from one of our customer.
We want to change the DB and tables (and all objects) owner to sa
How can we do that ?
Thanks
View 4 Replies
View Related
Nov 2, 2003
Hi
I want to change collation_name of my SqlServer Database by running a script. But I don't know how.
Please help me.
Thanks
View 1 Replies
View Related
Jan 23, 2007
Hi
I am trying to switch between oracle and sqlserver databases to read the source data. I have used a parameter file to specify the connection parameters. For SQLserver the connection looks like in the file as below:
<?xml version="1.0"?><DTSConfiguration><DTSConfigurationHeading><DTSConfigurationFileInfo GeneratedBy="abvsh" GeneratedFromPackageName="Package" GeneratedFromPackageID="{8A304BF7-5325-4079-9D92-2B9BBF8793AA}" GeneratedDate="1/23/2007 4:46:08 PM"/></DTSConfigurationHeading><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[ConnectionString]" ValueType="String"><ConfiguredValue>Data Source=dl;Initial Catalog=PM_DW;Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[Description]" ValueType="String"><ConfiguredValue></ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[InitialCatalog]" ValueType="String"><ConfiguredValue>PM_DW</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[Name]" ValueType="String"><ConfiguredValue>dl.PM_DW</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[Password]" ValueType="String"><ConfiguredValue></ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[ProtectionLevel]" ValueType="Int32"><ConfiguredValue>1</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[RetainSameConnection]" ValueType="Boolean"><ConfiguredValue>0</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[ServerName]" ValueType="String"><ConfiguredValue>dl</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[UserName]" ValueType="String"><ConfiguredValue></ConfiguredValue></Configuration></DTSConfiguration>
the pacakge runs fine. But when i change the connection to Oracle, it gives me error.
The config file looks like when i put oracle connection is as follows:
<?xml version="1.0"?><DTSConfiguration><DTSConfigurationHeading><DTSConfigurationFileInfo GeneratedBy="I2vshrivas" GeneratedFromPackageName="Package" GeneratedFromPackageID="{8A304BF7-5325-4079-9D92-2B9BBF8793AA}" GeneratedDate="1/23/2007 4:46:08 PM"/></DTSConfigurationHeading><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[ConnectionString]" ValueType="String"><ConfiguredValue>Data Source=pm62;User ID=pcm_62;Provider=OraOLEDB.Oracle.1;Persist Security Info=True;</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[Description]" ValueType="String"><ConfiguredValue></ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[InitialCatalog]" ValueType="String"><ConfiguredValue></ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[Name]" ValueType="String"><ConfiguredValue>dl.PM_DW</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[Password]" ValueType="String"><ConfiguredValue></ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[ProtectionLevel]" ValueType="Int32"><ConfiguredValue>1</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[RetainSameConnection]" ValueType="Boolean"><ConfiguredValue>0</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[ServerName]" ValueType="String"><ConfiguredValue>i2pm62</ConfiguredValue></Configuration><Configuration ConfiguredType="Property" Path="Package.Connections[dl.PM_DW].Properties[UserName]" ValueType="String"><ConfiguredValue>pcm_62</ConfiguredValue></Configuration></DTSConfiguration>
The error which i get when running from oracle source is this:
Information: 0x40016041 at Package: The package is attempting to configure from the XML file "C:oraTOsql-DataTXIntegration Services Project1Integration Services Project1Integration Services Project1 estConfig.dtsConfig".
SSIS package "Package.dtsx" starting.
Information: 0x4004300A at Data Flow Task, DTS.Pipeline: Validation phase is beginning.
Error: 0xC0202009 at Package, Connection manager "dl.PM_DW": An OLE DB error has occurred. Error code: 0x80040E21.
An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".
Error: 0xC020801C at Data Flow Task, OLE DB Source [1]: The AcquireConnection method call to the connection manager "dl.PM_DW" failed with error code 0xC0202009.
Error: 0xC0047017 at Data Flow Task, DTS.Pipeline: component "OLE DB Source" (1) failed validation and returned error code 0xC020801C.
Error: 0xC004700C at Data Flow Task, DTS.Pipeline: One or more component failed validation.
Error: 0xC0024107 at Data Flow Task: There were errors during task validation.
SSIS package "Package.dtsx" finished: Failure.
The program '[7264] Package.dtsx: DTS' has exited with code 0 (0x0).
Please let me know if you guys have any suggestion in what i am doing wrong.
Thanks,
Vipul
View 3 Replies
View Related
Apr 2, 2008
OK Here is what I am trying to do... In one of my processes I need to take a field IE CREATE_DATE and change that from an EPOCH (number of seconds since Jan 1, 1970) to a human readable date... IE a 04/02/2008 08:23:36 AM and stuff... Now I do know how to use the dateadd... However all my times are coming up as GMT I need them to be EST/EDT... How can I script this to automagically subject 5 or 4 from the hour depending on if we are in daylight savings. This has been plagueing me for the longest time.
Thank you all for any help you can give.
View 3 Replies
View Related
Jan 25, 2012
SO, If I had a problem with server computer date & stored false dates for some operations, How can I alter those dates to correct dates.
View 1 Replies
View Related
Feb 27, 2014
I have the following field “Period_DT” displayed as “2012-12-01” how can i make it ‘2012-12-01 00:00:00’
Column Name : Period_DT
Date type : Date
View 2 Replies
View Related
Feb 22, 2007
Hello all, I have a question. I am fairly new to all of this, so bear with me if it is something simple (as I kinda hope it is).
In SSRS, I have a report that runs against a SQL '05 DB. The DB tables are created with a SSIS package gathering information from an AS/400 DB2 database.
The package and report run fine. One of the columns in the table is for a date (date of birth). The SSIS package gathers the column information and inserts it into SQL Server as a Decimal datatype (Decimal 6,0). The dates (decimals?) are now in the format 40207, as they were on the 400, where that specific date would be April 2, 2007. 120707 would be December 7, 2007 and so on. I would like to format the date to be mm/dd/yy or even m/dd/yy for the "single digit" months in the report for easy readability.
I have tried setting the format options in reporting services for formatting the field as a date, and even using the cdate conversion or FormatDateTime in an expression. I cannot seem to get the date to change. I either get an "# error" for the values of the fields or I get the same date that already was there (40207)?
It seems as if none of the date formatting options are working. Is this something I need to do on the package (set the mappings on the create table to create the columns as a Date, not Numeric or something similar?), or should it be easier than that by converting the output of the report to display mm/dd/yy with the "/"?
Any help is greatly appreciated.
Thanks
View 10 Replies
View Related
Dec 6, 2013
Aim – Currently i have column “[LAST-STATUS-CHG]” in the following date format “042312” i need this date format to be changed into “23-04-12”.
Also i would like an additional column created called “Start of month” this column should look at “[LAST-STATUS-CHG]” and what ever the day is in the defauly it to 01
Current results
FDMSAccountNoACCOUNT-STATUSLAST-STATUS-CHG
87800000088416042312
87800000088513011212
87800000088612100712
Desired results
FDMSAccountNoACCOUNT-STATUSLAST-STATUS-CHGStart_of_month
8780000008841623-04-1201-04-12
8780000008851301-12-1201-12-12
8780000008861210-07-1201-07-12
My query is
SELECT [FDMSAccountNo]
,[ACCOUNT-STATUS],
[LAST-STATUS-CHG]
FROM [FDMS].[dbo].[stg_LMPAB501]
where FDMSAccountNo = '878000000884'
View 2 Replies
View Related
Oct 19, 2007
hi
I have in my table a field called MyDate with data in this format
MyDate ID
18/02/2007 04:22:32 p.m. 10189844
18/02/2007 04:22:34 p.m. 10189846
18/02/2007 04:22:34 p.m. 10189847
18/02/2007 04:23:34 p.m. 10189849
I need to update some many records in the field MyDate.
What function parameters allow me to change the Date part (from 18/02/2007 04:22:32 p.m. to 25/06/2007 04:22:32 p.m.) without affecting the time part?
And what function allows me to change the Time part (from 18/02/2007 04:22:32 p.m. to 18/02/2007 09:10:00 p.m.)
without affecting the Date part?
regards,
View 8 Replies
View Related
Nov 27, 2007
Howdy,
I live in Australia and use the date format of - dd/mm/yyy, but when i do a query in SQL Management it seems to want its inputs in US format mm/dd/yyy.
For example it errors when i do a search and one of the dates is 27/11/2007, ie there is no 27th "US" Month.
I have checked my local settings (regional and language in control panel), and it all points to Australian formats, it just seems the SMS wants the dates in US.
Any Ideas?
Dwayne Schaffarz
View 4 Replies
View Related
Dec 23, 2005
Hello. I am using Microsoft SQL Server Management Studio (SQL Server 2005). When I select a date column from a table, the date is displayed in "mm/dd/yyyy hh:mm:ss" format. Is there a way i can change this date format so that it shows "dd/mm/yyyy hh:mm:ss" permanently? Thanks.
View 3 Replies
View Related
May 27, 2006
I basic question but can someone help.
I have a SELECT statement, the result of which populates a
datagrid. The first column has consecutive dates in it and I want
to hyperlink each date to a seperate Javascript function (the
Javascript is created on the fly and is unique for each date). I
need a different function name for each function and so tried the date
but "/" is not allowed in the Javasript function name. I think
the easiest way will be to produce a new column with the date expresses
ddmmyyyy, ddmmyy or some such unique number (but not dd/mm/yyyy).
I tried :-
"CASE " & _
"WHEN t3.date = t3.date THEN (DAY(t3.Date) + MONTH(t3.Date) + YEAR(t3.Date)) ELSE NULL END AS [javaKey]
but this adds the year to the month to the day - not a unique result as 1/2/06 and 2/1/06 are the same.
I am just getting to grips with VB.Net (as an amature) but am a distinct beginner at SQL!
Many thanks
Mike
View 2 Replies
View Related
Jul 19, 2002
SQL 2k w2k server sp2
When I first installed the SQL server on my server, the default date
format was mm/dd/yy. Now I need to change that to dd/mm/yy in
regional settings, but its still not reflected in the DB's in SQL (its
still mm/dd/yy).
Is it possible to change it in SQL without a complete reinstallation
of the server?
View 1 Replies
View Related
Jul 21, 2014
My current Query takes the DATE value stored in P.CreatedDate and makes it VARCHAR, then stores it in the table. I need to format this to return YYYYMMDD. How would I go about this?
Current Code:
Code:
CAST(P.CreatedDate AS VARCHAR) AS DateEntered,
View 3 Replies
View Related
Jul 20, 2005
Hi.i am facing a problem.How do i save a java.util.Date in a SQLServer column declared as a'datetime' .and please tell me how to retrieve it too.i think that java.sql.Timestamp gives 'Abstract Method Error'.thanks..--Posted via http://dbforums.com
View 1 Replies
View Related
May 16, 2008
I have a SSIS data flow task that downloads data from an Oracle source which has some real dates and some date values of 0001-01-01 which I am trying to convert to '1900-01-01' using a decode(Date1,'0001-01-01','1900-01-01',Date1). The problem I am having is that when I run the package in Business Intelligence Development Studio on my local machine the date value is stored correctly in the SQL table in a datetime field as 1/1/1900 12:00:00 AM, however when I run the package from the server the field gets saved as 1/1/2001 12:00:00 AM.
I have tried a bunch of ways to work around this issue and the only solution I have found that works it to download into a temp table and then load into the live table. Does anyone have any idea of what might be causing this issue when I run the package from the server?
View 1 Replies
View Related
Aug 9, 2015
I’m retrieving Yahoo quotes into my database and have run into an issue when the dates sometimes change format in the csv file retrieved.
I am retrieving yahoo quotes via powershell, then running a package to import data to my table. This generally works expect when the yahoo date format changes.
In the yahoo csv file, the dates normally come through in dd/mm/yyyy format. I find when a quote is old the format changes to mm/dd/yyyy, just for that particular quote.
When this happens, the package fails because the quote date format does not match my destination table format. i.e. mm/dd/yyyy vs dd/mm/yyyy
When this occurs, I would like to skip the records in mm/dd/yyyy format altogether and have the rest of the quotes imported.
One approach I can think of is to import the dates as a text type and do some data validation / conversion once imported but it feels like adding unnecessary steps.
Is there some other way I can achieve this within the process I already have?
View 4 Replies
View Related
Nov 5, 2015
Fields!TaskStartDate.Value & Fields!TaskName.Value & Fields!StatusForExecutiveReporting.Value & Fields!NotesForExecutiveReport.Value
This is my expression in a cell.when i run my report task start date value is something like the:
01/25/2015 8:00:00AM.
I want this date to be in this form: jan 2015
View 3 Replies
View Related
Dec 6, 2007
Hi All,
I would like to know whether it is possible to add and updated date column in a slow changing dimension table using the slow changing dimension data flow transformation.
I would like to keep track of what record is updated in the dimension table based on the data being processed.
Thanks for you help and information
Regards,
Fadzli
View 1 Replies
View Related
Jan 11, 2008
hi,
i have problem while searching date in datebase using like operator ,i write the below query but this will not give any result and i have the date 13/1/2008 in my table meeting please any one help me.
select meetingdate from meeting where meetingdate like '%13/1/2008%'
thanks
prasath
View 4 Replies
View Related
Feb 17, 2007
How can I change system date using sqlserver?
Please help me.
View 9 Replies
View Related
Jun 15, 2007
Hi There
We currently have the following scenario:
4 app servers with regional date and time settings of locale A.
1 database server with locale settings B.
What is happening is that timestamps are being generated on the app servers, these are then in a sql command which fails on the database server since the timestamp format is invalid.
It was suggested that we change the regional locale settings of the database server, but will this not have serious implications , for example every current timestamp format in the datbase will become invalid?
In a nutshell is it safe to change a database servers regional date time locale settings ? Or are there serious implications?
Thanx
View 1 Replies
View Related
Oct 30, 2007
Hello all,
Hope all of us know that DST Patch update will be on 4th November,07.
Here my query is how to retrieve the DST patch updated date in sqlserver 2000?
any queries on this?
Would any one help me on this?
Thanks in advance,
View 6 Replies
View Related
Sep 14, 2004
Minimum Date in DateStamp field is not 1-Jan-100. Wouldn't we expect that.
In SQLServer2000 is it "1-Jan-100", if not WHY ??,
In the previous versions it is "01-Jan-1753"
bikramjeet
View 3 Replies
View Related
Dec 6, 2006
Hi,
We are trying to move our application from SQL2005 to SQL2005, we are using 2005 jdbc driver 1.1.
The problem we have is, when a date is retrieved from the database, only the year part got correctly, but the date is automatically set to January 1 of that year. The interesting thing is this problem doesn't occur on local development environment (developer's windows platform), it only happens when we deploy the application to production server (unix).
Does anyone know what is going on, how to fix it?
Thanks.
Cathie
View 12 Replies
View Related
Apr 30, 2008
Anyone please suggest me that , I have a text box where I am entering th date in dd/MM/yyyy format.
But the default field in my SqlServer2005 is MM/dd/yyyy.
How can i insert it into the database. or how can i change the MM/dd/yyyy of database to dd/MM/yyyy
Please, its urgent.
Thanks in advance
Regards
Tapan
View 14 Replies
View Related
May 10, 2007
We have a static class that makes an HTTPWebRequest to get XML data from one of our vendors. We use this as input to a stored proc in SQLServer2005. When I compile this class and call it from a console application in visual studio it executes in milliseconds, everytime. When I compile it, create the assembly and clr function and execute it in SQLServer, it takes around 14 seconds to execute the first time, then on subsequent requests it is again really fast, until I wait for 10 seconds and re-execute, once again it is slow the first time and then fast on subsequent requests. We do not see this behavior when executing outside SQLServer. Makes me think that some sort of authentication is perhaps taking place the first time the function is run in SQLServer? I have no idea how to debug this further. Anyone seen this before or have any ideas?
Here is the class:
Code Snippet
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace Predict.Services
{
public static class Foo
{
public static string GetIntradayQuote(string symbol)
{
string returnQuote = "";
HttpWebRequest request = (HttpWebRequest)(WebRequest.Create("http://data.predict.com/predictws/detailed_quote.html?syms=" + symbol + "&fields=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,28,30"));
request.Timeout = 1000;
HttpWebResponse response = (HttpWebResponse)(request.GetResponse());
StreamReader streamReader = new StreamReader(response.GetResponseStream());
returnQuote = streamReader.ReadToEnd();
streamReader.Close();
response.Close();
return returnQuote;
}
}
}
When I run call it from a console app it is fine.
I compile it into a dll and then create the assembly and function as follows:
Code Snippet
drop function fnTestGetIntradayQuoteXML_SJS
go
drop assembly TestGetIntradayQuoteXML_SJS
go
create ASSEMBLY TestGetIntradayQuoteXML_SJS from 'c:DataBackupsCLRLibrariesTestGetIntradayQuote_SJS.dll' WITH PERMISSION_SET = EXTERNAL_ACCESS
go
CREATE FUNCTION fnTestGetIntradayQuoteXML_SJS(@SymbolList nvarchar(max)) RETURNS nvarchar(max) AS EXTERNAL NAME TestGetIntradayQuoteXML_SJS.[Predict.Services.Foo].GetIntraDayQuote
go
declare @testing nvarchar(max)
set @testing = dbo.fnTestGetIntradayQuoteXML_SJS('goog')
print @testing
When I execute the function as above, again, really slow the first time, then fast on subsequent calls. Could there be something wrong with the code, or some headers that need to be set differently to operate from the CLR in SQLServer?
Regards,
Skipper.
View 1 Replies
View Related
Sep 20, 2006
Hi experts;
I have a problem with unicode character 0x2300
I created this table
create table testunicode (Bez nchar(128))
Insert Data
insert into testunicode (Bez)values('')
with 2 Unicode characters
= 0x2300
= 0x2122
Selecting the data
select Bez from testunicode
I see
"?"
= 0x2122 is ok but instead of 0x2300 there is 0x3f
When I modify the insert statement like that ( 8960 = 0x2300 )
insert into testunicode (Bez)values(NCHAR(8960)+'')
and select again voila i see
""
Does anyone have an idea?
Thanks
View 1 Replies
View Related
Apr 18, 2008
I am trying to 'load' a copy of a SQLServer 2000 database to SQLServer 2005 Express (on another host). The copy was provided by someone else - it came to me as a MDF file only, no LDF file.
I have tried to Attach the database and it fails with a failure to load the LDF. Is there any way to bypass this issue without the LDF or do I have to have that?
The provider of the database says I can create a new database and just point to the MDF as the data source but I can't seem to find a way to do that? I am using SQL Server Management Studio Express.
Thanks!!
View 1 Replies
View Related
Jul 29, 2005
I'm chasing after a documetn that was available on one of the Microsoftwebsites that was titled somethign like "MS SQL Server Best Practices"and detailed a nyumber of best practices about securing the server.Included in this was revoking public access to the system tableobjects.Can someone post the URL where I can pick this up, or drop me a note oncontacting them for a copy of the document?
View 2 Replies
View Related
Jun 14, 2006
I have an app that uses a sqlserver 2000 jdbc driver to connect to a sqlserver 2000.
Is it possible to do a direct replacement of sqlserver 2000 with sqlserver 2005 express just by reconfiguring the app to point to the express? The app would still be using the sqlserver 2000 jdbc driver to try and make the connection.
If that is a possibility, what can be some differences in the configuration? Previously with 2000 the config information I entered is:
server name: "machinename"( or ip). I've also tried "machiname/SQLEXPRESS"
DB name: name of db instance
port: 1433(default)
user and pass.
My attempts so far results in
"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket."
and
"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unable to connect. Invalid URL."
View 1 Replies
View Related