Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Wednesday, March 28, 2012

Help with sp_send_cdosysmail

Current system
Windows 2000 server SP4
SQL Enterprise SP3a
We were using xp_SMTP_Sendmail from SQLDEV.net, and a few procedures
used CDO to send e-mail.
All was fine for years until this weekend.
We installed the following patches:
MS06-031
Microsoft Security Bulletin MS06-031
Vulnerability in RPC Mutual Authentication Could Allow Spoofing
(917736)
MS06-070
Microsoft Security Bulletin MS06-070
Vulnerability in Workstation Service Could Allow Remote Code Execution
(924270)
MS07-017
Microsoft Security Bulletin MS07-017
Vulnerabilities in GDI Could Allow Remote Code Execution (925902)
MS07-022
Microsoft Security Bulletin MS07-022
Vulnerability in Windows Kernel Could Allow Elevation of Privilege
(931784)
MS07-031
Microsoft Security Bulletin MS07-031 - Critical
Vulnerability in the Windows Schannel Security Package Could Allow
Remote
Code Execution (935840)
As soon as I hit this part of the code to create the mail object
EXEC @.hr = sp_OACreate 'CDO.Message', @.iMsg OUT
print @.hr
EXEC @.hr = sp_OAGetErrorInfo NULL, @.source OUT, @.description OUT
print ' Description: ' + @.description
I get the following error
-2147023782
Description: A dynamic link library (DLL) initialization routine
failed.
All other references to @.iMsg fail as the object does not exist.
Source code for Procedure at:
http://support.microsoft.com/kb/312839
Thanks!
David HayI've been able to drill a little further. the SP_OACreate refrences
stdole70.dll
On to the next...

Monday, March 26, 2012

help with showcontig

Hi,

i'm on windows nt4 sp6a , sql server 7.00.0842

i have something that i don't understand.
The table 'source' is taking lot of space but when i bcp out, the file take
only 11MB (fixed delimiter option)
i issue showontig and it says me that Avg. Page Density
(full)................: 4.33%
so if i understand there are a lot of space wasted per page
so i issue DBCC DBREINDEX('dbo.source', '', 50) and i expect to have Avg.
Page Density (full)................: 50%
but it's still the same even after dbcc update usage on that table

at alst, i've done a select * into test from source and the test table take
only 11MB like the bcp out. (1290 pages insted of 32923 pages of the source
table)

so what can i do to reduce the 'source' table ?

if anayone can help me ?

the table 'source' the ddl is :

CREATE TABLE dbo.source
(
f1_id numeric(18,0) NOT NULL,
f2_id numeric(18,0) NOT NULL,
f3_id numeric(28,0) IDENTITY,
f4_id char(300) NOT NULL,
CONSTRAINT pk_source_compid_tranid
PRIMARY KEY NONCLUSTERED (f1_id,f2_id,f3x_id) WITH FILLFACTOR=50 ON
[PRIMARY]
)

sp_spaceused 'source'

name rows reserved data index_size unused
source 29701 287088 KB 263400 KB 23400 KB 288 KB

USE appli
go
DBCC UPDATEUSAGE('appli', 'dbo.source')
WITH COUNT_ROWS
go
DBCC SHOWCONTIG(702625546)
go
DBCC DBREINDEX('dbo.source', '', 50)
go
DBCC UPDATEUSAGE('appli', 'dbo.source')
WITH COUNT_ROWS
go
DBCC SHOWCONTIG(702625546)

The command executed successfully with no results returned.
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.
DBCC SHOWCONTIG scanning 'source' table...
Table: 'source' (702625546); index ID: 0, database ID: 12
TABLE level scan performed.
- Pages Scanned........................: 32923
- Extents Scanned.......................: 4122
- Extent Switches.......................: 4121
- Avg. Pages per Extent..................: 8.0
- Scan Density [Best Count:Actual Count]......: 99.85% [4116:4122]
- Extent Scan Fragmentation ...............: 95.41%
- Avg. Bytes Free per Page................: 7743.9
- Avg. Page Density (full)................: 4.33%

DBCC execution completed. If DBCC printed error messages, contact your
system administrator.

Index (ID = 2) is being rebuilt.
Index (ID = 3) is being rebuilt.
Index (ID = 4) is being rebuilt.
Index (ID = 5) is being rebuilt.
Index (ID = 6) is being rebuilt.

DBCC execution completed. If DBCC printed error messages, contact your
system administrator.

DBCC UPDATEUSAGE: sysindexes row updated for table 'source' (index ID 2):
USED pages: Changed from (2391) to (2390) pages.
RSVD pages: Changed from (2400) to (2401) pages.
DBCC UPDATEUSAGE: sysindexes row updated for table 'source' (index ID 3):
USED pages: Changed from (201) to (200) pages.
RSVD pages: Changed from (208) to (209) pages.
DBCC UPDATEUSAGE: sysindexes row updated for table 'source' (index ID 4):
USED pages: Changed from (335) to (334) pages.
RSVD pages: Changed from (344) to (345) pages.
DBCC UPDATEUSAGE: sysindexes row updated for table 'source' (index ID 0):
USED pages: Changed from (35843) to (35849) pages.
RSVD pages: Changed from (35882) to (35885) pages.
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.
DBCC SHOWCONTIG scanning 'source' table...

