Showing posts with label sending. Show all posts
Showing posts with label sending. Show all posts

Thursday, March 29, 2012

DB backup to another server

How do I configure SQL Server Agent and my Database Maintenance Plans to
enable sending backups to another server via UNC pathnames and restoring
from the same location? Backing up locally and copying files to the other
server doesn't make good use of the functionality of deleting backups older
than a certain number of days.
I've already created a domain admin user, shared the destination folder to
this user will full permissions, set SQL Server Agent to login under the
context of this domain admin user, but my backups still won't go to that
remote server.This is a multi-part message in MIME format.
--=_NextPart_000_0525_01C3B825.106A5290
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
Have you also configured SQL Server itself to run under that domain account?
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"David Morrison" <me@.nospam.com> wrote in message
news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl...
How do I configure SQL Server Agent and my Database Maintenance Plans to
enable sending backups to another server via UNC pathnames and restoring
from the same location? Backing up locally and copying files to the other
server doesn't make good use of the functionality of deleting backups older
than a certain number of days.
I've already created a domain admin user, shared the destination folder to
this user will full permissions, set SQL Server Agent to login under the
context of this domain admin user, but my backups still won't go to that
remote server.
--=_NextPart_000_0525_01C3B825.106A5290
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Have you also configured SQL Server =itself to run under that domain account?
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"David Morrison" wrote in message news:u$XDJ5EuDHA.424@.T=K2MSFTNGP11.phx.gbl...How do I configure SQL Server Agent and my Database Maintenance Plans =toenable sending backups to another server via UNC pathnames and =restoringfrom the same location? Backing up locally and copying files to the =otherserver doesn't make good use of the functionality of deleting backups =olderthan a certain number of days.I've already created a domain admin user, =shared the destination folder tothis user will full permissions, set SQL =Server Agent to login under thecontext of this domain admin user, but my =backups still won't go to thatremote server.

--=_NextPart_000_0525_01C3B825.106A5290--|||This is a multi-part message in MIME format.
--=_NextPart_000_0014_01C3B816.F2397930
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
No. Is that necessary?
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message =news:%23T3787EuDHA.2448@.TK2MSFTNGP12.phx.gbl...
Have you also configured SQL Server itself to run under that domain =account?
-- Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"David Morrison" <me@.nospam.com> wrote in message =news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl...
How do I configure SQL Server Agent and my Database Maintenance Plans =to
enable sending backups to another server via UNC pathnames and =restoring
from the same location? Backing up locally and copying files to the =other
server doesn't make good use of the functionality of deleting backups =older
than a certain number of days.
I've already created a domain admin user, shared the destination =folder to
this user will full permissions, set SQL Server Agent to login under =the
context of this domain admin user, but my backups still won't go to =that
remote server.
--=_NextPart_000_0014_01C3B816.F2397930
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

No. Is that =necessary?
"Tom Moreau" = wrote in message news:%23T3787EuDHA.=2448@.TK2MSFTNGP12.phx.gbl...
Have you also configured SQL Server =itself to run under that domain account?
-- Tom

=---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql


"David Morrison" wrote in message news:u$XDJ5EuDHA.424@.T=K2MSFTNGP11.phx.gbl...How do I configure SQL Server Agent and my Database Maintenance Plans =toenable sending backups to another server via UNC pathnames and =restoringfrom the same location? Backing up locally and copying files to the otherserver doesn't make good use of the functionality of deleting =backups olderthan a certain number of days.I've already created a =domain admin user, shared the destination folder tothis user will full permissions, set SQL Server Agent to login under thecontext of =this domain admin user, but my backups still won't go to thatremote server.

--=_NextPart_000_0014_01C3B816.F2397930--|||This is a multi-part message in MIME format.
--=_NextPart_000_0022_01C3B81B.15455940
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
That was it! You made my day. Thanks!
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message =news:%23T3787EuDHA.2448@.TK2MSFTNGP12.phx.gbl...
Have you also configured SQL Server itself to run under that domain =account?
-- Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"David Morrison" <me@.nospam.com> wrote in message =news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl...
How do I configure SQL Server Agent and my Database Maintenance Plans =to
enable sending backups to another server via UNC pathnames and =restoring
from the same location? Backing up locally and copying files to the =other
server doesn't make good use of the functionality of deleting backups =older
than a certain number of days.
I've already created a domain admin user, shared the destination =folder to
this user will full permissions, set SQL Server Agent to login under =the
context of this domain admin user, but my backups still won't go to =that
remote server.
--=_NextPart_000_0022_01C3B81B.15455940
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

That was it! You made my =day. Thanks!
"Tom Moreau" = wrote in message news:%23T3787EuDHA.=2448@.TK2MSFTNGP12.phx.gbl...
Have you also configured SQL Server =itself to run under that domain account?
-- Tom

=---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql


