What ius the synthax to backup an SQLServer DB from the command line ?
ThanksUse the OSQL utility. Type:
OSQL h
at the command line to get a list of parameters for specifying a server, database, login, etc. You can use the OSQL utility to run a simple BACKUP command, or you can specify a batch file of SQL commands to perform your maintenance.sql
Showing posts with label line. Show all posts
Showing posts with label line. Show all posts
Thursday, March 29, 2012
Tuesday, March 27, 2012
DB Access from different m/c
when i access the database from different DB server getting the following error
Msg 18452, Sev 14, State 1, Line 1 : Login failed for user ''. The user is not associated with a trusted SQL Server connection. [SQLSTATE 28000]
Thanks,
Ravinder
HTH, jens Suessmeyer.
http://www.sqlserver2005.de
Friday, February 17, 2012
DATEDIFF order by problem
Hello All,
Could any body tell me what the problem is with this select is giving
me:
(SQL Server 2000)
Server: Msg 156, Level 15, State 1, Line 23
Incorrect syntax near the keyword 'order'.
It runs fine when I take out the joins...
Any help is appreciated, here is the select:
____________________________________________
selectObj.serial,Obj.partnum, partlist.type, Obj.location,
Obj.datecreated, Obj.qty,
AgeInDays = DATEDIFF(DAY, Obj.datecreated, GETDATE()),
Cost.Cost, Cost.Material, Cost.Labor, Cost.Burden, Cost.Other
fromObj
joinPartlist
onObj.partnum = partlist.partnum
joinparts
onobj.partnum = parts.part
whereDATEDIFF(DAY, obj.datecreated, GETDATE())
order by
obj.location,
obj.partnum
______________________________________________
"Aenim" <mackdaddiee@.hotmail.com> wrote in message
news:1132267505.409803.158760@.g14g2000cwa.googlegr oups.com...
> Hello All,
> Could any body tell me what the problem is with this select is giving
> me:
> (SQL Server 2000)
> Server: Msg 156, Level 15, State 1, Line 23
> Incorrect syntax near the keyword 'order'.
> It runs fine when I take out the joins...
> Any help is appreciated, here is the select:
> ____________________________________________
> select Obj.serial, Obj.partnum, partlist.type, Obj.location,
> Obj.datecreated, Obj.qty,
> AgeInDays = DATEDIFF(DAY, Obj.datecreated, GETDATE()),
> Cost.Cost, Cost.Material, Cost.Labor, Cost.Burden, Cost.Other
> from Obj
> join Partlist
> on Obj.partnum = partlist.partnum
> join parts
> on obj.partnum = parts.part
> where DATEDIFF(DAY, obj.datecreated, GETDATE())
> order by
> obj.location,
> obj.partnum
> ______________________________________________
>
This line is incomplete:
where DATEDIFF(DAY, obj.datecreated, GETDATE())
Presumably you meant:
where DATEDIFF(DAY, obj.datecreated, GETDATE()) = ? ... something?
David Portas
SQL Server MVP
|||Well yes... I guess... but what do I need if I want all dates in that
table?
|||Aenim wrote:
> Well yes... I guess... but what do I need if I want all dates in that
> table?
In that case remove the WHERE clause altogether.
David Portas
SQL Server MVP
|||On 17 Nov 2005 15:26:17 -0800, "Aenim" <mackdaddiee@.hotmail.com>
wrote:
>Well yes... I guess... but what do I need if I want all dates in that
>table?
Omit the where clause!
J.
Could any body tell me what the problem is with this select is giving
me:
(SQL Server 2000)
Server: Msg 156, Level 15, State 1, Line 23
Incorrect syntax near the keyword 'order'.
It runs fine when I take out the joins...
Any help is appreciated, here is the select:
____________________________________________
selectObj.serial,Obj.partnum, partlist.type, Obj.location,
Obj.datecreated, Obj.qty,
AgeInDays = DATEDIFF(DAY, Obj.datecreated, GETDATE()),
Cost.Cost, Cost.Material, Cost.Labor, Cost.Burden, Cost.Other
fromObj
joinPartlist
onObj.partnum = partlist.partnum
joinparts
onobj.partnum = parts.part
whereDATEDIFF(DAY, obj.datecreated, GETDATE())
order by
obj.location,
obj.partnum
______________________________________________
"Aenim" <mackdaddiee@.hotmail.com> wrote in message
news:1132267505.409803.158760@.g14g2000cwa.googlegr oups.com...
> Hello All,
> Could any body tell me what the problem is with this select is giving
> me:
> (SQL Server 2000)
> Server: Msg 156, Level 15, State 1, Line 23
> Incorrect syntax near the keyword 'order'.
> It runs fine when I take out the joins...
> Any help is appreciated, here is the select:
> ____________________________________________
> select Obj.serial, Obj.partnum, partlist.type, Obj.location,
> Obj.datecreated, Obj.qty,
> AgeInDays = DATEDIFF(DAY, Obj.datecreated, GETDATE()),
> Cost.Cost, Cost.Material, Cost.Labor, Cost.Burden, Cost.Other
> from Obj
> join Partlist
> on Obj.partnum = partlist.partnum
> join parts
> on obj.partnum = parts.part
> where DATEDIFF(DAY, obj.datecreated, GETDATE())
> order by
> obj.location,
> obj.partnum
> ______________________________________________
>
This line is incomplete:
where DATEDIFF(DAY, obj.datecreated, GETDATE())
Presumably you meant:
where DATEDIFF(DAY, obj.datecreated, GETDATE()) = ? ... something?
David Portas
SQL Server MVP
|||Well yes... I guess... but what do I need if I want all dates in that
table?
|||Aenim wrote:
> Well yes... I guess... but what do I need if I want all dates in that
> table?
In that case remove the WHERE clause altogether.
David Portas
SQL Server MVP
|||On 17 Nov 2005 15:26:17 -0800, "Aenim" <mackdaddiee@.hotmail.com>
wrote:
>Well yes... I guess... but what do I need if I want all dates in that
>table?
Omit the where clause!
J.
DATEDIFF order by problem
Hello All,
Could any body tell me what the problem is with this select is giving
me:
(SQL Server 2000)
Server: Msg 156, Level 15, State 1, Line 23
Incorrect syntax near the keyword 'order'.
It runs fine when I take out the joins...
Any help is appreciated, here is the select:
________________________________________
____
select Obj.serial, Obj.partnum, partlist.type, Obj.location,
Obj.datecreated, Obj.qty,
AgeInDays = DATEDIFF(DAY, Obj.datecreated, GETDATE()),
Cost.Cost, Cost.Material, Cost.Labor, Cost.Burden, Cost.Other
from Obj
join Partlist
on Obj.partnum = partlist.partnum
join parts
on obj.partnum = parts.part
where DATEDIFF(DAY, obj.datecreated, GETDATE())
order by
obj.location,
obj.partnum
________________________________________
______"Aenim" <mackdaddiee@.hotmail.com> wrote in message
news:1132267505.409803.158760@.g14g2000cwa.googlegroups.com...
> Hello All,
> Could any body tell me what the problem is with this select is giving
> me:
> (SQL Server 2000)
> Server: Msg 156, Level 15, State 1, Line 23
> Incorrect syntax near the keyword 'order'.
> It runs fine when I take out the joins...
> Any help is appreciated, here is the select:
> ________________________________________
____
> select Obj.serial, Obj.partnum, partlist.type, Obj.location,
> Obj.datecreated, Obj.qty,
> AgeInDays = DATEDIFF(DAY, Obj.datecreated, GETDATE()),
> Cost.Cost, Cost.Material, Cost.Labor, Cost.Burden, Cost.Other
> from Obj
> join Partlist
> on Obj.partnum = partlist.partnum
> join parts
> on obj.partnum = parts.part
> where DATEDIFF(DAY, obj.datecreated, GETDATE())
> order by
> obj.location,
> obj.partnum
> ________________________________________
______
>
This line is incomplete:
where DATEDIFF(DAY, obj.datecreated, GETDATE())
Presumably you meant:
where DATEDIFF(DAY, obj.datecreated, GETDATE()) = ' ... something?
David Portas
SQL Server MVP
--|||Well yes... I guess... but what do I need if I want all dates in that
table?|||Aenim wrote:
> Well yes... I guess... but what do I need if I want all dates in that
> table?
In that case remove the WHERE clause altogether.
David Portas
SQL Server MVP
--|||On 17 Nov 2005 15:26:17 -0800, "Aenim" <mackdaddiee@.hotmail.com>
wrote:
>Well yes... I guess... but what do I need if I want all dates in that
>table?
Omit the where clause!
J.
Could any body tell me what the problem is with this select is giving
me:
(SQL Server 2000)
Server: Msg 156, Level 15, State 1, Line 23
Incorrect syntax near the keyword 'order'.
It runs fine when I take out the joins...
Any help is appreciated, here is the select:
________________________________________
____
select Obj.serial, Obj.partnum, partlist.type, Obj.location,
Obj.datecreated, Obj.qty,
AgeInDays = DATEDIFF(DAY, Obj.datecreated, GETDATE()),
Cost.Cost, Cost.Material, Cost.Labor, Cost.Burden, Cost.Other
from Obj
join Partlist
on Obj.partnum = partlist.partnum
join parts
on obj.partnum = parts.part
where DATEDIFF(DAY, obj.datecreated, GETDATE())
order by
obj.location,
obj.partnum
________________________________________
______"Aenim" <mackdaddiee@.hotmail.com> wrote in message
news:1132267505.409803.158760@.g14g2000cwa.googlegroups.com...
> Hello All,
> Could any body tell me what the problem is with this select is giving
> me:
> (SQL Server 2000)
> Server: Msg 156, Level 15, State 1, Line 23
> Incorrect syntax near the keyword 'order'.
> It runs fine when I take out the joins...
> Any help is appreciated, here is the select:
> ________________________________________
____
> select Obj.serial, Obj.partnum, partlist.type, Obj.location,
> Obj.datecreated, Obj.qty,
> AgeInDays = DATEDIFF(DAY, Obj.datecreated, GETDATE()),
> Cost.Cost, Cost.Material, Cost.Labor, Cost.Burden, Cost.Other
> from Obj
> join Partlist
> on Obj.partnum = partlist.partnum
> join parts
> on obj.partnum = parts.part
> where DATEDIFF(DAY, obj.datecreated, GETDATE())
> order by
> obj.location,
> obj.partnum
> ________________________________________
______
>
This line is incomplete:
where DATEDIFF(DAY, obj.datecreated, GETDATE())
Presumably you meant:
where DATEDIFF(DAY, obj.datecreated, GETDATE()) = ' ... something?
David Portas
SQL Server MVP
--|||Well yes... I guess... but what do I need if I want all dates in that
table?|||Aenim wrote:
> Well yes... I guess... but what do I need if I want all dates in that
> table?
In that case remove the WHERE clause altogether.
David Portas
SQL Server MVP
--|||On 17 Nov 2005 15:26:17 -0800, "Aenim" <mackdaddiee@.hotmail.com>
wrote:
>Well yes... I guess... but what do I need if I want all dates in that
>table?
Omit the where clause!
J.
DATEDIFF order by problem
Hello All,
Could any body tell me what the problem is with this select is giving
me:
(SQL Server 2000)
Server: Msg 156, Level 15, State 1, Line 23
Incorrect syntax near the keyword 'order'.
It runs fine when I take out the joins...
Any help is appreciated, here is the select:
____________________________________________
select Obj.serial, Obj.partnum, partlist.type, Obj.location,
Obj.datecreated, Obj.qty,
AgeInDays = DATEDIFF(DAY, Obj.datecreated, GETDATE()),
Cost.Cost, Cost.Material, Cost.Labor, Cost.Burden, Cost.Other
from Obj
join Partlist
on Obj.partnum = partlist.partnum
join parts
on obj.partnum = parts.part
where DATEDIFF(DAY, obj.datecreated, GETDATE())
order by
obj.location,
obj.partnum
______________________________________________"Aenim" <mackdaddiee@.hotmail.com> wrote in message
news:1132267505.409803.158760@.g14g2000cwa.googlegroups.com...
> Hello All,
> Could any body tell me what the problem is with this select is giving
> me:
> (SQL Server 2000)
> Server: Msg 156, Level 15, State 1, Line 23
> Incorrect syntax near the keyword 'order'.
> It runs fine when I take out the joins...
> Any help is appreciated, here is the select:
> ____________________________________________
> select Obj.serial, Obj.partnum, partlist.type, Obj.location,
> Obj.datecreated, Obj.qty,
> AgeInDays = DATEDIFF(DAY, Obj.datecreated, GETDATE()),
> Cost.Cost, Cost.Material, Cost.Labor, Cost.Burden, Cost.Other
> from Obj
> join Partlist
> on Obj.partnum = partlist.partnum
> join parts
> on obj.partnum = parts.part
> where DATEDIFF(DAY, obj.datecreated, GETDATE())
> order by
> obj.location,
> obj.partnum
> ______________________________________________
>
This line is incomplete:
where DATEDIFF(DAY, obj.datecreated, GETDATE())
Presumably you meant:
where DATEDIFF(DAY, obj.datecreated, GETDATE()) = ' ... something?
--
David Portas
SQL Server MVP
--|||Well yes... I guess... but what do I need if I want all dates in that
table?|||Aenim wrote:
> Well yes... I guess... but what do I need if I want all dates in that
> table?
In that case remove the WHERE clause altogether.
--
David Portas
SQL Server MVP
--|||On 17 Nov 2005 15:26:17 -0800, "Aenim" <mackdaddiee@.hotmail.com>
wrote:
>Well yes... I guess... but what do I need if I want all dates in that
>table?
Omit the where clause!
J.
Could any body tell me what the problem is with this select is giving
me:
(SQL Server 2000)
Server: Msg 156, Level 15, State 1, Line 23
Incorrect syntax near the keyword 'order'.
It runs fine when I take out the joins...
Any help is appreciated, here is the select:
____________________________________________
select Obj.serial, Obj.partnum, partlist.type, Obj.location,
Obj.datecreated, Obj.qty,
AgeInDays = DATEDIFF(DAY, Obj.datecreated, GETDATE()),
Cost.Cost, Cost.Material, Cost.Labor, Cost.Burden, Cost.Other
from Obj
join Partlist
on Obj.partnum = partlist.partnum
join parts
on obj.partnum = parts.part
where DATEDIFF(DAY, obj.datecreated, GETDATE())
order by
obj.location,
obj.partnum
______________________________________________"Aenim" <mackdaddiee@.hotmail.com> wrote in message
news:1132267505.409803.158760@.g14g2000cwa.googlegroups.com...
> Hello All,
> Could any body tell me what the problem is with this select is giving
> me:
> (SQL Server 2000)
> Server: Msg 156, Level 15, State 1, Line 23
> Incorrect syntax near the keyword 'order'.
> It runs fine when I take out the joins...
> Any help is appreciated, here is the select:
> ____________________________________________
> select Obj.serial, Obj.partnum, partlist.type, Obj.location,
> Obj.datecreated, Obj.qty,
> AgeInDays = DATEDIFF(DAY, Obj.datecreated, GETDATE()),
> Cost.Cost, Cost.Material, Cost.Labor, Cost.Burden, Cost.Other
> from Obj
> join Partlist
> on Obj.partnum = partlist.partnum
> join parts
> on obj.partnum = parts.part
> where DATEDIFF(DAY, obj.datecreated, GETDATE())
> order by
> obj.location,
> obj.partnum
> ______________________________________________
>
This line is incomplete:
where DATEDIFF(DAY, obj.datecreated, GETDATE())
Presumably you meant:
where DATEDIFF(DAY, obj.datecreated, GETDATE()) = ' ... something?
--
David Portas
SQL Server MVP
--|||Well yes... I guess... but what do I need if I want all dates in that
table?|||Aenim wrote:
> Well yes... I guess... but what do I need if I want all dates in that
> table?
In that case remove the WHERE clause altogether.
--
David Portas
SQL Server MVP
--|||On 17 Nov 2005 15:26:17 -0800, "Aenim" <mackdaddiee@.hotmail.com>
wrote:
>Well yes... I guess... but what do I need if I want all dates in that
>table?
Omit the where clause!
J.
Subscribe to:
Posts (Atom)