Table: 'source' (702625546); index ID: 0, database ID: 12
TABLE level scan performed.
- Pages Scanned........................: 32923
- Extents Scanned.......................: 4122
- Extent Switches.......................: 4121
- Avg. Pages per Extent..................: 8.0
- Scan Density [Best Count:Actual Count]......: 99.85% [4116:4122]
- Extent Scan Fragmentation ...............: 95.41%
- Avg. Bytes Free per Page................: 7743.9
- Avg. Page Density (full)................: 4.33%
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.Jean (test@.est.com) writes:
> so if i understand there are a lot of space wasted per page
> so i issue DBCC DBREINDEX('dbo.source', '', 50) and i expect to have Avg.
> Page Density (full)................: 50%
> but it's still the same even after dbcc update usage on that table
>...
> DBCC SHOWCONTIG scanning 'source' table...
> Table: 'source' (702625546); index ID: 0, database ID: 12
> TABLE level scan performed.

Here is the crux of the biscuit: there is no clustered index on the table.
And since there is no clustered index, DBREINDEX will not touch the
data pages.

You can create a temporary clustered index and then drop that index. That
should leave the data pages unfragmented. However, unless you have very
good reason not to have a clustered index, my recommendation is that you
define one of you existing indexes as clustered, and stick with that,

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||>
> Here is the crux of the biscuit: there is no clustered index on the
> table. And since there is no clustered index, DBREINDEX will not
> touch the
> data pages.

thx it works !!
good day

Friday, March 23, 2012

Help with RS Report Viewer in .Net 1.1 (Sortable Columns)

Currently, we are using .net 1.1 and SQL 2005. To integrate RS without having to open new browser windows or launch the report manager, we are using the ReporService.asmx service to render the reports. One thing that we are having a difficult time with is allowing columns to be sortable. In report manager, we have sortable columns sorting without a problem, but once the page is rendered within our product using the service, it is rendered without the sortable columns.