"David Morrison" wrote in message news:u$XDJ5EuDHA.424@.T=K2MSFTNGP11.phx.gbl...How do I configure SQL Server Agent and my Database Maintenance Plans =toenable sending backups to another server via UNC pathnames and =restoringfrom the same location? Backing up locally and copying files to the otherserver doesn't make good use of the functionality of deleting =backups olderthan a certain number of days.I've already created a =domain admin user, shared the destination folder tothis user will full permissions, set SQL Server Agent to login under thecontext of =this domain admin user, but my backups still won't go to thatremote server.

--=_NextPart_000_0022_01C3B81B.15455940--|||I have the same problem. SQL Server runs using an NT account, this account has permissions on the backup server and while logged into the first server using this same NT account I'm able to map a drive to the backup server. But when I go through Enterprise Manager and look for this destination via the SQL Server Backup window, I don't find it. Please advise
-- David Morrison wrote: --
No. Is that necessary
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message news:%23T3787EuDHA.2448@.TK2MSFTNGP12.phx.gbl..
Have you also configured SQL Server itself to run under that domain account
--
To
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDB
SQL Server MV
Columnist, SQL Server Professiona
Toronto, ON Canad
www.pinnaclepublishing.com/sq
"David Morrison" <me@.nospam.com> wrote in message news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl..
How do I configure SQL Server Agent and my Database Maintenance Plans t
enable sending backups to another server via UNC pathnames and restorin
from the same location? Backing up locally and copying files to the othe
server doesn't make good use of the functionality of deleting backups olde
than a certain number of days
I've already created a domain admin user, shared the destination folder t
this user will full permissions, set SQL Server Agent to login under th
context of this domain admin user, but my backups still won't go to tha
remote server|||This is a multi-part message in MIME format.
--=_NextPart_000_00AA_01C3B84F.60E51960
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
Use the full UNC name for the backup destination. You cannot map to a drive
letter.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
.
"Simi Rao" <anonymous@.discussions.microsoft.com> wrote in message
news:21C576AF-AB76-49E8-899D-8058242FE3F2@.microsoft.com...
I have the same problem. SQL Server runs using an NT account, this account
has permissions on the backup server and while logged into the first server
using this same NT account I'm able to map a drive to the backup server.
But when I go through Enterprise Manager and look for this destination via
the SQL Server Backup window, I don't find it. Please advise.
-- David Morrison wrote: --
No. Is that necessary?
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:%23T3787EuDHA.2448@.TK2MSFTNGP12.phx.gbl...
Have you also configured SQL Server itself to run under that domain
account?
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"David Morrison" <me@.nospam.com> wrote in message
news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl...
How do I configure SQL Server Agent and my Database Maintenance Plans
to
enable sending backups to another server via UNC pathnames and
restoring
from the same location? Backing up locally and copying files to the
other
server doesn't make good use of the functionality of deleting backups
older
than a certain number of days.
I've already created a domain admin user, shared the destination
folder to
this user will full permissions, set SQL Server Agent to login under
the
context of this domain admin user, but my backups still won't go to
that
remote server
--=_NextPart_000_00AA_01C3B84F.60E51960
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Use the full UNC name for the backup destination. You cannot map to a drive letter.
-- Tom
----Thomas A. =Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql.
"Simi Rao" wrote in message news:21C=576AF-AB76-49E8-899D-8058242FE3F2@.microsoft.com...I have the same problem. SQL Server runs using an NT account, this =account has permissions on the backup server and while logged into the first =server using this same NT account I'm able to map a drive to the backup =server. But when I go through Enterprise Manager and look for this destination =via the SQL Server Backup window, I don't find it. Please advise. -- =David Morrison wrote: -- = No. Is that necessary? ="Tom Moreau" = wrote in message news:%23T3787EuDHA.=2448@.TK2MSFTNGP12.phx.gbl... =Have you also configured SQL Server itself to run under that domain account? = -- Tom = --- = Thomas A. Moreau, BSc, PhD, MCSE, =MCDBA SQL Server MVP Columnist, SQL =Server Professional Toronto, ON Canada http://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql ="David Morrison" =wrote in message news:u$XDJ5EuDHA.424@.T=K2MSFTNGP11.phx.gbl... How do I configure SQL Server Agent and my Database Maintenance Plans to enable sending backups to =another server via UNC pathnames and =restoring from the same location? Backing up locally and copying files to =the other server doesn't make good =use of the functionality of deleting backups older than a certain number of days. = I've already created a domain admin user, shared the destination folder to this user will full =permissions, set SQL Server Agent to login under =the context of this domain admin user, but my backups still won't go to that remote server

