Showing posts with label management. Show all posts
Showing posts with label management. Show all posts

Monday, March 26, 2012

how to determine sql version info

This info is from mss management studio express. how can i determine if SP2 is installed?

Microsoft SQL Server Management Studio Express 9.00.3042.00
Microsoft Data Access Components (MDAC) 6.0.6000.16386 (vista_rtm.061101-2205)
Microsoft MSXML 3.0 6.0
Microsoft Internet Explorer 7.0.6000.16448
Microsoft .NET Framework 2.0.50727.312
Operating System 6.0.6000

Hi there,

I believe that the following article should be able to help you: http://support.microsoft.com/default.aspx/kb/321185

Wednesday, March 21, 2012

How to detect whether SMO is installed?

Hi, folks --
I am working on an install bootstrapper that (among other things)
will install Server Management Objects (SQLServer2005_XMO.msi from SQL
Server 2005 Feature Pack) iff it's not already installed.
So, how to detect programmatically whether or not it's already
installed?
What files/version/registry keys/usual suspects should I be looking
for?
Thanks in advance for your help.
-- Davidson
Hello n7dai@.comcast.net,
I normally look for C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SqlServer.Smo.d ll.
I believe current-most is 9.0.3042.0.
Thanks!
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/
|||What about:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=577731&SiteID=1
Jens K. Suessmeyer.
http://www.sqlserver2005.de
<n7dai@.comcast.net> wrote in message
news:1175273193.753957.182290@.e65g2000hsc.googlegr oups.com...
> Hi, folks --
> I am working on an install bootstrapper that (among other things)
> will install Server Management Objects (SQLServer2005_XMO.msi from SQL
> Server 2005 Feature Pack) iff it's not already installed.
> So, how to detect programmatically whether or not it's already
> installed?
> What files/version/registry keys/usual suspects should I be looking
> for?
> Thanks in advance for your help.
> -- Davidson
>

Monday, March 12, 2012

how to deploy the reports to their own folders?

here is what i did, from either Report Manager or SQL Server Management
Studio i created a folder, then i move the reports to this folder, but
from Microsoft Visual Studio, as long as i deploy the project, it still
save my moved reports outside of the folder i created. i wonder how do
i let the system deploy the projects and still save inside the folder i
created. thanks.Use the project properties of the report project to specify the folder you
want the reports and data sources to go to. If you created it in "/My
Reports That Are Cool" then you specify the same folder name in the report
project properties.
-Tim
"Wang Xiaoning" <wang_xiaoning@.hotmail.com> wrote in message
news:1148590710.476371.266730@.g10g2000cwb.googlegroups.com...
> here is what i did, from either Report Manager or SQL Server Management
> Studio i created a folder, then i move the reports to this folder, but
> from Microsoft Visual Studio, as long as i deploy the project, it still
> save my moved reports outside of the folder i created. i wonder how do
> i let the system deploy the projects and still save inside the folder i
> created. thanks.
>|||Tim, i want to group the reports, saying, sales report go to sales
folder, finance report got o finance, then for end user, as long as
they see local/reports, they will know how to navigate to his own
folders and reports.|||do you mean i have to create tow projects(one for sales, one for
fiance)?

Friday, March 9, 2012

How to delete the role by using AMO(Analysis Management Object)?

I want to delete the role by using AMO, but what I find is only a way that how to create it.

following sample is deleting the members of the role :

Code Snippet

Dim ServerName As Server 'Connect OLAP Server
Dim db As Database 'Database of OLAP Server

Dim role As Role

role = db.Roles.Item(0)
role.Members.Clear()
role.Update()

So I think that deleting the roles of database is like following :

Code Snippet

db.Roles.Clear()

db.Update()

It's wrong. It can't delete roles of a database after executing.

Please tell me what I shall do or where I can find these infoemation, thanks!!

Here's a code sample from one of our developers that does this. (Thanks for the code, Jason.) Keep in mind that in this code, we were looking for Roles that met a naming standard. It's a long story, but you may want to skip that step. Still, I kept it in here (and only changed the naming pattern) so I can insure the code still works with minimal effort. Also, keep in mind this code was written for an SSIS package so you will see some odd ball references in there.

Code Snippet

