Showing posts with label basically. Show all posts
Showing posts with label basically. Show all posts

Thursday, March 29, 2012

Dropping scripts into sql 2005

Something that really irritates me with sql2005 is when I try to drag and drop a script into sql2005 I have to relog basically. Say I'm dropping in 20 different scripts, I have to relog and select the database every time for each script. Sql2000 did not do this, I drag and drop in scripts and whatever database I was currently in, it would use. Is this just a setting that I need to change or is it a horrible "enhancement"?

Thanks for your help.

Hi,

no I think currently this is not possible, one query windows per query will be opened and prompt you for the information where to connect to.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Monday, March 19, 2012

Drop stored procedures by...

Hi,
How do I drop all stored procedures with the prefix of "www_".
Basically, I need to add all new dev DB sprocs to our prod DB, but on the
prod DB there are a whole bunch of old sprocs that needs to be dropped.
Thanks in advance
ChristianFrom Vyas:
On SQL Server 2000 the following will give you a list of all stored
procedure names in the database:
SELECT ROUTINE_SCHEMA AS Owner,
ROUTINE_NAME AS ProcedureName
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = 'PROCEDURE'
The following will return the DROP PROC commands that you need to run:
SELECT 'DROP PROC ' + QUOTENAME(ROUTINE_SCHEMA) + '.' +
QUOTENAME(ROUTINE_NAME) AS Command
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_TYPE = 'PROCEDURE'
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Christian Perthen" <abracadabara@.dontreplytothidress.com> schrieb im
Newsbeitrag news:e2VlEOESFHA.248@.TK2MSFTNGP15.phx.gbl...
> Hi,
> How do I drop all stored procedures with the prefix of "www_".
> Basically, I need to add all new dev DB sprocs to our prod DB, but on the
> prod DB there are a whole bunch of old sprocs that needs to be dropped.
> Thanks in advance
> Christian
>|||Must be sure changed in some way, sorry i forgot:

> SELECT ROUTINE_SCHEMA AS Owner,
> ROUTINE_NAME AS ProcedureName
> FROM INFORMATION_SCHEMA.ROUTINES
> WHERE ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_NAME LIKE 'www_%'
> The following will return the DROP PROC commands that you need to run:
> SELECT 'DROP PROC ' + QUOTENAME(ROUTINE_SCHEMA) + '.' +
> QUOTENAME(ROUTINE_NAME) AS Command
> FROM INFORMATION_SCHEMA.ROUTINES
> WHERE ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_NAME LIKE 'www_%'
>
Jens Suessmeyer.
"Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> schrieb
im Newsbeitrag news:uLPtCWESFHA.1996@.TK2MSFTNGP10.phx.gbl...
> From Vyas:
> On SQL Server 2000 the following will give you a list of all stored
> procedure names in the database:
> SELECT ROUTINE_SCHEMA AS Owner,
> ROUTINE_NAME AS ProcedureName
> FROM INFORMATION_SCHEMA.ROUTINES
> WHERE ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_NAME LIKE 'www_%'
> The following will return the DROP PROC commands that you need to run:
> SELECT 'DROP PROC ' + QUOTENAME(ROUTINE_SCHEMA) + '.' +
> QUOTENAME(ROUTINE_NAME) AS Command
> FROM INFORMATION_SCHEMA.ROUTINES
> WHERE ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_NAME LIKE 'www_%'
>
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "Christian Perthen" <abracadabara@.dontreplytothidress.com> schrieb im
> Newsbeitrag news:e2VlEOESFHA.248@.TK2MSFTNGP15.phx.gbl...
>

Sunday, February 19, 2012

Drillthrough not working!

Hello everyone!

I am using VS 2005, with SQL 2000. My reports are displaying fine, but i am trying to have a drillthrough report. So basically display one report and once i click on a certain element within the report, it should take me to that specific report, i.e that parameter is passed.

I have rooted through the internet to find a couple of examples which do the same, but these examples use XML as the datasource but I am using a dataset (.xsd) file and cannot get my head around how to interact with this and reload the dataset onto the ReportViewer based on the DrillThrough event the user selects.

The code using the xml file is below, can someone help me to convert this to get it to read data from the xsd file. Both my dataTableAdapters are in the same Dataset. xsd file. I am fairly new at .NET but even i know that this has to be possible.

Cheers,

Munira

private DataTable LoadEmployeesData()

{

DataSet dataSet = new DataSet();

dataSet.ReadXml(@."c:\My Reports\employees.xml");

return dataSet.Tables[0];

}

private DataTable LoadDepartmentsData()

{

//This is the bit that needs to change inorder to read from an xsd file

DataSet dataSet = new DataSet();

dataSet.ReadXml(@."c:\My Reports\departments.xml");

return dataSet.Tables[0];

}

void DemoDrillthroughEventHandler(object sender, DrillthroughEventArgs e)

{

LocalReport localReport = (LocalReport)e.Report;

localReport.DataSources.Add(new ReportDataSource("Employees",

LoadEmployeesData()));

}

protected void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

{

// On initial page load

ReportViewer1.LocalReport.ReportPath = @."c:\My Reports\Departments.rdlc";

// Supply a DataTable corresponding to each report data source.

ReportViewer1.LocalReport.DataSources.Add(

new ReportDataSource("Departments", LoadDepartmentsData()));

}

// Add the handler for drillthrough.

ReportViewer1.Drillthrough += new DrillthroughEventHandler(DemoDrillthroughEventHandler);

}

Hello all!

I managed to solve my problem after quite a bit of frustration...so I thought that this little check list might be helpful to someone else facing a similar problem.

Ok things to do inorder to make drill down reports work.

1. In the second report (the drillthrough report) add the parameter to the report, in the rdlc page.

2. In the main report, go to the element that you want to click on, the textbox, and make the navigation properties to jump to the second report, also remember to set the parameter in that dialogue box!

3. Add the drillthrougheventhandler in your aspx.cs page, this is the point where you want to change your data source.

4. Make sure you set the reportviewer ondrillthoughevent, in the html definition of the reportviewer, to go to the function writen in 3.

Regards,

Munira