--=_NextPart_000_00AA_01C3B84F.60E51960--|||I'm having a similar problem. Does SQL Server itself have
to run under the domain account? Is this the MSSQLSERVER
service? I have the permissions on the remote folder set
for the domain admin. The SQL job for the maintenance
plan is owned by the domain admin. The SQL Agent service
is started under the domain admin. Still, the backups are
failing and the log indicates that access is denied in
creating the backup and it appears that 'sa' is invoking
the job.
>--Original Message--
>No. Is that necessary?
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in
message news:%23T3787EuDHA.2448@.TK2MSFTNGP12.phx.gbl...
> Have you also configured SQL Server itself to run under
that domain account?
> --
> Tom
> ---
--
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com/sql
>
> "David Morrison" <me@.nospam.com> wrote in message
news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl...
> How do I configure SQL Server Agent and my Database
Maintenance Plans to
> enable sending backups to another server via UNC
pathnames and restoring
> from the same location? Backing up locally and copying
files to the other
> server doesn't make good use of the functionality of
deleting backups older
> than a certain number of days.
> I've already created a domain admin user, shared the
destination folder to
> this user will full permissions, set SQL Server Agent
to login under the
> context of this domain admin user, but my backups still
won't go to that
> remote server.
>|||This is a multi-part message in MIME format.
--=_NextPart_000_001C_01C3C328.296D6850
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
The SQL Server service has to run under a domain account to do what you
want. That said, you should not use the domain admin account. That's way
to much authority. Create a separate account that can run as a service and
use it.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
.
<anonymous@.discussions.microsoft.com> wrote in message
news:108a01c3c33e$5b4bd170$3101280a@.phx.gbl...
I'm having a similar problem. Does SQL Server itself have
to run under the domain account? Is this the MSSQLSERVER
service? I have the permissions on the remote folder set
for the domain admin. The SQL job for the maintenance
plan is owned by the domain admin. The SQL Agent service
is started under the domain admin. Still, the backups are
failing and the log indicates that access is denied in
creating the backup and it appears that 'sa' is invoking
the job.
>--Original Message--
>No. Is that necessary?
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in
message news:%23T3787EuDHA.2448@.TK2MSFTNGP12.phx.gbl...
> Have you also configured SQL Server itself to run under
that domain account?
> --
> Tom
> ---
--
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com/sql
>
> "David Morrison" <me@.nospam.com> wrote in message
news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl...
> How do I configure SQL Server Agent and my Database
Maintenance Plans to
> enable sending backups to another server via UNC
pathnames and restoring
> from the same location? Backing up locally and copying
files to the other
> server doesn't make good use of the functionality of
deleting backups older
> than a certain number of days.
> I've already created a domain admin user, shared the
destination folder to
> this user will full permissions, set SQL Server Agent
to login under the
> context of this domain admin user, but my backups still
won't go to that
> remote server.
>
--=_NextPart_000_001C_01C3C328.296D6850
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

The SQL Server service has to run =under a domain account to do what you want. That said, you should not use the =domain admin account. That's way to much authority. Create a =separate account that can run as a service and use it.
-- Tom
----Thomas A. =Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql.
wrote in message news:108a01c3c33e$5b=4bd170$3101280a@.phx.gbl...I'm having a similar problem. Does SQL Server itself have to run =under the domain account? Is this the MSSQLSERVER service? I have the permissions on the remote folder set for the domain admin. The =SQL job for the maintenance plan is owned by the domain admin. The SQL =Agent service is started under the domain admin. Still, the backups =are failing and the log indicates that access is denied in creating =the backup and it appears that 'sa' is invoking the job.>--Original Message-->No. Is that necessary?> "Tom Moreau" = wrote in message news:%23T3787EuDHA.=2448@.TK2MSFTNGP12.phx.gbl...> Have you also configured SQL Server itself to run under that domain account?>> -- > =Tom>> -----&g=t; Thomas A. Moreau, BSc, PhD, MCSE, MCDBA> SQL Server MVP> Columnist, SQL Server Professional> =Toronto, ON Canada>http://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql>>> "David Morrison" wrote in message news:u$XDJ5EuDHA.424@.T=K2MSFTNGP11.phx.gbl...> How do I configure SQL Server Agent and my Database Maintenance =Plans to> enable sending backups to another server via UNC =pathnames and restoring> from the same location? Backing up =locally and copying files to the other> server doesn't make good =use of the functionality of deleting backups older> than a certain =number of days.>> I've already created a domain admin user, =shared the destination folder to> this user will full =permissions, set SQL Server Agent to login under the> context of this =domain admin user, but my backups still won't go to that> =remote server.>>

--=_NextPart_000_001C_01C3C328.296D6850--

Wednesday, March 7, 2012

DateTime