While going through the different flags within the service I found that there is a flag for Javascript (which is what I'm assuming I need) but it doesn't change the report when I enable it. I am wondering if there is a combonation of flags that need to be set to allow the sorting to work or if it just not possible to do sorting when rendering the HTML sent from the service. Hopefully this is enough infomation to lead to some answers with this. Thanks.

bump

|||

I don't think it's necessarily a javascript issue -- although it might be if you are using ajaxy stuff since there are apparently issues there.

What's your doctype in your page?

>L<

|||

The 2000 version of the SSRS Web service (ReportService.asmx) doesn't support interactive features. The Report Manager uses URL access for report rendering which supports interactive features. The 2005 web service supports interactive features but you need to pass in the identifier of the sortable item wchich you don't know at design time. To make the long story short, I don't know of a hack to sort via the web service. My recommendation will be to upgrade to ASP.NET 2.0 and use the ASP.NET report viewer which supports all interactive features.

Wednesday, March 21, 2012

Help with RS Report Viewer in .Net 1.1 (Sortable Columns)

Currently, we are using .net 1.1 and SQL 2005. To integrate RS without having to open new browser windows or launch the report manager, we are using the ReporService.asmx service to render the reports. One thing that we are having a difficult time with is allowing columns to be sortable. In report manager, we have sortable columns sorting without a problem, but once the page is rendered within our product using the service, it is rendered without the sortable columns.

While going through the different flags within the service I found that there is a flag for Javascript (which is what I'm assuming I need) but it doesn't change the report when I enable it. I am wondering if there is a combonation of flags that need to be set to allow the sorting to work or if it just not possible to do sorting when rendering the HTML sent from the service. Hopefully this is enough infomation to lead to some answers with this. Thanks.

bump

|||

I don't think it's necessarily a javascript issue -- although it might be if you are using ajaxy stuff since there are apparently issues there.

What's your doctype in your page?

>L<

|||

The 2000 version of the SSRS Web service (ReportService.asmx) doesn't support interactive features. The Report Manager uses URL access for report rendering which supports interactive features. The 2005 web service supports interactive features but you need to pass in the identifier of the sortable item wchich you don't know at design time. To make the long story short, I don't know of a hack to sort via the web service. My recommendation will be to upgrade to ASP.NET 2.0 and use the ASP.NET report viewer which supports all interactive features.

sql

Friday, February 24, 2012

Help with Login / User problem

I am newbe to MS SqlServer, and can`t find out how to do create a Login/User
so when I am log on Windows network as a given user and then connect to an
instance of SqlServer, I am connected to a specific database as a specific
user.
Example of what I`m trying to do:
- Windows network domain : Milestone
- Domain user : BBP
- SqlServer registration name : MTN002
- Database name (on MTN002) : Milestone_TEST
-- SqlServer user I wish to be: : Kuku
When I log on to network domain Milestone as user BBP, start SQL Query
Analyzer and run the query "SELECT USER", I want to see the result "Kuku".
Somehow I cant get it done. What do I miss ?
TIA
Boaz Ben-Porat
Milestone Systems> When I log on to network domain Milestone as user BBP, start SQL Query
> Analyzer and run the query "SELECT USER", I want to see the result "Kuku".
> Somehow I cant get it done. What do I miss ?
I don't know what you've tried to do so I can't say what you may have
missed. I believe the script below will accomplish the desired result as
long as the account is not a sysadmin or the database owner.
EXEC sp_grantlogin 'Milestone\BBP'
GO
USE Milestone_TEST
GO
EXEC sp_grantdbaccess 'Milestone\BBP', 'Kuku'
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Boaz Ben-Porat" <bbp@.milestone.dk> wrote in message
news:e2Zd%23SDCEHA.3472@.TK2MSFTNGP09.phx.gbl...
> I am newbe to MS SqlServer, and can`t find out how to do create a
Login/User
> so when I am log on Windows network as a given user and then connect to an
> instance of SqlServer, I am connected to a specific database as a specific
> user.
> Example of what I`m trying to do:
> - Windows network domain : Milestone
> - Domain user : BBP
> - SqlServer registration name : MTN002
> - Database name (on MTN002) : Milestone_TEST
> -- SqlServer user I wish to be: : Kuku
>
> When I log on to network domain Milestone as user BBP, start SQL Query
> Analyzer and run the query "SELECT USER", I want to see the result "Kuku".
> Somehow I cant get it done. What do I miss ?
> TIA
> Boaz Ben-Porat
> Milestone Systems
>
>
>

Sunday, February 19, 2012

Help with java connection to MS SQL 2000 with windows integrated security

Hi , I am trying to connect to MS Sql server 2000 from Java (1.4.2 /
1.5 ). I installed my Sql Server(8.00.382) from the one supplied with
VS.NET 2001. When I installed it on my laptop it did not ask me for a
user name and password. After install when I re-started my machine I
see the server started up with a green light. Now when I connect to the
server from VS.NET it works fine. This is because VS uses windows
integrated security. I now need to connect using Java , so I downloaded
the microsoft drivers for SQL2000-JDBC sp3 from the microsoft site. I
added the jar files to my Java project classpath. I manage to register
the driver in java :

Class dbClass = ClassLoader.getSystemClassLoader().

loadClass("com.microsoft.jdbc.sqlserver.SQLServerDriver");

DriverManager.registerDriver((Driver) dbClass.newInstance() );

Connection conn =
DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;_
integrated security=SSPI");

but cannot seem to get a connection as it gives an SQLException saying
that it is unable to connect:

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error
establishing socket.

I cant seem to figure it out.Can some one help ??

I am a newbie to sqlserver so couldnt quite figure out how to change
admin password or create a new user with the tools provided with this
version of sql (SQL Server Desktop Engine).

Any help will be appreciated.

EbbyHi ... I also tried the following connection string which I made after
looking at other peoples problems.

jdbc:microsoft:sqlserver://EBBY/VSdotNET:1433;DatabaseName=Ebby");

where EBBY is the server name
VSdotNET the instance name
Ebby the database name|||Hi

You may want to check out
http://support.microsoft.com/defaul...kb;en-us;313100

The following would imply that a names instance would require a different
port (or possibly an alias) to connect
http://support.microsoft.com/defaul...kb;en-us;313225

John
<ebrahimbandookwala@.gmail.com> wrote in message
news:1111297471.633617.217830@.g14g2000cwa.googlegr oups.com...
> Hi ... I also tried the following connection string which I made after
> looking at other peoples problems.
> jdbc:microsoft:sqlserver://EBBY/VSdotNET:1433;DatabaseName=Ebby");
> where EBBY is the server name
> VSdotNET the instance name
> Ebby the database name|||(ebrahimbandookwala@.gmail.com) writes:
> Hi , I am trying to connect to MS Sql server 2000 from Java (1.4.2 /
> 1.5 ). I installed my Sql Server(8.00.382) from the one supplied with
> VS.NET 2001.

8.00.382 is SQL 2000 SP1. The current service pack of SQL 2000 is SP3 (and
SP4 is in beta). I strongly recommend you to upgrade to SP3, as SP3
has a fix for the Slammer worm which could attack your SQL Server if
you were to expose it on the Internet.

> Connection conn =
> DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;_
> integrated security=SSPI");

1433 is normally the port for the default instance, and apparently you have
a named instance. Check out the links posted by John, and see if they help.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp