Showing posts with label line. Show all posts
Showing posts with label line. Show all posts

Sunday, March 25, 2012

Cannot reference Microsoft.SqlServer.Dts.DtsClient?

Reinstalled SqlServer 2005 and SP2. Reinstalled VS2005 and SP1. I add a reference to Microsoft.SqlServer.Dts.DtsClient. It automatically adds a line to web.config

<add assembly="Microsoft.SqlServer.Dts.DtsClient, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>

I still cannot do

using Microsoft.SqlServer.Dts.DtsClient;

I can do

using Microsoft.SqlServer.Server;

I am thinking a config file or something is missing/corrupt somewhere to prevent me from being able to correctly reference this dll. Can anyone help please?

NoRemorse,

If you're trying to configure the Reporting Service you may find the following helpful: http://msdn2.microsoft.com/en-us/library/ms345250.aspx.

HTH,

Patrik

|||I just want to be able to run an SSIS package from code. I need to have that assembly in order to get at the DTS objects. I did what that article suggested anyway but it still doesn't work. Oddly, if I create a new Windows Form project I can reference the assembly fine, so the DLL seems to be regeistered ok. But in a Web project I cannot reference it.|||I uninstalled VS team system and now it works fine. Some incompatibility there

Cannot reference derived table from a derived table in a subquery?

The follow generates the error:
Server: Msg 207, Level 16, State 3, Line 19
Invalid column name 'UserID'.
The inner derived table ("dt") cannot reference the outer derived table
("ActiveUsers") ?
Nevermind the contrived example - it is only serving to illustrate the
failing. The real situation is entirely more complex.
IF OBJECT_ID('tempdb..#Users') IS NOT NULL
DROP TABLE #Users
IF OBJECT_ID('tempdb..#Logins') IS NOT NULL
DROP TABLE #Logins
CREATE TABLE #Users (
UserID int,
Name varchar(50),
IsActive tinyint)
CREATE TABLE #Logins (
UserID int,
LoginDate datetime,
WasSecured tinyint)
SELECT
ActiveUsers.*,
( SELECT MAX(LoginDate)
FROM (
SELECT * FROM #Logins
WHERE #Logins.UserID = ActiveUsers.UserID
AND #Logins.WasSecured <> 0
) dt
) AS LastSecuredLogin
FROM (
SELECT *
FROM #Users
WHERE IsActive <> 0
) ActiveUsers
DROP TABLE #Users
DROP TABLE #LoginsTry,
SELECT
ActiveUsers.*,
l.dt AS LastSecuredLogin
FROM
#Users as ActiveUsers
left join
(
SELECT
#Logins.UserID,
MAX(LoginDate) as dt
FROM
#Logins
WHERE
#Logins.WasSecured <> 0
group by
#Logins.UserID
) as l
on l.UserID = ActiveUsers.UserID
WHERE
ActiveUsers.IsActive <> 0
go
AMB
"Ian Boyd" wrote:

> The follow generates the error:
> Server: Msg 207, Level 16, State 3, Line 19
> Invalid column name 'UserID'.
> The inner derived table ("dt") cannot reference the outer derived table
> ("ActiveUsers") ?
> Nevermind the contrived example - it is only serving to illustrate the
> failing. The real situation is entirely more complex.
>
> IF OBJECT_ID('tempdb..#Users') IS NOT NULL
> DROP TABLE #Users
> IF OBJECT_ID('tempdb..#Logins') IS NOT NULL
> DROP TABLE #Logins
> CREATE TABLE #Users (
> UserID int,
> Name varchar(50),
> IsActive tinyint)
> CREATE TABLE #Logins (
> UserID int,
> LoginDate datetime,
> WasSecured tinyint)
> SELECT
> ActiveUsers.*,
> ( SELECT MAX(LoginDate)
> FROM (
> SELECT * FROM #Logins
> WHERE #Logins.UserID = ActiveUsers.UserID
> AND #Logins.WasSecured <> 0
> ) dt
> ) AS LastSecuredLogin
> FROM (
> SELECT *
> FROM #Users
> WHERE IsActive <> 0
> ) ActiveUsers
> DROP TABLE #Users
> DROP TABLE #Logins
>
>|||Right, in your correlated subquery, you have a derived table that references
something outside of the scope of the derived table. Basically you have to
think of derived tables as views. They cannot reference anything from the
current query.
Maybe I am being a bit of a thicky, but I don't see why:
( SELECT MAX(LoginDate)
FROM ( SELECT *
FROM #Logins
WHERE #Logins.UserID = ActiveUsers.UserID
AND #Logins.WasSecured <> 0 ) dt
) AS LastSecuredLogin
cannot be rewritten as:
( SELECT max(loginDate)
FROM #Logins
WHERE #Logins.UserID = ActiveUsers.UserID
AND #Logins.WasSecured <> 0
) AS LastSecuredLogin
The only reason to do what you were doing (I think) is if you were going to
do an aggregate on an aggregate. The where clause and the groupings are
exclusive of one another, so it should work. Am I missing something?
Full Query:
SELECT
ActiveUsers.*,
( SELECT max(loginDate)
FROM #Logins
WHERE #Logins.UserID = ActiveUsers.UserID
AND #Logins.WasSecured <> 0
) AS LastSecuredLogin
FROM ( SELECT *
FROM #Users
WHERE IsActive <> 0 ) as ActiveUsers
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"Ian Boyd" <ian.msnews010@.avatopia.com> wrote in message
news:u462TqHCFHA.3740@.TK2MSFTNGP09.phx.gbl...
> The follow generates the error:
> Server: Msg 207, Level 16, State 3, Line 19
> Invalid column name 'UserID'.
> The inner derived table ("dt") cannot reference the outer derived table
> ("ActiveUsers") ?
> Nevermind the contrived example - it is only serving to illustrate the
> failing. The real situation is entirely more complex.
>
> IF OBJECT_ID('tempdb..#Users') IS NOT NULL
> DROP TABLE #Users
> IF OBJECT_ID('tempdb..#Logins') IS NOT NULL
> DROP TABLE #Logins
> CREATE TABLE #Users (
> UserID int,
> Name varchar(50),
> IsActive tinyint)
> CREATE TABLE #Logins (
> UserID int,
> LoginDate datetime,
> WasSecured tinyint)
> SELECT
> ActiveUsers.*,
> ( SELECT MAX(LoginDate)
> FROM (
> SELECT * FROM #Logins
> WHERE #Logins.UserID = ActiveUsers.UserID
> AND #Logins.WasSecured <> 0
> ) dt
> ) AS LastSecuredLogin
> FROM (
> SELECT *
> FROM #Users
> WHERE IsActive <> 0
> ) ActiveUsers
> DROP TABLE #Users
> DROP TABLE #Logins
>
>|||> Maybe I am being a bit of a thicky, but I don't see why:
Becuase this wasn't my situation. The two tables is a contrived example -
boiled down to still cause the problem.
The "inner" derived table query's 3 tables unioned to 3 more tables.
The "outer" derived table query 3 more separate tables.|||Ah, I thought you weren't going to give us a contrived example :) I see.
Anyhow, you cannot use derived tables like that. You might look at user
defined functions if Alejandro's suggestion doesn't work. You can do a lot
of stuff in there. They work very well in the SELECT clause. Or post
your entire query and who knows, someone may have done the same thing in the
past.
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"Ian Boyd" <ian.msnews010@.avatopia.com> wrote in message
news:%23tnVDIICFHA.3740@.TK2MSFTNGP09.phx.gbl...
> Becuase this wasn't my situation. The two tables is a contrived example -
> boiled down to still cause the problem.
> The "inner" derived table query's 3 tables unioned to 3 more tables.
> The "outer" derived table query 3 more separate tables.
>
>|||The query has been restructured; and it eliminates the reference from one
derived table to the other.

> Or post your entire query and who knows, someone may have done the same
> thing in the past.
Absoutly not. Nobody has ever done anything like it. The query is 3 screens
long.
And i'm not going to be posting DDL, sample inserts, or explanations.
Or the query :)|||> Absoutly not. Nobody has ever done anything like it. The query is 3
> screens long.
Well, not sure how long a screen is, but I am sure you are unlikely to be
the first person to do "anything like it."

> And i'm not going to be posting DDL, sample inserts, or explanations.
> Or the query :)
Then good luck, can't help you out if we can't see what you are doing. :)
Either way, your derived table must be self contained.
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"Ian Boyd" <ian.msnews010@.avatopia.com> wrote in message
news:Oa3IGfICFHA.3644@.TK2MSFTNGP15.phx.gbl...
> The query has been restructured; and it eliminates the reference from one
> derived table to the other.
>
> Absoutly not. Nobody has ever done anything like it. The query is 3
> screens long.
> And i'm not going to be posting DDL, sample inserts, or explanations.
> Or the query :)
>sql

Cannot print Double Line

On my table, I have my footer as grand total line. I set the border style for
the "bottom" as "double". But it will not print. Is there something I need
to do so I will print double line. Thanks.Try adding a second footer row, after your main footer row. The double
line will not show up the way the table to setup, because of spacing,
but i believe if you add another row, the double line will show.|||That did the trick. Thanks for the help.
"ChristheGreat" wrote:
> Try adding a second footer row, after your main footer row. The double
> line will not show up the way the table to setup, because of spacing,
> but i believe if you add another row, the double line will show.
>

Monday, March 19, 2012

Cannot Open Database

We are getting the following error while opening a database.
Msg 946, Level 14, State 1, Line 1
Cannot open database 'ESPune' version 539. Upgrade the database to the
latest version.
Kindly guide us how to upgrade the db to the latest version.
Except this db ESPune , all other dbs have version 611 when I see the
query select * from sysdatabases.
Regards
RajagopalHello Rajagopal!
Try to detach / attach your database.
Ekrem Önsoy
<rajagopal.ns@.gmail.com> wrote in message
news:1190980646.422354.287350@.50g2000hsm.googlegroups.com...
> We are getting the following error while opening a database.
> Msg 946, Level 14, State 1, Line 1
> Cannot open database 'ESPune' version 539. Upgrade the database to the
> latest version.
> Kindly guide us how to upgrade the db to the latest version.
> Except this db ESPune , all other dbs have version 611 when I see the
> query select * from sysdatabases.
> Regards
> Rajagopal
>|||What version of SQL Server are you using? when did you start seeing this
problem?
Was the database recently upgraded from an older version?
Could you please provide more info on this?
Thank you,
Saleem Hakani
WWW.SQLCOMMUNITY.COM
SQL Server Tips, SQL Server Scripts, SQL Server Forums, SQL Server Blogs,
SQL Server Radio, SQL Server Events..
"rajagopal.ns@.gmail.com" wrote:
> We are getting the following error while opening a database.
> Msg 946, Level 14, State 1, Line 1
> Cannot open database 'ESPune' version 539. Upgrade the database to the
> latest version.
> Kindly guide us how to upgrade the db to the latest version.
> Except this db ESPune , all other dbs have version 611 when I see the
> query select * from sysdatabases.
> Regards
> Rajagopal
>

Saturday, February 25, 2012

cannot install Northwind database in SQL Server Express

Hi,

I tried to install the Northwind database into SQl Server Express via the instnwnd.sql script using the command line:

osql -E -i instnwnd.sql

after a time out though I get this message:

"[SQL Native Client]Named Pipes Provider: Could not open a connection to SQL
Server [2].
[SQL Native Client]Login timeout expired
[SQL Native Client]An error has occurred while establishing a connection to
the server. When connecting to SQL Server 2005, this failure may be caused by
the fact that under the default settings SQL Server does not allow remote
connections."

I already granted access to the administrator account on my machine.

Anyone knows what I need to do more?

Thanks in advance

greetings from Belgium,

Anthony

Are you running osql on the same machine as SQL Server or on a remote machine? If you are executing this on a remote machine, you need to enable remote connections.

Thanks
Laurentiu

|||

Hi Laurentiu,

No, I'm running SQL Server on the same machine.

Thanks for your reply,

Anthony

|||

You should specify the SQL Express instance name:

sqlcmd -E -S.\sqlexpress -i instnwnd.sql

The same will work for osql, of course. Make sure you type the dot. If you're connecting remotely, replace the dot with the machine name.

Thanks
Laurentiu

Friday, February 10, 2012

Cannot find sp_send_cdosysmail

Hello, everyone:

I want to send email by sp_send_cdosysmail, but I got error,

Server: Msg 2812, Level 16, State 62, Line 3
Could not find stored procedure 'sp_send_cdosysmail'.

Even though I run the query under master database. Is it not available in SQL Server 2000?

This is my query:

declare @.Body varchar(4000)
select @.Body = 'This is a Test Message'
exec sp_send_cdosysmail 'someone@.example.com','someone2@.example.com','Test of CDOSYS',@.Body

Any help will be appreciated.

Thanks

ZYThttp://support.microsoft.com/kb/312839