I have an application that is sending the date with the following format dd/mm/yyyy the field in the table in sql is a datetime and the record is not being inserted. If I manually change the value in the query analyzer to mm/dd/yyyy the record is inserte
d successfully. How can I change the data type to accept the values as is
Thanks
Have you check what the dateformat for the language you are using. You can
do this by issuing the following command:
sp_helplanguage @.@.language
If you want a different format then your langauge format you can change it
by using the SET DATEFORMAT.
Here is an example of where I used two different language. In these
examples us_english like mm/dd/yyyy format and British like dd/mm/yyyy.
Hopefully this will give you some ideas on how to fix you problem.
set language us_english
exec sp_helplanguage @.@.language
create table x(d datetime)
insert into x values ('30/06/2002')
insert into x values ('09/30/2002')
select * from x
drop table x
set language British
exec sp_helplanguage @.@.language
create table x(d datetime)
insert into x values ('30/06/2002')
insert into x values ('09/30/2002')
select * from x
drop table x
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Niles" <Niles@.discussions.microsoft.com> wrote in message
news:164CBB03-BCA1-41DB-96A9-6739B33547F7@.microsoft.com...
> I have an application that is sending the date with the following format
dd/mm/yyyy the field in the table in sql is a datetime and the record is not
being inserted. If I manually change the value in the query analyzer to
mm/dd/yyyy the record is inserted successfully. How can I change the data
type to accept the values as is
> Thanks
|||does the set language command do that at the server level or database level or table level or field level?
can I change the datetime field in my db table to accept european time?
"Gregory A. Larsen" wrote:

> Have you check what the dateformat for the language you are using. You can
> do this by issuing the following command:
> sp_helplanguage @.@.language
> If you want a different format then your langauge format you can change it
> by using the SET DATEFORMAT.
> Here is an example of where I used two different language. In these
> examples us_english like mm/dd/yyyy format and British like dd/mm/yyyy.
> Hopefully this will give you some ideas on how to fix you problem.
> set language us_english
> exec sp_helplanguage @.@.language
> create table x(d datetime)
> insert into x values ('30/06/2002')
> insert into x values ('09/30/2002')
> select * from x
> drop table x
> set language British
> exec sp_helplanguage @.@.language
> create table x(d datetime)
> insert into x values ('30/06/2002')
> insert into x values ('09/30/2002')
> select * from x
> drop table x
> --
> ----
> ----
> --
> Need SQL Server Examples check out my website at
> http://www.geocities.com/sqlserverexamples
> "Niles" <Niles@.discussions.microsoft.com> wrote in message
> news:164CBB03-BCA1-41DB-96A9-6739B33547F7@.microsoft.com...
> dd/mm/yyyy the field in the table in sql is a datetime and the record is not
> being inserted. If I manually change the value in the query analyzer to
> mm/dd/yyyy the record is inserted successfully. How can I change the data
> type to accept the values as is
>
>
|||I'm not sure what you are trying to do, but I don't think you want to mess
with your language setting. The "set language" command is only in affect
for the session. What I really think you need is to use the "set
dateformat" statement to control the format of your input data. Sorry for
the confusion. Something like this:
create table x(d datetime)
set dateformat dmy
insert into x values ('30/06/2002')
set dateformat mdy
insert into x values ('09/30/2002')
select * from x
drop table x
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Niles" <Niles@.discussions.microsoft.com> wrote in message
news:5F4A1DCC-329E-4232-8661-26212099F305@.microsoft.com...
> does the set language command do that at the server level or database
level or table level or field level?[vbcol=seagreen]
> can I change the datetime field in my db table to accept european time?
> "Gregory A. Larsen" wrote:
can[vbcol=seagreen]
it
> ----
--
> ----
--[vbcol=seagreen]
format[vbcol=seagreen]
not[vbcol=seagreen]
data[vbcol=seagreen]
|||Well, this is a vendor product. you're right, I don't want to change the language The tables are already created and i can't make any changes to the front end. It is a european vendor. The system came with an MSDE database. I am trying to switch it to
an enterprise version of sql 2000. When I made the switch, data wasn't being written to the main table. After running a trace, I noticed that the insert to that table was failing because the datetime that was being inserted was in European format and t
he datetime field was rejecting that. Changing the data type to varchar allowed the insert but I don't want to keep it as varchar obviously. Can this issue be fixed with some change to the Datetime field (like some formula or something), any other sugge
stions? I am not sure where to use set dateformat
thanks
"Gregory A. Larsen" wrote:

> I'm not sure what you are trying to do, but I don't think you want to mess
> with your language setting. The "set language" command is only in affect
> for the session. What I really think you need is to use the "set
> dateformat" statement to control the format of your input data. Sorry for
> the confusion. Something like this:
>
> create table x(d datetime)
> set dateformat dmy
> insert into x values ('30/06/2002')
> set dateformat mdy
> insert into x values ('09/30/2002')
> select * from x
> drop table x
>
> --
> ----
> ----
> --
> Need SQL Server Examples check out my website at
> http://www.geocities.com/sqlserverexamples
> "Niles" <Niles@.discussions.microsoft.com> wrote in message
> news:5F4A1DCC-329E-4232-8661-26212099F305@.microsoft.com...
> level or table level or field level?
> can
> it
> --
> --
> format
> not
> data
>
>
|||http://www.karaszi.com/SQLServer/info_datetime.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Niles" <Niles@.discussions.microsoft.com> wrote in message
news:ABC7EAEA-A16B-42D9-84B7-A1B4FE9710DB@.microsoft.com...
> Well, this is a vendor product. you're right, I don't want to change the language The tables are
already created and i can't make any changes to the front end. It is a european vendor. The system
came with an MSDE database. I am trying to switch it to an enterprise version of sql 2000. When I
made the switch, data wasn't being written to the main table. After running a trace, I noticed that
the insert to that table was failing because the datetime that was being inserted was in European
format and the datetime field was rejecting that. Changing the data type to varchar allowed the
insert but I don't want to keep it as varchar obviously. Can this issue be fixed with some change
to the Datetime field (like some formula or something), any other suggestions? I am not sure where
to use set dateformat[vbcol=seagreen]
> thanks
>
> "Gregory A. Larsen" wrote:
|||> Well, this is a vendor product.
You should give constructive feedback to the vendor that they are idiots for
relying on regional date formats like d/m/y or m/d/y.
http://www.aspfaq.com/
(Reverse address to reply.)

DateTime

I have an application that is sending the date with the following format dd/mm/yyyy the field in the table in sql is a datetime and the record is not being inserted. If I manually change the value in the query analyzer to mm/dd/yyyy the record is inserted successfully. How can I change the data type to accept the values as is
ThanksHave you check what the dateformat for the language you are using. You can
do this by issuing the following command:
sp_helplanguage @.@.language
If you want a different format then your langauge format you can change it
by using the SET DATEFORMAT.
Here is an example of where I used two different language. In these
examples us_english like mm/dd/yyyy format and British like dd/mm/yyyy.
Hopefully this will give you some ideas on how to fix you problem.
set language us_english
exec sp_helplanguage @.@.language
create table x(d datetime)
insert into x values ('30/06/2002')
insert into x values ('09/30/2002')
select * from x
drop table x
set language British
exec sp_helplanguage @.@.language
create table x(d datetime)
insert into x values ('30/06/2002')
insert into x values ('09/30/2002')
select * from x
drop table x
--
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Niles" <Niles@.discussions.microsoft.com> wrote in message
news:164CBB03-BCA1-41DB-96A9-6739B33547F7@.microsoft.com...
> I have an application that is sending the date with the following format
dd/mm/yyyy the field in the table in sql is a datetime and the record is not
being inserted. If I manually change the value in the query analyzer to
mm/dd/yyyy the record is inserted successfully. How can I change the data
type to accept the values as is
> Thanks|||does the set language command do that at the server level or database level or table level or field level?
can I change the datetime field in my db table to accept european time?
"Gregory A. Larsen" wrote:
> Have you check what the dateformat for the language you are using. You can
> do this by issuing the following command:
> sp_helplanguage @.@.language
> If you want a different format then your langauge format you can change it
> by using the SET DATEFORMAT.
> Here is an example of where I used two different language. In these
> examples us_english like mm/dd/yyyy format and British like dd/mm/yyyy.
> Hopefully this will give you some ideas on how to fix you problem.
> set language us_english
> exec sp_helplanguage @.@.language
> create table x(d datetime)
> insert into x values ('30/06/2002')
> insert into x values ('09/30/2002')
> select * from x
> drop table x
> set language British
> exec sp_helplanguage @.@.language
> create table x(d datetime)
> insert into x values ('30/06/2002')
> insert into x values ('09/30/2002')
> select * from x
> drop table x
> --
> ----
> ----
> --
> Need SQL Server Examples check out my website at
> http://www.geocities.com/sqlserverexamples
> "Niles" <Niles@.discussions.microsoft.com> wrote in message
> news:164CBB03-BCA1-41DB-96A9-6739B33547F7@.microsoft.com...
> > I have an application that is sending the date with the following format
> dd/mm/yyyy the field in the table in sql is a datetime and the record is not
> being inserted. If I manually change the value in the query analyzer to
> mm/dd/yyyy the record is inserted successfully. How can I change the data
> type to accept the values as is
> >
> > Thanks
>
>|||I'm not sure what you are trying to do, but I don't think you want to mess
with your language setting. The "set language" command is only in affect
for the session. What I really think you need is to use the "set
dateformat" statement to control the format of your input data. Sorry for
the confusion. Something like this:
create table x(d datetime)
set dateformat dmy
insert into x values ('30/06/2002')
set dateformat mdy
insert into x values ('09/30/2002')
select * from x
drop table x
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Niles" <Niles@.discussions.microsoft.com> wrote in message
news:5F4A1DCC-329E-4232-8661-26212099F305@.microsoft.com...
> does the set language command do that at the server level or database
level or table level or field level?
> can I change the datetime field in my db table to accept european time?
> "Gregory A. Larsen" wrote:
> > Have you check what the dateformat for the language you are using. You
can
> > do this by issuing the following command:
> >
> > sp_helplanguage @.@.language
> >
> > If you want a different format then your langauge format you can change
it
> > by using the SET DATEFORMAT.
> >
> > Here is an example of where I used two different language. In these
> > examples us_english like mm/dd/yyyy format and British like dd/mm/yyyy.
> > Hopefully this will give you some ideas on how to fix you problem.
> >
> > set language us_english
> > exec sp_helplanguage @.@.language
> > create table x(d datetime)
> > insert into x values ('30/06/2002')
> > insert into x values ('09/30/2002')
> > select * from x
> > drop table x
> >
> > set language British
> > exec sp_helplanguage @.@.language
> > create table x(d datetime)
> > insert into x values ('30/06/2002')
> > insert into x values ('09/30/2002')
> > select * from x
> > drop table x
> > --
> >
> ----
--
> ----
--
> > --
> >
> > Need SQL Server Examples check out my website at
> > http://www.geocities.com/sqlserverexamples
> > "Niles" <Niles@.discussions.microsoft.com> wrote in message
> > news:164CBB03-BCA1-41DB-96A9-6739B33547F7@.microsoft.com...
> > > I have an application that is sending the date with the following
format
> > dd/mm/yyyy the field in the table in sql is a datetime and the record is
not
> > being inserted. If I manually change the value in the query analyzer to
> > mm/dd/yyyy the record is inserted successfully. How can I change the
data
> > type to accept the values as is
> > >
> > > Thanks
> >
> >
> >|||Well, this is a vendor product. you're right, I don't want to change the language The tables are already created and i can't make any changes to the front end. It is a european vendor. The system came with an MSDE database. I am trying to switch it to an enterprise version of sql 2000. When I made the switch, data wasn't being written to the main table. After running a trace, I noticed that the insert to that table was failing because the datetime that was being inserted was in European format and the datetime field was rejecting that. Changing the data type to varchar allowed the insert but I don't want to keep it as varchar obviously. Can this issue be fixed with some change to the Datetime field (like some formula or something), any other suggestions? I am not sure where to use set dateformat
thanks
"Gregory A. Larsen" wrote:
> I'm not sure what you are trying to do, but I don't think you want to mess
> with your language setting. The "set language" command is only in affect
> for the session. What I really think you need is to use the "set
> dateformat" statement to control the format of your input data. Sorry for
> the confusion. Something like this:
>
> create table x(d datetime)
> set dateformat dmy
> insert into x values ('30/06/2002')
> set dateformat mdy
> insert into x values ('09/30/2002')
> select * from x
> drop table x
>
> --
> ----
> ----
> --
> Need SQL Server Examples check out my website at
> http://www.geocities.com/sqlserverexamples
> "Niles" <Niles@.discussions.microsoft.com> wrote in message
> news:5F4A1DCC-329E-4232-8661-26212099F305@.microsoft.com...
> > does the set language command do that at the server level or database
> level or table level or field level?
> > can I change the datetime field in my db table to accept european time?
> >
> > "Gregory A. Larsen" wrote:
> >
> > > Have you check what the dateformat for the language you are using. You
> can
> > > do this by issuing the following command:
> > >
> > > sp_helplanguage @.@.language
> > >
> > > If you want a different format then your langauge format you can change
> it
> > > by using the SET DATEFORMAT.
> > >
> > > Here is an example of where I used two different language. In these
> > > examples us_english like mm/dd/yyyy format and British like dd/mm/yyyy.
> > > Hopefully this will give you some ideas on how to fix you problem.
> > >
> > > set language us_english
> > > exec sp_helplanguage @.@.language
> > > create table x(d datetime)
> > > insert into x values ('30/06/2002')
> > > insert into x values ('09/30/2002')
> > > select * from x
> > > drop table x
> > >
> > > set language British
> > > exec sp_helplanguage @.@.language
> > > create table x(d datetime)
> > > insert into x values ('30/06/2002')
> > > insert into x values ('09/30/2002')
> > > select * from x
> > > drop table x
> > > --
> > >
> >
> > ----
> --
> >
> > ----
> --
> > > --
> > >
> > > Need SQL Server Examples check out my website at
> > > http://www.geocities.com/sqlserverexamples
> > > "Niles" <Niles@.discussions.microsoft.com> wrote in message
> > > news:164CBB03-BCA1-41DB-96A9-6739B33547F7@.microsoft.com...
> > > > I have an application that is sending the date with the following
> format
> > > dd/mm/yyyy the field in the table in sql is a datetime and the record is
> not
> > > being inserted. If I manually change the value in the query analyzer to
> > > mm/dd/yyyy the record is inserted successfully. How can I change the
> data
> > > type to accept the values as is
> > > >
> > > > Thanks
> > >
> > >
> > >
>
>|||http://www.karaszi.com/SQLServer/info_datetime.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Niles" <Niles@.discussions.microsoft.com> wrote in message
news:ABC7EAEA-A16B-42D9-84B7-A1B4FE9710DB@.microsoft.com...
> Well, this is a vendor product. you're right, I don't want to change the language The tables are
already created and i can't make any changes to the front end. It is a european vendor. The system
came with an MSDE database. I am trying to switch it to an enterprise version of sql 2000. When I
made the switch, data wasn't being written to the main table. After running a trace, I noticed that
the insert to that table was failing because the datetime that was being inserted was in European
format and the datetime field was rejecting that. Changing the data type to varchar allowed the
insert but I don't want to keep it as varchar obviously. Can this issue be fixed with some change
to the Datetime field (like some formula or something), any other suggestions? I am not sure where
to use set dateformat
> thanks
>
> "Gregory A. Larsen" wrote:
> > I'm not sure what you are trying to do, but I don't think you want to mess
> > with your language setting. The "set language" command is only in affect
> > for the session. What I really think you need is to use the "set
> > dateformat" statement to control the format of your input data. Sorry for
> > the confusion. Something like this:
> >
> >
> > create table x(d datetime)
> > set dateformat dmy
> > insert into x values ('30/06/2002')
> > set dateformat mdy
> > insert into x values ('09/30/2002')
> > select * from x
> > drop table x
> >
> >
> > --
> >
> > ----
> > ----
> > --
> >
> > Need SQL Server Examples check out my website at
> > http://www.geocities.com/sqlserverexamples
> > "Niles" <Niles@.discussions.microsoft.com> wrote in message
> > news:5F4A1DCC-329E-4232-8661-26212099F305@.microsoft.com...
> > > does the set language command do that at the server level or database
> > level or table level or field level?
> > > can I change the datetime field in my db table to accept european time?
> > >
> > > "Gregory A. Larsen" wrote:
> > >
> > > > Have you check what the dateformat for the language you are using. You
> > can
> > > > do this by issuing the following command:
> > > >
> > > > sp_helplanguage @.@.language
> > > >
> > > > If you want a different format then your langauge format you can change
> > it
> > > > by using the SET DATEFORMAT.
> > > >
> > > > Here is an example of where I used two different language. In these
> > > > examples us_english like mm/dd/yyyy format and British like dd/mm/yyyy.
> > > > Hopefully this will give you some ideas on how to fix you problem.
> > > >
> > > > set language us_english
> > > > exec sp_helplanguage @.@.language
> > > > create table x(d datetime)
> > > > insert into x values ('30/06/2002')
> > > > insert into x values ('09/30/2002')
> > > > select * from x
> > > > drop table x
> > > >
> > > > set language British
> > > > exec sp_helplanguage @.@.language
> > > > create table x(d datetime)
> > > > insert into x values ('30/06/2002')
> > > > insert into x values ('09/30/2002')
> > > > select * from x
> > > > drop table x
> > > > --
> > > >
> > >
> > > ----
> > --
> > >
> > > ----
> > --
> > > > --
> > > >
> > > > Need SQL Server Examples check out my website at
> > > > http://www.geocities.com/sqlserverexamples
> > > > "Niles" <Niles@.discussions.microsoft.com> wrote in message
> > > > news:164CBB03-BCA1-41DB-96A9-6739B33547F7@.microsoft.com...
> > > > > I have an application that is sending the date with the following
> > format
> > > > dd/mm/yyyy the field in the table in sql is a datetime and the record is
> > not
> > > > being inserted. If I manually change the value in the query analyzer to
> > > > mm/dd/yyyy the record is inserted successfully. How can I change the
> > data
> > > > type to accept the values as is
> > > > >
> > > > > Thanks
> > > >
> > > >
> > > >
> >
> >
> >|||> Well, this is a vendor product.
You should give constructive feedback to the vendor that they are idiots for
relying on regional date formats like d/m/y or m/d/y.
--
http://www.aspfaq.com/
(Reverse address to reply.)

DateTime

I have an application that is sending the date with the following format dd/
mm/yyyy the field in the table in sql is a datetime and the record is not be
ing inserted. If I manually change the value in the query analyzer to mm/dd
/yyyy the record is inserte
d successfully. How can I change the data type to accept the values as is
ThanksHave you check what the dateformat for the language you are using. You can
do this by issuing the following command:
sp_helplanguage @.@.language
If you want a different format then your langauge format you can change it
by using the SET DATEFORMAT.
Here is an example of where I used two different language. In these
examples us_english like mm/dd/yyyy format and British like dd/mm/yyyy.
Hopefully this will give you some ideas on how to fix you problem.
set language us_english
exec sp_helplanguage @.@.language
create table x(d datetime)
insert into x values ('30/06/2002')
insert into x values ('09/30/2002')
select * from x
drop table x
set language British
exec sp_helplanguage @.@.language
create table x(d datetime)
insert into x values ('30/06/2002')
insert into x values ('09/30/2002')
select * from x
drop table x
--
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Niles" <Niles@.discussions.microsoft.com> wrote in message
news:164CBB03-BCA1-41DB-96A9-6739B33547F7@.microsoft.com...
> I have an application that is sending the date with the following format
dd/mm/yyyy the field in the table in sql is a datetime and the record is not
being inserted. If I manually change the value in the query analyzer to
mm/dd/yyyy the record is inserted successfully. How can I change the data
type to accept the values as is
> Thanks|||does the set language command do that at the server level or database level
or table level or field level?
can I change the datetime field in my db table to accept european time?
"Gregory A. Larsen" wrote:

> Have you check what the dateformat for the language you are using. You ca
n
> do this by issuing the following command:
> sp_helplanguage @.@.language
> If you want a different format then your langauge format you can change it
> by using the SET DATEFORMAT.
> Here is an example of where I used two different language. In these
> examples us_english like mm/dd/yyyy format and British like dd/mm/yyyy.
> Hopefully this will give you some ideas on how to fix you problem.
> set language us_english
> exec sp_helplanguage @.@.language
> create table x(d datetime)
> insert into x values ('30/06/2002')
> insert into x values ('09/30/2002')
> select * from x
> drop table x
> set language British
> exec sp_helplanguage @.@.language
> create table x(d datetime)
> insert into x values ('30/06/2002')
> insert into x values ('09/30/2002')
> select * from x
> drop table x
> --
> ----
--
> ----
--
> --
> Need SQL Server Examples check out my website at
> http://www.geocities.com/sqlserverexamples
> "Niles" <Niles@.discussions.microsoft.com> wrote in message
> news:164CBB03-BCA1-41DB-96A9-6739B33547F7@.microsoft.com...
> dd/mm/yyyy the field in the table in sql is a datetime and the record is n
ot
> being inserted. If I manually change the value in the query analyzer to
> mm/dd/yyyy the record is inserted successfully. How can I change the data
> type to accept the values as is
>
>|||I'm not sure what you are trying to do, but I don't think you want to mess
with your language setting. The "set language" command is only in affect
for the session. What I really think you need is to use the "set
dateformat" statement to control the format of your input data. Sorry for
the confusion. Something like this:
create table x(d datetime)
set dateformat dmy
insert into x values ('30/06/2002')
set dateformat mdy
insert into x values ('09/30/2002')
select * from x
drop table x
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Niles" <Niles@.discussions.microsoft.com> wrote in message
news:5F4A1DCC-329E-4232-8661-26212099F305@.microsoft.com...
> does the set language command do that at the server level or database
level or table level or field level?
> can I change the datetime field in my db table to accept european time?
> "Gregory A. Larsen" wrote:
>
can[vbcol=seagreen]
it[vbcol=seagreen]
> ----
--
> ----
--[vbcol=seagreen]
format[vbcol=seagreen]
not[vbcol=seagreen]
data[vbcol=seagreen]|||Well, this is a vendor product. you're right, I don't want to change the la
nguage The tables are already created and i can't make any changes to the fr
ont end. It is a european vendor. The system came with an MSDE database.
I am trying to switch it to
an enterprise version of sql 2000. When I made the switch, data wasn't bein
g written to the main table. After running a trace, I noticed that the inse
rt to that table was failing because the datetime that was being inserted wa
s in European format and t
he datetime field was rejecting that. Changing the data type to varchar all
owed the insert but I don't want to keep it as varchar obviously. Can this
issue be fixed with some change to the Datetime field (like some formula or
something), any other sugge
stions? I am not sure where to use set dateformat
thanks
"Gregory A. Larsen" wrote:

> I'm not sure what you are trying to do, but I don't think you want to mess
> with your language setting. The "set language" command is only in affect
> for the session. What I really think you need is to use the "set
> dateformat" statement to control the format of your input data. Sorry fo
r
> the confusion. Something like this:
>
> create table x(d datetime)
> set dateformat dmy
> insert into x values ('30/06/2002')
> set dateformat mdy
> insert into x values ('09/30/2002')
> select * from x
> drop table x
>
> --
> ----
--
> ----
--
> --
> Need SQL Server Examples check out my website at
> http://www.geocities.com/sqlserverexamples
> "Niles" <Niles@.discussions.microsoft.com> wrote in message
> news:5F4A1DCC-329E-4232-8661-26212099F305@.microsoft.com...
> level or table level or field level?
> can
> it
> --
> --
> format
> not
> data
>
>|||http://www.karaszi.com/SQLServer/info_datetime.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Niles" <Niles@.discussions.microsoft.com> wrote in message
news:ABC7EAEA-A16B-42D9-84B7-A1B4FE9710DB@.microsoft.com...
> Well, this is a vendor product. you're right, I don't want to change the language
The tables are
already created and i can't make any changes to the front end. It is a euro
pean vendor. The system
came with an MSDE database. I am trying to switch it to an enterprise versi
on of sql 2000. When I
made the switch, data wasn't being written to the main table. After running
a trace, I noticed that
the insert to that table was failing because the datetime that was being ins
erted was in European
format and the datetime field was rejecting that. Changing the data type to
varchar allowed the
insert but I don't want to keep it as varchar obviously. Can this issue be
fixed with some change
to the Datetime field (like some formula or something), any other suggestion
s? I am not sure where
to use set dateformat[vbcol=seagreen]
> thanks
>
> "Gregory A. Larsen" wrote:
>|||> Well, this is a vendor product.
You should give constructive feedback to the vendor that they are idiots for
relying on regional date formats like d/m/y or m/d/y.
http://www.aspfaq.com/
(Reverse address to reply.)