Public Sub Main()
' SSAS 2005 Server
Dim server As New Microsoft.AnalysisServices.Server
Try
' CONNECT TO THE SERVER
server.Connect("localhost")

' THE ANALYSIS SERVICES DATABASE TO CONNECT TO
Dim database As New Microsoft.AnalysisServices.Database
database = server.Databases.FindByName(Dts.Variables("AnalysisServicesDatabaseName").Value.ToString)

Dim roleCollection As New ArrayList()

' FIND ALL OF THE ROLES IN THE ANALYSIS SERVICES DB THAT MATCH THE NAMING PATTERN
For Each currentRole As Role In database.Roles
If (currentRole.Name.StartsWith("XYZ")) Then
' BECAUSE YOU CAN'T DELETE AN ITEM IN A COLLECTION, ADD TO THE roleCollection ARRAY LIST
roleCollection.Add(currentRole)
End If
Next

' DELETE ALL ROLES IN THE roleCollection
For Each currentObj As Role In roleCollection

'DROP OPTION OF AlterOrDeleteDependents SHOULD REMOVE ANY ASSOCIATED PERMISSIONS WITH THIS ROLE
currentObj.Drop(DropOptions.AlterOrDeleteDependents)
database.Update()
Next

Dts.TaskResult = Dts.Results.Success

Catch ex As Exception
Dts.Events.FireError(1, ex.TargetSite.ToString, ex.Message, "", 0)
Finally
server.Disconnect()
End Try


End Sub

|||

Thanks for your answer~~

I can delete the role now.But I find that I can skip the step of ArrayList() and delete the role.

I don't know what a risk has in these statement, like following code :

If you know that. Could you tell me,please? Thanks!!

Code Snippet

Public Sub Main()
' SSAS 2005 Server
Dim server As New Microsoft.AnalysisServices.Server
Try
' CONNECT TO THE SERVER
server.Connect("localhost")

' THE ANALYSIS SERVICES DATABASE TO CONNECT TO
Dim database As New Microsoft.AnalysisServices.Database
database = server.Databases.FindByName(Dts.Variables("AnalysisServicesDatabaseName").Value.ToString)

' DELETE A ROLES
Dim currentObj As Role

currentObj.database.Roles.FinByName("XYZ")
currentObj.Drop(DropOptions.AlterOrDeleteDependents)
database.Update()

Dts.TaskResult = Dts.Results.Success

Catch ex As Exception
Dts.Events.FireError(1, ex.TargetSite.ToString, ex.Message, "", 0)
Finally
server.Disconnect()
End Try


End Sub

How to delete the role by using AMO(Analysis Management Object)?

I want to delete the role by using AMO, but what I find is only a way that how to create it.

following sample is deleting the members of the role :

Code Snippet

Dim ServerName As Server 'Connect OLAP Server
Dim db As Database 'Database of OLAP Server

Dim role As Role

role = db.Roles.Item(0)
role.Members.Clear()
role.Update()

So I think that deleting the roles of database is like following :

Code Snippet

db.Roles.Clear()

db.Update()

It's wrong. It can't delete roles of a database after executing.

Please tell me what I shall do or where I can find these infoemation, thanks!!

Here's a code sample from one of our developers that does this. (Thanks for the code, Jason.) Keep in mind that in this code, we were looking for Roles that met a naming standard. It's a long story, but you may want to skip that step. Still, I kept it in here (and only changed the naming pattern) so I can insure the code still works with minimal effort. Also, keep in mind this code was written for an SSIS package so you will see some odd ball references in there.

Code Snippet

Public Sub Main()
' SSAS 2005 Server
Dim server As New Microsoft.AnalysisServices.Server
Try
' CONNECT TO THE SERVER
server.Connect("localhost")

' THE ANALYSIS SERVICES DATABASE TO CONNECT TO
Dim database As New Microsoft.AnalysisServices.Database
database = server.Databases.FindByName(Dts.Variables("AnalysisServicesDatabaseName").Value.ToString)

Dim roleCollection As New ArrayList()

' FIND ALL OF THE ROLES IN THE ANALYSIS SERVICES DB THAT MATCH THE NAMING PATTERN
For Each currentRole As Role In database.Roles
If (currentRole.Name.StartsWith("XYZ")) Then
' BECAUSE YOU CAN'T DELETE AN ITEM IN A COLLECTION, ADD TO THE roleCollection ARRAY LIST
roleCollection.Add(currentRole)
End If
Next

' DELETE ALL ROLES IN THE roleCollection
For Each currentObj As Role In roleCollection

'DROP OPTION OF AlterOrDeleteDependents SHOULD REMOVE ANY ASSOCIATED PERMISSIONS WITH THIS ROLE
currentObj.Drop(DropOptions.AlterOrDeleteDependents)
database.Update()
Next

Dts.TaskResult = Dts.Results.Success

Catch ex As Exception
Dts.Events.FireError(1, ex.TargetSite.ToString, ex.Message, "", 0)
Finally
server.Disconnect()
End Try


End Sub

|||

Thanks for your answer~~

I can delete the role now.But I find that I can skip the step of ArrayList() and delete the role.

I don't know what a risk has in these statement, like following code :

If you know that. Could you tell me,please? Thanks!!

Code Snippet

Public Sub Main()
' SSAS 2005 Server
Dim server As New Microsoft.AnalysisServices.Server
Try
' CONNECT TO THE SERVER
server.Connect("localhost")

' THE ANALYSIS SERVICES DATABASE TO CONNECT TO
Dim database As New Microsoft.AnalysisServices.Database
database = server.Databases.FindByName(Dts.Variables("AnalysisServicesDatabaseName").Value.ToString)

' DELETE A ROLES
Dim currentObj As Role

currentObj.database.Roles.FinByName("XYZ")
currentObj.Drop(DropOptions.AlterOrDeleteDependents)
database.Update()

Dts.TaskResult = Dts.Results.Success

Catch ex As Exception
Dts.Events.FireError(1, ex.TargetSite.ToString, ex.Message, "", 0)
Finally
server.Disconnect()
End Try


End Sub

Wednesday, March 7, 2012

how to delete SQL Server Logs entries under Management

as subject!
i'm using sql server 2000.Mulli
BACKUP LOG databaseane WITH TRUNCATE_ONLY
For moredetails please refer to the BOL.
"Mullin Yu" <mullin_yu@.ctil.com> wrote in message
news:u#ZeB0yBEHA.3748@.TK2MSFTNGP11.phx.gbl...
> as subject!
> i'm using sql server 2000.
>|||hi mullin,
You cannot delete the "sql server logs" from Enterprise manager.These files
are stored under
folder
C:\Program Files\Microsoft SQL Server\log\
-- OR (for named instance)
C:\Program Files\Microsoft SQL Server\MSSQL$<instance_name>\log\
delete them from this location, and right click in the enterprise manager on
"sql server logs"
and click on refresh.
it wont show the logs that have been deleted.
Note: you can not delete current errorlog file.
Also one more point to be noted that, if your current errolog has grown big,
you can recyle it
forcefully by running sp_cycle_errorlog from query analyzer
Vishal Parkar
vgparkar@.yahoo.co.in

Friday, February 24, 2012

How to delete all rows in a table

I am running SQL Server 2000.
I need to delete all of the rows in a table within Enterprize management.
How can I do this. All I see is how to delete the table itself.
I only want to delete the data.
Ron
Mark the first line go to the last line with STRG+End, mark the last line
(that marks all) and press DEL.
Other option would be to swtich to SQL mode (in the SQL designer) and
manipulate the SQl Statement as Follows: Delete From SomeTable --OR Truncate
table SomeTable (which is not logged). You can also issue these commands in
the QA.
HTH, jens Suessmeyer.
"Ron" wrote:

> I am running SQL Server 2000.
> I need to delete all of the rows in a table within Enterprize management.
> How can I do this. All I see is how to delete the table itself.
> I only want to delete the data.
> Ron
|||Thanks
"Jens Sü?meyer" wrote:
[vbcol=seagreen]
> Mark the first line go to the last line with STRG+End, mark the last line
> (that marks all) and press DEL.
> Other option would be to swtich to SQL mode (in the SQL designer) and
> manipulate the SQl Statement as Follows: Delete From SomeTable --OR Truncate
> table SomeTable (which is not logged). You can also issue these commands in
> the QA.
> HTH, jens Suessmeyer.
> "Ron" wrote:
|||Ron wrote:
> I am running SQL Server 2000.
> I need to delete all of the rows in a table within Enterprize
> management. How can I do this. All I see is how to delete the table
> itself.
> I only want to delete the data.
> Ron
The fastest way to do this as an administrator/db owner is to truncate
the table to avoid excessive logging, unless you want the operation
logged. You can do this from Query Analyzer or any query tool by issuing
a TRUNCATE TABLE <table_name>
David Gugick
Quest Software
www.imceda.com
www.quest.com

How to delete all rows in a table

I am running SQL Server 2000.
I need to delete all of the rows in a table within Enterprize management.
How can I do this. All I see is how to delete the table itself.
I only want to delete the data.
RonMark the first line go to the last line with STRG+End, mark the last line
(that marks all) and press DEL.
Other option would be to swtich to SQL mode (in the SQL designer) and
manipulate the SQl Statement as Follows: Delete From SomeTable --OR Truncate
table SomeTable (which is not logged). You can also issue these commands in
the QA.
HTH, jens Suessmeyer.
"Ron" wrote:
> I am running SQL Server 2000.
> I need to delete all of the rows in a table within Enterprize management.
> How can I do this. All I see is how to delete the table itself.
> I only want to delete the data.
> Ron|||Thanks
"Jens Sü�meyer" wrote:
> Mark the first line go to the last line with STRG+End, mark the last line
> (that marks all) and press DEL.
> Other option would be to swtich to SQL mode (in the SQL designer) and
> manipulate the SQl Statement as Follows: Delete From SomeTable --OR Truncate
> table SomeTable (which is not logged). You can also issue these commands in
> the QA.
> HTH, jens Suessmeyer.
> "Ron" wrote:
> > I am running SQL Server 2000.
> > I need to delete all of the rows in a table within Enterprize management.
> > How can I do this. All I see is how to delete the table itself.
> > I only want to delete the data.
> >
> > Ron|||Ron wrote:
> I am running SQL Server 2000.
> I need to delete all of the rows in a table within Enterprize
> management. How can I do this. All I see is how to delete the table
> itself.
> I only want to delete the data.
> Ron
The fastest way to do this as an administrator/db owner is to truncate
the table to avoid excessive logging, unless you want the operation
logged. You can do this from Query Analyzer or any query tool by issuing
a TRUNCATE TABLE <table_name>
--
David Gugick
Quest Software
www.imceda.com
www.quest.com

How to delete all rows in a table

I am running SQL Server 2000.
I need to delete all of the rows in a table within Enterprize management.
How can I do this. All I see is how to delete the table itself.
I only want to delete the data.
RonMark the first line go to the last line with STRG+End, mark the last line
(that marks all) and press DEL.
Other option would be to swtich to SQL mode (in the SQL designer) and
manipulate the SQl Statement as Follows: Delete From SomeTable --OR Truncate
table SomeTable (which is not logged). You can also issue these commands in
the QA.
HTH, jens Suessmeyer.
"Ron" wrote:

> I am running SQL Server 2000.
> I need to delete all of the rows in a table within Enterprize management.
> How can I do this. All I see is how to delete the table itself.
> I only want to delete the data.
> Ron|||Thanks
"Jens Sü?meyer" wrote:
[vbcol=seagreen]
> Mark the first line go to the last line with STRG+End, mark the last line
> (that marks all) and press DEL.
> Other option would be to swtich to SQL mode (in the SQL designer) and
> manipulate the SQl Statement as Follows: Delete From SomeTable --OR Trunca
te
> table SomeTable (which is not logged). You can also issue these commands i
n
> the QA.
> HTH, jens Suessmeyer.
> "Ron" wrote:
>|||Ron wrote:
> I am running SQL Server 2000.
> I need to delete all of the rows in a table within Enterprize
> management. How can I do this. All I see is how to delete the table
> itself.
> I only want to delete the data.
> Ron
The fastest way to do this as an administrator/db owner is to truncate
the table to avoid excessive logging, unless you want the operation
logged. You can do this from Query Analyzer or any query tool by issuing
a TRUNCATE TABLE <table_name>
David Gugick
Quest Software
www.imceda.com
www.quest.com