Wednesday, March 28, 2012
Outlook + SQL 2000 SP4 on Windows 2003 2node Active/Passive Cluste
I have only "heard" that installing Outlook on Windows 2003 cluster running
SQL 2000 might create problems.
Has anyone actually experienced this ? Or am I just hearing rumours.
I would like to install Outlook provided there is no down side to it. What
are the alternatives to Outlook or MAPI all together.
Thanks in advance.Hi
I have not heard of any Outlook/Cluster issue as such but..
it may be the only way of getting Extended MAPI installed on the system
without breaking any licencing agreement or installing exchange server. You
would need to set up exactly the same profile on both side of the cluster.
If you are using a SMTP server (such as excahnge) then you could use XP_SMTP
instead http://www.sqldev.net/xp/xpsmtp.htm
John
"kunalap" wrote:
> Hi
> I have only "heard" that installing Outlook on Windows 2003 cluster runnin
g
> SQL 2000 might create problems.
> Has anyone actually experienced this ? Or am I just hearing rumours.
> I would like to install Outlook provided there is no down side to it. What
> are the alternatives to Outlook or MAPI all together.
> Thanks in advance.
>|||"kunalap" <kunalap@.discussions.microsoft.com> wrote in message
news:22DB6194-4E10-4D29-A0D6-4C15B5C5D21D@.microsoft.com...
> Hi
> I have only "heard" that installing Outlook on Windows 2003 cluster
running
> SQL 2000 might create problems.
> Has anyone actually experienced this ? Or am I just hearing rumours.
>
We have done this. The best advice as others have said is make sure the
profile is exactly the same on both servers.
If you're not connecting to an Exchange server,but say just using SMTP to
SEND message from SQL Server, I'd recommend installing a local SMTP instance
on each node and using that to rely the messages.
Have SQL Mail send to the local copy of the SMTP server. That eliminates a
lot of situations where the MAPI client will hang.
> I would like to install Outlook provided there is no down side to it. What
> are the alternatives to Outlook or MAPI all together.
> Thanks in advance.
>
outher joins formats
I work ith sql server 2000 and i need know the diferent
of joins in format not ansi ( with * ) and joins in format
ansi ( with 'outher join on' ).
Two format work equal ?
What is de correct format ?
Thank you.
R.ragaza@.ozu.es (raulgz) wrote in message news:<9b551742.0403040208.51bb41d1@.posting.google.com>...
> Hi
> I work ith sql server 2000 and i need know the diferent
> of joins in format not ansi ( with * ) and joins in format
> ansi ( with 'outher join on' ).
>
> Two format work equal ?
>
> What is de correct format ?
>
> Thank you.
>
> R.
You should always use the ANSI syntax, because the 'old style' joins
are unclear, and some queries cannot be written at all with them. In
addition, Microsoft may stop supporting the old syntax in a future
version of MSSQL.
In an outer join, you need to separate the join condition (in the JOIN
clause) from the filter conditions (in the WHERE clause) to make sure
you get consistent results. In the old style join, all the conditions
are together in the WHERE clause, so the database engine has to
'guess' at what you meant, and the results may not be what you want.
This KB article shows the difference:
http://support.microsoft.com/defaul...0&Product=sql2k
Simon|||Read more about this by downloading SQL books online free from
http://www.microsoft.com/sql
INNER JOIN FORMATS (only identical rows)
select *
from tablea, tableb
where tablea.id = tableb.id
select *
from tablea inner join tableb
on tablea.id = tableb.id
RIGHT OUTER JOIN FORMATS (all rows on right, shows null on left where no
match)
select *
from tablea, tableb
where tablea.id =* tableb.id
SELECT *
from tablea right outer join tableb
on tablea.id = tableb.id
LEFT OUTER JOIN FORMATS (all rows on left, shows null on right where no
match)
select *
from tablea, tableb
where tablea.id *= tableb.id
SELECT *
from tablea left outer join tableb
on tablea.id = tableb.id
FULL OUTER JOIN FORMATS ( shows null where no match)
Select *
from tablea, tableb
where tablea.id FULL OUTER JOIN tableb.id
Select *
from tablea, tableb
where tablea.id FULL JOIN tableb.id
CROSS JOINS (cross product, all possible combinations)
select *
from tablea, tableb
select *
from tablea cross join tableb
****************************************
Andy S.
MCSE NT/2000, MCDBA SQL 7/2000
andymcdba1@.NOMORESPAM.yahoo.com
Please remove NOMORESPAM before replying.
This posting is provided "as is" with
no warranties and confers no rights.
****************************************
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Monday, March 26, 2012
Outer join query
I have a problem with a query:
Two tables:
CREATE TABLE Emp (empno INT, depno INT)
CREATE TABLE Work (empno INT, depno INT, date DATETIME)
I want a list of all employees that belongs to a department (from Emp
table), together with ("union") all employeees WORKING on that department a
spescial day (An employee can have been borrowed from another department
which he does not belong)
Sample data
INSERT INTO Emp (empno, depno) VALUES (1,10)
INSERT INTO Emp (empno, depno) VALUES (2,10)
INSERT INTO Emp (empno, depno) VALUES (3,20)
INSERT INTO Work (empno, depno, date) VALUES (1,10,'2003-10-17')
INSERT INTO Work (empno, depno, date) VALUES (3,10,'2003-10-17')
INSERT INTO Work (empno, depno, date) VALUES (3,10,'2003-10-18')
Note that Employee 3 works on a department to which he does not belong (he
is borrowed to another department)
The following query
SELECT empno, depno, date FROM work WHERE depno = 10 AND date = '2003-10-17'
gives me this result set:
empno depno date
1 10 2003-10-17 00:00:00.000
3 10 2003-10-17 00:00:00.000
But I want employee 2 to appear in the result set as well, because he
belongs to department 10 (eaven thoug he is not working this particular day)
The result set should look like this
empno depno date
1 10 2003-10-01 00:00:00.000
2 10 NULL
3 10 2003-10-01 00:00:00.000
I have tried different approaches, but none of them is good.
Could someone please help me?
Thanks in advance
Regards,
Gunnar Vyenli
EDB-konsulent as
NORWAYSELECT empno, depno,
CASE [date] WHEN '20031017' THEN [date] END AS [date]
FROM Work
WHERE depno = 10
Date is a reserved word and shouldn't be used as a column name (it's a
pretty meaningless name for a column anyway - Date of what?)
--
David Portas
----
Please reply only to the newsgroup
--|||Thanks for your reply, but am afraid this will not do.
I need data from BOTH the tables, not only from Work.
With your query, employee 2 will not be included in the result set, because
he belongs to the Employee table.
In other words: I want a list of all employees who belongs to depno 10,
TOGETHER with all employees which does not belong to depno 10, but work on
depno 10 this particular day.
We are talking about two categories of employees:
1) All the employees who belong to depno 10 (whether they work this day or
not)
2) Those employees who does NOT belong to depno 10, BUT is working at depno
10 this date.
A new suggestion would be apprechiated.
-Gunnar
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:yrednQ5UUuzGQxKiRVn-vQ@.giganews.com...
> SELECT empno, depno,
> CASE [date] WHEN '20031017' THEN [date] END AS [date]
> FROM Work
> WHERE depno = 10
> Date is a reserved word and shouldn't be used as a column name (it's a
> pretty meaningless name for a column anyway - Date of what?)
> --
> David Portas
> ----
> Please reply only to the newsgroup
> --|||OK. Your DDL was missing any keys. Assuming the PK in Emp is empno and in
Work is (empno, date) and that there is an FK constraint on Work (empno NOT
NULL REFERENCES Emp (empno)):
SELECT COALESCE(E.empno,W.empno) AS empno, 10 AS depno, W.[date]
FROM Emp AS E
LEFT JOIN Work AS W
ON W.empno = E.empno AND W.[date] = '20031017'
WHERE E.depno = 10 OR W.depno = 10
--
David Portas
----
Please reply only to the newsgroup
--|||"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:cNednSW9WZJGaBKiRVn-vQ@.giganews.com...
> OK. Your DDL was missing any keys. Assuming the PK in Emp is empno and in
> Work is (empno, date) and that there is an FK constraint on Work (empno NOT
> NULL REFERENCES Emp (empno)):
> SELECT COALESCE(E.empno,W.empno) AS empno, 10 AS depno, W.[date]
> FROM Emp AS E
> LEFT JOIN Work AS W
> ON W.empno = E.empno AND W.[date] = '20031017'
> WHERE E.depno = 10 OR W.depno = 10
Hi David, minor aside but the call to COALESCE is unnecessary as E.empno
will do. Nice solution.
So as to not be taking up bandwidth with total triviality, here's another take.
SELECT depno, empno, MAX(work_date) AS work_date
FROM (SELECT empno, depno, "date" AS work_date
FROM Work
UNION ALL
SELECT empno, depno, NULL AS work_date
FROM Emp) AS W
WHERE depno = 10 AND
(work_date = '20031017' OR work_date IS NULL)
GROUP BY depno, empno
Regards,
jag
> --
> David Portas
> ----
> Please reply only to the newsgroup
> --
Friday, March 23, 2012
Outer Join and Inner Join
I have been intrigued a bit with the terminology of outer and inner join.
I have been using outer joins as a.orderid=b.orderid(+) which means, that even if table b doesnt have the columns corresponding to orderids in a, it would still return the request row.
I dont know what is the inner join ?? Why and how is it used, and what is the case where inner join comes in handy.
Thanx and Regards
AruneeshOriginally posted by aruneeshsalhotr
Hi
I have been intrigued a bit with the terminology of outer and inner join.
I have been using outer joins as a.orderid=b.orderid(+) which means, that even if table b doesnt have the columns corresponding to orderids in a, it would still return the request row.
I dont know what is the inner join ?? Why and how is it used, and what is the case where inner join comes in handy.
Thanx and Regards
Aruneesh
Inner join is just a regular join, without the (+).
Friday, March 9, 2012
osql syntax
I am running osql utility like this...
C:\Temp>osql -U sa -P 5a -S %ServerName% -d pubs -Q "select title, notes
from titles" -o .\out.txt -s"," -w300 -h-1
And it produces the following in "out.txt":
== start of output ==
The Busy Executive's Database Guide
,An overview of available database systems with emphasis on common business
applications. Illustrated.
...
...
...
Sushi, Anyone?
,Detailed instructions on how to make authentic Japanese sushi in your spare
time.
(18 rows affected)
== end of output ==
Can anybody tell me
(a) how to remove the "(18 rows affected)" comment
(b) how to remove the %FieldValue% right padding. Ideally I'd like the
output to be
== start of output ==
%FieldValue%,%FieldValue%
%FieldValue%,%FieldValue%
== end of output ==
Thanks for any tips.
PS My actual queries will be bigger than bcp allows. I'd prefer not to have
to write the query as:
select '"' + title + '", "' + notes + '"' from titles
Cheers,
Neil Evans-Mudie
-. . .. .-.. / .--. ... -- -. .. -.-. .--. / . ...- .- -.
... -...- -- ..- -.. .. .
e: My@.myorg.com address is a spam sink
If you wish to email me, try neilevans underscore mudie at hotmail dot com
w: http://groups.msn.com/TheEvansMudieF...ew.msnw?&pps=k
Neil
to avoid the rowcount, you can use -Q "set nocount on select title, notes
from titles". As far as I understand, you can't avoid the fixed width nature
of the output, apart from the concatenation solution you propose.
HTH,
Paul Ibison
osql syntax
I am running osql utility like this...
C:\Temp>osql -U sa -P 5a -S %ServerName% -d pubs -Q "select title, notes
from titles" -o .\out.txt -s"," -w300 -h-1
And it produces the following in "out.txt":
== start of output ==
The Busy Executive's Database Guide
,An overview of available database systems with emphasis on common business
applications. Illustrated.
...
...
...
Sushi, Anyone?
,Detailed instructions on how to make authentic Japanese sushi in your spare
time.
(18 rows affected)
== end of output ==
Can anybody tell me
(a) how to remove the "(18 rows affected)" comment
(b) how to remove the %FieldValue% right padding. Ideally I'd like the
output to be
== start of output ==
%FieldValue%,%FieldValue%
%FieldValue%,%FieldValue%
== end of output ==
Thanks for any tips.
PS My actual queries will be bigger than bcp allows. I'd prefer not to have
to write the query as:
select '"' + title + '", "' + notes + '"' from titles
Cheers,
Neil Evans-Mudie
-. . .. .-.. / .--. ... -- -. .. -.-. .--. / . ...- .- -.
... -...- -- ..- -.. .. .
e: My@.myorg.com address is a spam sink
If you wish to email me, try neilevans underscore mudie at hotmail dot com
w: http://groups.msn.com/TheEvansMudie...new.msnw?&pps=kNeil
to avoid the rowcount, you can use -Q "set nocount on select title, notes
from titles". As far as I understand, you can't avoid the fixed width nature
of the output, apart from the concatenation solution you propose.
HTH,
Paul Ibison
OSQL restore Database
I need to do a restore similar to the Restore Database in SQL Enterprise Manager using OSQL. I created an app to do the OSQL Run script command and it works fine. Is this the best way to create a setup to restore the database? Any ideas please!!
Best Regards
PhilipI'd use a VBS script. Easier then a full application...|||Thanks
Wednesday, March 7, 2012
osql command reference?
I have been looking for a complete command reference to osql. A document
that describes all possible SQL commands that you acn use. Unfortunately,
I seem too stupid :/
I haven't found:
* the complete desciption of BACKUP and RESTORE
* a way to show the table definitions.
TIA,
Stefan
At command prompt, run the following command and it will show you all
switches available for OSQL.
OSQL /?
Also see the topic "osql utility" in SQL Server 2000 Books Online.
Similarly, SQL Server Books Online has complete documentation on BACUP and
RESTORE commands.
sp_help will give you table definitions and you can generate table creation
scripts in Enterprise Manager.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Stefan M. Huber" <looseleaf@.gmx.net> wrote in message
news:opsbdo75yjs9ddfw@.news.individual.de...
Hi!
I have been looking for a complete command reference to osql. A document
that describes all possible SQL commands that you acn use. Unfortunately,
I seem too stupid :/
I haven't found:
* the complete desciption of BACKUP and RESTORE
* a way to show the table definitions.
TIA,
Stefan
|||On Mon, 19 Jul 2004 11:09:11 +0100, Narayana Vyas Kondreddi
<answer_me@.hotmail.com> wrote:
> At command prompt, run the following command and it will show you all
> switches available for OSQL.
> OSQL /?
These, I know, thanks
> Also see the topic "osql utility" in SQL Server 2000 Books Online.
> Similarly, SQL Server Books Online has complete documentation on BACUP
> and RESTORE commands.
> sp_help will give you table definitions and you can generate table
> creation scripts in Enterprise Manager.
Thanks, that helped me to find my way through. I found an online reference
at
<http://manuals.sybase.com/onlinebook...sg1250e/sqlug/>.
Stefan
|||Hi,
Books online is the best option to learn all commands and usage.
http://www.microsoft.com/sql/techinf...2000/books.asp
* the complete desciption of BACKUP and RESTORE
See backup and Restore in books online
* a way to show the table definitions.
sp_help <table_name>
* OSQL
See OSQL in books online
Thanks
Hari
MCDBA
"Stefan M. Huber" <looseleaf@.gmx.net> wrote in message
news:opsbdo75yjs9ddfw@.news.individual.de...
> Hi!
> I have been looking for a complete command reference to osql. A
document
> that describes all possible SQL commands that you acn use. Unfortunately,
> I seem too stupid :/
> I haven't found:
> * the complete desciption of BACKUP and RESTORE
> * a way to show the table definitions.
> TIA,
> Stefan
|||The online reference you found is for Sybase and is not valid for Microsoft
SQL Server. Follow Hari's link.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Stefan M. Huber" <looseleaf@.gmx.net> wrote in message
news:opsbdq5udms9ddfw@.pluto...
On Mon, 19 Jul 2004 11:09:11 +0100, Narayana Vyas Kondreddi
<answer_me@.hotmail.com> wrote:
> At command prompt, run the following command and it will show you all
> switches available for OSQL.
> OSQL /?
These, I know, thanks
> Also see the topic "osql utility" in SQL Server 2000 Books Online.
> Similarly, SQL Server Books Online has complete documentation on BACUP
> and RESTORE commands.
> sp_help will give you table definitions and you can generate table
> creation scripts in Enterprise Manager.
Thanks, that helped me to find my way through. I found an online reference
at
<http://manuals.sybase.com/onlinebook...sg1250e/sqlug/>.
Stefan
|||On Mon, 19 Jul 2004 15:57:16 +0530, Hari Prasad
<hari_prasad_k@.hotmail.com> wrote:
> Hi,
> Books online is the best option to learn all commands and usage.
> http://www.microsoft.com/sql/techinf...2000/books.asp
> * the complete desciption of BACKUP and RESTORE
> See backup and Restore in books online
> * a way to show the table definitions.
> sp_help <table_name>
> * OSQL
> See OSQL in books online
Thanks!
And while my other link isn't for MSDE, most of the things discussed there
work in MSDE as well
Stefan
|||osql is primarily a utility for running Transact-SQL statements on an
instance of SQL Server, including MSDE 2000. The primary reference for most
of the statements you can run using osql is the Transact-SQL Reference in
the SQL Server 2000 Books Online.
You can download the latest version of the SQL Server 2000 Books Online
from:
http://www.microsoft.com/sql/techinf...2000/books.asp
The latest version of the SQL Server 2000 Books Online is also published in
the MSDN Library at:
http://msdn.microsoft.com/library/?u...asp?frame=true
These are topics about running osql that are in the copy of the Books Online
in MSDN:
http://msdn.microsoft.com/library/de...asp?frame=true
http://msdn.microsoft.com/library/?u...asp?frame=true
This is the start of the Transact-SQL Reference in the MSDN copy of the
Books Online:
http://msdn.microsoft.com/library/de...asp?frame=true
Alan Brewer [MSFT]
Lead Programming Writer
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Saturday, February 25, 2012
osql batch
I want to run a batch file containg osql commands but do not want the user
to be able to see the sa password. Is there any way of doing this?
Thanks
> I want to run a batch file containg osql commands but do not want the user
> to be able to see the sa password. Is there any way of doing this?
Use trusted connection (-E parameter) instead of sql login/password.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
|||Thanks
"Dejan Sarka" wrote:
> Use trusted connection (-E parameter) instead of sql login/password.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
>
>
osql batch
I want to run a batch file containg osql commands but do not want the user
to be able to see the sa password. Is there any way of doing this?
Thanks> I want to run a batch file containg osql commands but do not want the user
> to be able to see the sa password. Is there any way of doing this?
Use trusted connection (-E parameter) instead of sql login/password.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com|||Thanks
"Dejan Sarka" wrote:
> Use trusted connection (-E parameter) instead of sql login/password.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
>
>
osql - creating a DB - permission problem.
I am trying to create a database from the command line using osql and a .sql
file. If I create the database first in the enterprise manager and then run
it - it works fine. But if the database does not exist I get:
C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
Server\90\Tools\Binn\OS
QL.EXE" -S ARIEL -d WindwardPortal -E -i
\src\RePortal\SqlScripts\SqlServer.sql
Login failed for user 'THIELEN\dave'.
[SQL Native Client]Shared Memory Provider: The system cannot open the file.
[SQL Native Client]Communication link failure
Cannot open database requested in login 'WindwardPortal'. Login fails.
The file SqlServer.sql starts with:
CREATE DATABASE [WindwardPortal]
GO
use [WindwardPortal]
GO
/****** Object: Table [dbo].[Datasource] Script Date: 11/16/2006 2:06:26
PM ******/
CREATE TABLE [dbo].[Datasource] (
[datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
any ideas?
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Since the database has not yet been created. OSQL cannot set the database
context to that database with the "-d WindwardPortal" specification. You
can remove "-d WindwardPortal" since you have a USE following the CREATE
DATABASE.
Hope this helps.
Dan Guzman
SQL Server MVP
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:1D648FD7-2565-4DFD-B3AF-1867E6B3445C@.microsoft.com...
> Hi;
> I am trying to create a database from the command line using osql and a
> .sql
> file. If I create the database first in the enterprise manager and then
> run
> it - it works fine. But if the database does not exist I get:
> C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
> Server\90\Tools\Binn\OS
> QL.EXE" -S ARIEL -d WindwardPortal -E -i
> \src\RePortal\SqlScripts\SqlServer.sql
> Login failed for user 'THIELEN\dave'.
> [SQL Native Client]Shared Memory Provider: The system cannot open the
> file.
> [SQL Native Client]Communication link failure
> Cannot open database requested in login 'WindwardPortal'. Login fails.
> The file SqlServer.sql starts with:
> CREATE DATABASE [WindwardPortal]
> GO
> use [WindwardPortal]
> GO
> /****** Object: Table [dbo].[Datasource] Script Date: 11/16/2006
> 2:06:26
> PM ******/
> CREATE TABLE [dbo].[Datasource] (
> [datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
> any ideas?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>
|||Hello,
Looks like the path for SQLServer.SQL is wrong. As a first step try login
using OSQL with out giving the database name and script name.
OSQL -S Servername -E
Thanks
Hari
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:1D648FD7-2565-4DFD-B3AF-1867E6B3445C@.microsoft.com...
> Hi;
> I am trying to create a database from the command line using osql and a
> .sql
> file. If I create the database first in the enterprise manager and then
> run
> it - it works fine. But if the database does not exist I get:
> C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
> Server\90\Tools\Binn\OS
> QL.EXE" -S ARIEL -d WindwardPortal -E -i
> \src\RePortal\SqlScripts\SqlServer.sql
> Login failed for user 'THIELEN\dave'.
> [SQL Native Client]Shared Memory Provider: The system cannot open the
> file.
> [SQL Native Client]Communication link failure
> Cannot open database requested in login 'WindwardPortal'. Login fails.
> The file SqlServer.sql starts with:
> CREATE DATABASE [WindwardPortal]
> GO
> use [WindwardPortal]
> GO
> /****** Object: Table [dbo].[Datasource] Script Date: 11/16/2006
> 2:06:26
> PM ******/
> CREATE TABLE [dbo].[Datasource] (
> [datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
> any ideas?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>
osql - creating a DB - permission problem.
I am trying to create a database from the command line using osql and a .sql
file. If I create the database first in the enterprise manager and then run
it - it works fine. But if the database does not exist I get:
C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
Server\90\Tools\Binn\OS
QL.EXE" -S ARIEL -d WindwardPortal -E -i
\src\RePortal\SqlScripts\SqlServer.sql
Login failed for user 'THIELEN\dave'.
[SQL Native Client]Shared Memory Provider: The system cannot open the fi
le.
[SQL Native Client]Communication link failure
Cannot open database requested in login 'WindwardPortal'. Login fails.
The file SqlServer.sql starts with:
CREATE DATABASE [WindwardPortal]
GO
use [WindwardPortal]
GO
/****** Object: Table [dbo].[Datasource] Script Date: 11/16/2006
2:06:26
PM ******/
CREATE TABLE [dbo].[Datasource] (
[datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
any ideas?
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htmSince the database has not yet been created. OSQL cannot set the database
context to that database with the "-d WindwardPortal" specification. You
can remove "-d WindwardPortal" since you have a USE following the CREATE
DATABASE.
Hope this helps.
Dan Guzman
SQL Server MVP
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:1D648FD7-2565-4DFD-B3AF-1867E6B3445C@.microsoft.com...
> Hi;
> I am trying to create a database from the command line using osql and a
> .sql
> file. If I create the database first in the enterprise manager and then
> run
> it - it works fine. But if the database does not exist I get:
> C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
> Server\90\Tools\Binn\OS
> QL.EXE" -S ARIEL -d WindwardPortal -E -i
> \src\RePortal\SqlScripts\SqlServer.sql
> Login failed for user 'THIELEN\dave'.
> [SQL Native Client]Shared Memory Provider: The system cannot open the
> file.
> [SQL Native Client]Communication link failure
> Cannot open database requested in login 'WindwardPortal'. Login fails.
> The file SqlServer.sql starts with:
> CREATE DATABASE [WindwardPortal]
> GO
> use [WindwardPortal]
> GO
> /****** Object: Table [dbo].[Datasource] Script Date: 11/16/20
06
> 2:06:26
> PM ******/
> CREATE TABLE [dbo].[Datasource] (
> [datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
> any ideas?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>|||Hello,
Looks like the path for SQLServer.SQL is wrong. As a first step try login
using OSQL with out giving the database name and script name.
OSQL -S Servername -E
Thanks
Hari
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:1D648FD7-2565-4DFD-B3AF-1867E6B3445C@.microsoft.com...
> Hi;
> I am trying to create a database from the command line using osql and a
> .sql
> file. If I create the database first in the enterprise manager and then
> run
> it - it works fine. But if the database does not exist I get:
> C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
> Server\90\Tools\Binn\OS
> QL.EXE" -S ARIEL -d WindwardPortal -E -i
> \src\RePortal\SqlScripts\SqlServer.sql
> Login failed for user 'THIELEN\dave'.
> [SQL Native Client]Shared Memory Provider: The system cannot open the
> file.
> [SQL Native Client]Communication link failure
> Cannot open database requested in login 'WindwardPortal'. Login fails.
> The file SqlServer.sql starts with:
> CREATE DATABASE [WindwardPortal]
> GO
> use [WindwardPortal]
> GO
> /****** Object: Table [dbo].[Datasource] Script Date: 11/16/20
06
> 2:06:26
> PM ******/
> CREATE TABLE [dbo].[Datasource] (
> [datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
> any ideas?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>