Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Friday, March 23, 2012

Open-ended querying of DB (??)

I am working on a project with a couple of hundred tables and views. There is one primary table around which all other tables revolve with the primary table having somewhere around 42 to 45 million records. Some of the related tables can have many times this number of records. The data is static in that it only changes at specific intervals (once a month or so) when more records are added and some "old" records are removed.

My problem is that users need to query these tables without any major restrictions. I mean, the front end will allow users to create almost any selection criteria form the many columns in the DB. The selection of values will be controlled via drop-downs and lists from where the user will select the criteria. The other consideration is that the grouping can be for any value and up to ten levels deep. Our users are not sophisticated enough to create their own SQL-like queries so we have to guide them through the process of selecting the values…

I am trying to create stored procedures that will allow this behavior but I continue to run into the problem of how to properly join the tables when the combinations are almost endless. My conclusion is that although it seems this seems to be a case where D-SQL is a good choice, there are some draw-backs I am not sure we can afford, specifically the security issues. Furthermore, the creation of a D-SQL "code-generator" seems like almost impossible task and time is of the essence.

Has anyone here had any experience with a similar situation that can shed some light?I think without dynamic SQL, you're stuck with creating a view for every possible combination of joins - not really an option. I think you'll need to use it. Is it possible to provide the highest priority querying and slowly add more tables as you have a chance to build it? If a user isn't sophisticated enough to build SQL, will they be aware enough to even understand what joining tables does for them?

I've done 'build-your-own' query-generating stuff before, but never to that scope. That could be a tough one.|||A Friend of mine was reading an article in visualstudiomagazine.com that might be of some assistance to you. Check out the online version http://www.fawcette.com/vsm/2004_10/magazine/columns/databasedesign/

Hth,|||Scott, thanks for the heads-up. I will post my impressions on the article later on.|||PD, I have no choice but to look for a solution. Our users currently have a system that is based on a "flat-file" format where creating the queries to produce the reports is fairly easy. When we decided to re-write the system as a web based application, the decision was made to move to SQL Server and take advantage of its power. We normalized the files, added records for a wider time frame and have created a beautiful data structure. Unfortunately now we are confronted with the issues of querying the data in a multitude of ways.

We are considering de-normalizing the data a little, using Analysis Services, English Queries, and others. Given the confidential nature of the data, security is a must and using D-SQL may be a problem. We can live with a system where the user makes his selection from lists and drop-downs and we construct the query behind the scenes; we do not expect them to know SQL.|||Beleive it or not there are actual tools out there that exist to perform this task. Mind you some may seem expensive... but they work, and the amount of development time saved to get something that works and may be useful in other areas in your organization may warrant the costs.

The tools fall into the Business Intelligence area of software, and are typically called EII or something to that nature. EII stands for Enterprise Information Integration.

Another way to explain it, you need a tool, typically made to fetch data from multiple sources, apply english names to them, then you specify how the individual "views of data" could be related to another. Next the tool gives you a GUI interface and/or exposes an API allowing you to say "I want data from 'a' and 'b' filtered on 'c' and grouped on 'd'."

Nimble Technologies made such a tool. My company, Actuate Corporation, has acquired them to use their technology within our own software. I'm not sure if we did an outright takeover, or just bought largely into their company or what, but Nimble may or may not exist. In either case, they had competitors, so the tools do exists out there.

I would suggest looking up Business Intelligence tools, or publications that frequently discuss such software. Publications geared towards CIOs and IT management would be another area to look.

Wednesday, March 21, 2012

Open SSIS project error: Unable to cast COM object of type

When I open up my existing SSIS project, I always get this error. Does anyone know what was wrong ?

TITLE: Microsoft Visual Studio

Unable to cast COM object of type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.PackageNeutralClass' to interface type 'Microsoft.SqlServer.Dts.Runtime.IObjectWithSite'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FC4801A3-2BA9-11CF-A229-00AA003D7352}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).

Did you get a solution to this problem? If so could you please post it? I'm having the exact same problem on my development server.

Sincerely

Svein Terje Gaup

|||

I have the same problem as well, anyone know how to solve it?

Many Thanks.

Warren

|||

i got it fixed without knowing how to fix it. it is kind of rediculous.

Can anyone from SSIS team or any SSIS guru answer this ?

Steve

|||

I've no idea but it seems some realated with the apartment for a COM object, maybe STA which is being used

in another thread.

My wonder is why BIDS needs to make a RCW between managed code and unmanaged code when you're going to open it.

|||

Have seen this error several times opening BIDS.

Just close BIDS and open it up again, error gone. Don't know why. I think it happens when I'm a little bit impatient and try to open a recent project while BIDS is not fully up and running yet.

It's a bit annoying, but I don't think it's a serious problem.

Pipo1

|||Have this problem too - any fixes?|||

It seems SQL 2005 does not do a good job to tell us what the error is...

Not sure if you guys did the same task I did, I got the same error when I tried to add a Maintenance Plan. I tried to find the reason/solution but no luck.. and I fixed it not because I found the answer and it is all about security...

My story is...

I set up two clustered SQL 2005 servers and tried to add a maintanience plan by using sa account authentication. However, sa account is not a network account but a SQL account. So I kept getting the error no matter I close/open how many times. And unfortunately SQL 2005 does not report this error "precisely" to me to identify where the problem is... So instead of using my local Management Tools and sa accoutn authentication, I logged in to another server on the same network domain as those two clustered servers. Then I used Management Tool installed on it and Window Authentication account which is the admin account of two clustered servers, and hahaha, it just works like I want it to.

Hope this helps,
Jet

Open SSIS project error: Unable to cast COM object of type

When I open up my existing SSIS project, I always get this error. Does anyone know what was wrong ?

TITLE: Microsoft Visual Studio

Unable to cast COM object of type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.PackageNeutralClass' to interface type 'Microsoft.SqlServer.Dts.Runtime.IObjectWithSite'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FC4801A3-2BA9-11CF-A229-00AA003D7352}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).

Did you get a solution to this problem? If so could you please post it? I'm having the exact same problem on my development server.

Sincerely

Svein Terje Gaup

|||

I have the same problem as well, anyone know how to solve it?

Many Thanks.

Warren

|||

i got it fixed without knowing how to fix it. it is kind of rediculous.

Can anyone from SSIS team or any SSIS guru answer this ?

Steve

|||

I've no idea but it seems some realated with the apartment for a COM object, maybe STA which is being used

in another thread.

My wonder is why BIDS needs to make a RCW between managed code and unmanaged code when you're going to open it.

|||

Have seen this error several times opening BIDS.

Just close BIDS and open it up again, error gone. Don't know why. I think it happens when I'm a little bit impatient and try to open a recent project while BIDS is not fully up and running yet.

It's a bit annoying, but I don't think it's a serious problem.

Pipo1

|||Have this problem too - any fixes?|||

It seems SQL 2005 does not do a good job to tell us what the error is...

Not sure if you guys did the same task I did, I got the same error when I tried to add a Maintenance Plan. I tried to find the reason/solution but no luck.. and I fixed it not because I found the answer and it is all about security...

My story is...

I set up two clustered SQL 2005 servers and tried to add a maintanience plan by using sa account authentication. However, sa account is not a network account but a SQL account. So I kept getting the error no matter I close/open how many times. And unfortunately SQL 2005 does not report this error "precisely" to me to identify where the problem is... So instead of using my local Management Tools and sa accoutn authentication, I logged in to another server on the same network domain as those two clustered servers. Then I used Management Tool installed on it and Window Authentication account which is the admin account of two clustered servers, and hahaha, it just works like I want it to.

Hope this helps,
Jet

|||Hello

Does anyone have the solution to this issue?
Everytime I open a new SSIS package, i get the error
"Unable to cast COM object of type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.PackageNeutralClass' to interface type
'Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSContainer90'. This operation failed because the QueryInterface call on the COM component for the interface...failed due to the following error: Interface not registered."

Which interface do I need to register?

Doesnt happen for other packages, only SSIS.

Thanks!

Open SSIS project error: Unable to cast COM object of type

When I open up my existing SSIS project, I always get this error. Does anyone know what was wrong ?

TITLE: Microsoft Visual Studio

Unable to cast COM object of type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.PackageNeutralClass' to interface type 'Microsoft.SqlServer.Dts.Runtime.IObjectWithSite'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FC4801A3-2BA9-11CF-A229-00AA003D7352}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).

Did you get a solution to this problem? If so could you please post it? I'm having the exact same problem on my development server.

Sincerely

Svein Terje Gaup

|||

I have the same problem as well, anyone know how to solve it?

Many Thanks.

Warren

|||

i got it fixed without knowing how to fix it. it is kind of rediculous.

Can anyone from SSIS team or any SSIS guru answer this ?

Steve

|||

I've no idea but it seems some realated with the apartment for a COM object, maybe STA which is being used

in another thread.

My wonder is why BIDS needs to make a RCW between managed code and unmanaged code when you're going to open it.

|||

Have seen this error several times opening BIDS.

Just close BIDS and open it up again, error gone. Don't know why. I think it happens when I'm a little bit impatient and try to open a recent project while BIDS is not fully up and running yet.

It's a bit annoying, but I don't think it's a serious problem.

Pipo1

|||Have this problem too - any fixes?|||

It seems SQL 2005 does not do a good job to tell us what the error is...

Not sure if you guys did the same task I did, I got the same error when I tried to add a Maintenance Plan. I tried to find the reason/solution but no luck.. and I fixed it not because I found the answer and it is all about security...

My story is...

I set up two clustered SQL 2005 servers and tried to add a maintanience plan by using sa account authentication. However, sa account is not a network account but a SQL account. So I kept getting the error no matter I close/open how many times. And unfortunately SQL 2005 does not report this error "precisely" to me to identify where the problem is... So instead of using my local Management Tools and sa accoutn authentication, I logged in to another server on the same network domain as those two clustered servers. Then I used Management Tool installed on it and Window Authentication account which is the admin account of two clustered servers, and hahaha, it just works like I want it to.

Hope this helps,
Jet

sql

Open SSIS project error: Unable to cast COM object of type

When I open up my existing SSIS project, I always get this error. Does anyone know what was wrong ?

TITLE: Microsoft Visual Studio

Unable to cast COM object of type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.PackageNeutralClass' to interface type 'Microsoft.SqlServer.Dts.Runtime.IObjectWithSite'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FC4801A3-2BA9-11CF-A229-00AA003D7352}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).

Did you get a solution to this problem? If so could you please post it? I'm having the exact same problem on my development server.

Sincerely

Svein Terje Gaup

|||

I have the same problem as well, anyone know how to solve it?

Many Thanks.

Warren

|||

i got it fixed without knowing how to fix it. it is kind of rediculous.

Can anyone from SSIS team or any SSIS guru answer this ?

Steve

|||

I've no idea but it seems some realated with the apartment for a COM object, maybe STA which is being used

in another thread.

My wonder is why BIDS needs to make a RCW between managed code and unmanaged code when you're going to open it.

|||

Have seen this error several times opening BIDS.

Just close BIDS and open it up again, error gone. Don't know why. I think it happens when I'm a little bit impatient and try to open a recent project while BIDS is not fully up and running yet.

It's a bit annoying, but I don't think it's a serious problem.

Pipo1

|||Have this problem too - any fixes?|||

It seems SQL 2005 does not do a good job to tell us what the error is...

Not sure if you guys did the same task I did, I got the same error when I tried to add a Maintenance Plan. I tried to find the reason/solution but no luck.. and I fixed it not because I found the answer and it is all about security...

My story is...

I set up two clustered SQL 2005 servers and tried to add a maintanience plan by using sa account authentication. However, sa account is not a network account but a SQL account. So I kept getting the error no matter I close/open how many times. And unfortunately SQL 2005 does not report this error "precisely" to me to identify where the problem is... So instead of using my local Management Tools and sa accoutn authentication, I logged in to another server on the same network domain as those two clustered servers. Then I used Management Tool installed on it and Window Authentication account which is the admin account of two clustered servers, and hahaha, it just works like I want it to.

Hope this helps,
Jet

Open SSIS project error: Unable to cast COM object of type

When I open up my existing SSIS project, I always get this error. Does anyone know what was wrong ?

TITLE: Microsoft Visual Studio

Unable to cast COM object of type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.PackageNeutralClass' to interface type 'Microsoft.SqlServer.Dts.Runtime.IObjectWithSite'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FC4801A3-2BA9-11CF-A229-00AA003D7352}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).

Did you get a solution to this problem? If so could you please post it? I'm having the exact same problem on my development server.

Sincerely

Svein Terje Gaup

|||

I have the same problem as well, anyone know how to solve it?

Many Thanks.

Warren

|||

i got it fixed without knowing how to fix it. it is kind of rediculous.

Can anyone from SSIS team or any SSIS guru answer this ?

Steve

|||

I've no idea but it seems some realated with the apartment for a COM object, maybe STA which is being used

in another thread.

My wonder is why BIDS needs to make a RCW between managed code and unmanaged code when you're going to open it.

|||

Have seen this error several times opening BIDS.

Just close BIDS and open it up again, error gone. Don't know why. I think it happens when I'm a little bit impatient and try to open a recent project while BIDS is not fully up and running yet.

It's a bit annoying, but I don't think it's a serious problem.

Pipo1

|||Have this problem too - any fixes?|||

It seems SQL 2005 does not do a good job to tell us what the error is...

Not sure if you guys did the same task I did, I got the same error when I tried to add a Maintenance Plan. I tried to find the reason/solution but no luck.. and I fixed it not because I found the answer and it is all about security...

My story is...

I set up two clustered SQL 2005 servers and tried to add a maintanience plan by using sa account authentication. However, sa account is not a network account but a SQL account. So I kept getting the error no matter I close/open how many times. And unfortunately SQL 2005 does not report this error "precisely" to me to identify where the problem is... So instead of using my local Management Tools and sa accoutn authentication, I logged in to another server on the same network domain as those two clustered servers. Then I used Management Tool installed on it and Window Authentication account which is the admin account of two clustered servers, and hahaha, it just works like I want it to.

Hope this helps,
Jet

Open SSIS project error: Unable to cast COM object of type

When I open up my existing SSIS project, I always get this error. Does anyone know what was wrong ?

TITLE: Microsoft Visual Studio

Unable to cast COM object of type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.PackageNeutralClass' to interface type 'Microsoft.SqlServer.Dts.Runtime.IObjectWithSite'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FC4801A3-2BA9-11CF-A229-00AA003D7352}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).

Did you get a solution to this problem? If so could you please post it? I'm having the exact same problem on my development server.

Sincerely

Svein Terje Gaup

|||

I have the same problem as well, anyone know how to solve it?

Many Thanks.

Warren

|||

i got it fixed without knowing how to fix it. it is kind of rediculous.

Can anyone from SSIS team or any SSIS guru answer this ?

Steve

|||

I've no idea but it seems some realated with the apartment for a COM object, maybe STA which is being used

in another thread.

My wonder is why BIDS needs to make a RCW between managed code and unmanaged code when you're going to open it.

|||

Have seen this error several times opening BIDS.

Just close BIDS and open it up again, error gone. Don't know why. I think it happens when I'm a little bit impatient and try to open a recent project while BIDS is not fully up and running yet.

It's a bit annoying, but I don't think it's a serious problem.

Pipo1

|||Have this problem too - any fixes?|||

It seems SQL 2005 does not do a good job to tell us what the error is...

Not sure if you guys did the same task I did, I got the same error when I tried to add a Maintenance Plan. I tried to find the reason/solution but no luck.. and I fixed it not because I found the answer and it is all about security...

My story is...

I set up two clustered SQL 2005 servers and tried to add a maintanience plan by using sa account authentication. However, sa account is not a network account but a SQL account. So I kept getting the error no matter I close/open how many times. And unfortunately SQL 2005 does not report this error "precisely" to me to identify where the problem is... So instead of using my local Management Tools and sa accoutn authentication, I logged in to another server on the same network domain as those two clustered servers. Then I used Management Tool installed on it and Window Authentication account which is the admin account of two clustered servers, and hahaha, it just works like I want it to.

Hope this helps,
Jet

Open SSIS project error: Unable to cast COM object of type

When I open up my existing SSIS project, I always get this error. Does anyone know what was wrong ?

TITLE: Microsoft Visual Studio

Unable to cast COM object of type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.PackageNeutralClass' to interface type 'Microsoft.SqlServer.Dts.Runtime.IObjectWithSite'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FC4801A3-2BA9-11CF-A229-00AA003D7352}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).

Did you get a solution to this problem? If so could you please post it? I'm having the exact same problem on my development server.

Sincerely

Svein Terje Gaup

|||

I have the same problem as well, anyone know how to solve it?

Many Thanks.

Warren

|||

i got it fixed without knowing how to fix it. it is kind of rediculous.

Can anyone from SSIS team or any SSIS guru answer this ?

Steve

|||

I've no idea but it seems some realated with the apartment for a COM object, maybe STA which is being used

in another thread.

My wonder is why BIDS needs to make a RCW between managed code and unmanaged code when you're going to open it.

|||

Have seen this error several times opening BIDS.

Just close BIDS and open it up again, error gone. Don't know why. I think it happens when I'm a little bit impatient and try to open a recent project while BIDS is not fully up and running yet.

It's a bit annoying, but I don't think it's a serious problem.

Pipo1

|||Have this problem too - any fixes?|||

It seems SQL 2005 does not do a good job to tell us what the error is...

Not sure if you guys did the same task I did, I got the same error when I tried to add a Maintenance Plan. I tried to find the reason/solution but no luck.. and I fixed it not because I found the answer and it is all about security...

My story is...

I set up two clustered SQL 2005 servers and tried to add a maintanience plan by using sa account authentication. However, sa account is not a network account but a SQL account. So I kept getting the error no matter I close/open how many times. And unfortunately SQL 2005 does not report this error "precisely" to me to identify where the problem is... So instead of using my local Management Tools and sa accoutn authentication, I logged in to another server on the same network domain as those two clustered servers. Then I used Management Tool installed on it and Window Authentication account which is the admin account of two clustered servers, and hahaha, it just works like I want it to.

Hope this helps,
Jet

open source sql server project(s)

Where could some one find sql server open source project? Source Forge
projects for sql servers are very front end intensive. Are there any open
source sql server projects that would involve lots of database/server side
work that some one could participate in?
TIA..Hi
You should ask people from Microsoft.
BTW , did you mean open source like MySQL provided?
"sqlster" <trisha@.nospam.nospam> wrote in message
news:0AF98BC0-786A-46E4-B676-86A8B04B8ACA@.microsoft.com...
> Where could some one find sql server open source project? Source Forge
> projects for sql servers are very front end intensive. Are there any open
> source sql server projects that would involve lots of database/server side
> work that some one could participate in?
> TIA..|||By open source, I mean sourcforge.net type of projects. Some one comes up
with an idea and a project, posts the requirements, and volunteers around th
e
world work on the modules independently. This helps in "hands on" experience
.
"Uri Dimant" wrote:

> Hi
> You should ask people from Microsoft.
> BTW , did you mean open source like MySQL provided?
> "sqlster" <trisha@.nospam.nospam> wrote in message
> news:0AF98BC0-786A-46E4-B676-86A8B04B8ACA@.microsoft.com...
>
>|||Hi
> By open source, I mean sourcforge.net type of projects.
Does it relate somehow to SQL Server ?
"sqlster" <trisha@.nospam.nospam> wrote in message
news:46A40D79-2B1E-41B1-A994-BE3BCE496790@.microsoft.com...
> By open source, I mean sourcforge.net type of projects. Some one comes up
> with an idea and a project, posts the requirements, and volunteers around
> the
> world work on the modules independently. This helps in "hands on"
> experience.
> "Uri Dimant" wrote:
>

Friday, March 9, 2012

Open an existing report

Hi
Is it possible to connect to an existing project of reports?
cause i have made some reports on my workstation, deployed them on the
server and now some of the others from the office wants to connect to the
reports and tweak them a bit.
How do we do that?
/ChristianUse source control or a file share to share the reports projects (or reports
themselves and any corresponding shared datasources.) Once the reports are
modified, you'll need to publish them again.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Christian Larsen" <ChristianLarsen@.discussions.microsoft.com> wrote in
message news:E1BE650A-2812-4FEA-9AFD-FFB23304E40E@.microsoft.com...
> Hi
> Is it possible to connect to an existing project of reports?
> cause i have made some reports on my workstation, deployed them on the
> server and now some of the others from the office wants to connect to the
> reports and tweak them a bit.
> How do we do that?
> /Christian|||"Christian Larsen" <ChristianLarsen@.discussions.microsoft.com> wrote in message news:<E1BE650A-2812-4FEA-9AFD-FFB23304E40E@.microsoft.com>...
> Hi
> Is it possible to connect to an existing project of reports?
> cause i have made some reports on my workstation, deployed them on the
> server and now some of the others from the office wants to connect to the
> reports and tweak them a bit.
> How do we do that?
> /Christian
Hello Christian,
I'm using visual studio .net. There is the button "new element"
klicking an holding down the button gives you two choices: "add new
element" and "add existing element". They should select "add existing
element". Then a window opens up and they should be able to browse to
the destination where you delivered your report and then they should
be able to import the report. (This report displays on the end of
their list in the projectfolder explorer.)
Sorry when some buttons have similar names because i'm using a german
version and i don't know how these buttons or things are called in
english.
Hope i could help.
bye
Jens

Open a new project using SQL Server management Studio Express

Dear Friends

I am unable to open e new project using SQL Server management Studio Express. On the File menu it displays only "Query with current connection" and "Data base Engine Query". Please help me on thi Do I have to Install SQL Server management Studio instead of using express version. Cant I use SQL Server and SQL server management studio for deploy to make a small database for my a wharehouse. Please help me

Amila

Management Studio Express does not include the Project functionality of the full version. You can still create queries and scripts in SSMSE which can be saved to a .sql file, moved to a different computer and run withing SSMSE on that computer.

Use either of the options you mention to create a new query window and create the script you wish to use to build your database. Once you've got the script working, use Save from the File menu and give the file a name. You can send this file around like any text file and it can be loaded into any copy of Management Studio or Management Studio Express and run.

Regards,

Mike Wachal
SQL Express team

Open .RDL in ASP.NET without ReportServer

Is it possible to simply add an .RDL to an asp.net project, and access the
report dynamically without any report url or anything.
I just want to pass the database authentication to the .RDL [reportViewer?]
and a few parameters, and run the report. But I do not want the report to
exist in a subweb or http://reportServer etc. I just want to drop it right
into my project, and go.
Thanks for any links or advice.This is totally possible with the new controls that ship with VS 2005. You
can develop the report and then view it in your app using the controls. Note
that this is more work. You have to handle subreports, drill through etc.
Also, I found the design environment in VS 2005 that comes with VS to design
reports nowhere as near as nice as the report designer that comes with SQL
Server. Note that if you have SQL Server, the designer comes with it. You
can develop and preview the reports without deploying them, then just change
the extension and bring them into your project.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Chris" <cmill575@.hotmail.com> wrote in message
news:u5QFgtdBGHA.3604@.TK2MSFTNGP09.phx.gbl...
> Is it possible to simply add an .RDL to an asp.net project, and access the
> report dynamically without any report url or anything.
> I just want to pass the database authentication to the .RDL
> [reportViewer?] and a few parameters, and run the report. But I do not
> want the report to exist in a subweb or http://reportServer etc. I just
> want to drop it right into my project, and go.
> Thanks for any links or advice.
>|||Thanks for your response. That's good news. I hope MS improves the designer
in VS.
Cant you just design the report using the SQL Server report designer and
then drop the rdl into your web project?
Anyway, thanks again.
BTW: Does anyone have any walkthrough's using this new functionality? I
havent used RS since it first came out.
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:u1R684jBGHA.3292@.TK2MSFTNGP09.phx.gbl...
> This is totally possible with the new controls that ship with VS 2005. You
> can develop the report and then view it in your app using the controls.
> Note that this is more work. You have to handle subreports, drill through
> etc. Also, I found the design environment in VS 2005 that comes with VS to
> design reports nowhere as near as nice as the report designer that comes
> with SQL Server. Note that if you have SQL Server, the designer comes with
> it. You can develop and preview the reports without deploying them, then
> just change the extension and bring them into your project.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Chris" <cmill575@.hotmail.com> wrote in message
> news:u5QFgtdBGHA.3604@.TK2MSFTNGP09.phx.gbl...
>> Is it possible to simply add an .RDL to an asp.net project, and access
>> the report dynamically without any report url or anything.
>> I just want to pass the database authentication to the .RDL
>> [reportViewer?] and a few parameters, and run the report. But I do not
>> want the report to exist in a subweb or http://reportServer etc. I just
>> want to drop it right into my project, and go.
>> Thanks for any links or advice.
>|||You can use the SQL Server report designer and then rename the extension and
then use that. That is really the easiest. The issue with VS is that there
is no preview. You have to deploy and use either your web page or your
winform to view the report.
Just dropping the rdl into your web project makes no sense unless there is
something to render the report. That is where the new controls come in.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Chris" <cmill575@.hotmail.com> wrote in message
news:%23Xt1UVpBGHA.2300@.TK2MSFTNGP15.phx.gbl...
> Thanks for your response. That's good news. I hope MS improves the
> designer in VS.
> Cant you just design the report using the SQL Server report designer and
> then drop the rdl into your web project?
> Anyway, thanks again.
> BTW: Does anyone have any walkthrough's using this new functionality? I
> havent used RS since it first came out.
>
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> news:u1R684jBGHA.3292@.TK2MSFTNGP09.phx.gbl...
>> This is totally possible with the new controls that ship with VS 2005.
>> You can develop the report and then view it in your app using the
>> controls. Note that this is more work. You have to handle subreports,
>> drill through etc. Also, I found the design environment in VS 2005 that
>> comes with VS to design reports nowhere as near as nice as the report
>> designer that comes with SQL Server. Note that if you have SQL Server,
>> the designer comes with it. You can develop and preview the reports
>> without deploying them, then just change the extension and bring them
>> into your project.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Chris" <cmill575@.hotmail.com> wrote in message
>> news:u5QFgtdBGHA.3604@.TK2MSFTNGP09.phx.gbl...
>> Is it possible to simply add an .RDL to an asp.net project, and access
>> the report dynamically without any report url or anything.
>> I just want to pass the database authentication to the .RDL
>> [reportViewer?] and a few parameters, and run the report. But I do not
>> want the report to exist in a subweb or http://reportServer etc. I just
>> want to drop it right into my project, and go.
>> Thanks for any links or advice.
>>
>

Saturday, February 25, 2012

Only for SQL GURUS - Calling external procedures from Functions

I am using SQL Server 2005 Developer Edition. I am working on a conversion project from Oracle to SQL Server 2005.

As part of this, in order to replicate Oracle sequence functionality in SQL Server, the design called for writing a function that would accept a parameter , say sequence name. There will be a user table, say, SEQUENCE_GENERATOR with the following structure.

Column Name Data Type Nullability
-- -
Sequence_Name varchar(50) N
Last_Number int N

Everytime before generating the next sequence this function would be called. It would do the following : -

-
Select @.Last_Number = Last_Number
from SEQUENCE_GENERATOR WITH (UPDLOCK)
WHERE Sequence_Name = <func parameter passed i.e. Sequence Name>

SET @.Last_Number = @.Last_Number +1

UPDATE SEQUENCE_GENERATOR
SET
Last_Number = @.Last_Number
WHERE Sequence_Name = <func parameter passed i.e. Sequence Name>

RETURN
@.Last_Number
Since we are fetching the value of Last_Number(by calling the function) before inserting into our tables, we do not want users simultaneously accessing the same sequence to end up with PK violations and hence the use of UPDLOCK hint.

Now the real problem: -

Since the above three steps are a DML operation excepting the RETURN clause, we cannot do it in a function. However we can call an external stored procedure that does the above UML operations to accept the parameter and then return an output value. This output value would then be returned by the function.

Now I would like to know if the above approach is possible with external sps as I have no prior experience in this. Also, can someone point important resources where I can code the above thing in C++...

Thanks & Regards
Imtiaz

Before I get to the answer...

1. In practice sequence tables are a huge headache in any database design, I find they're more common in the Oracle world than any other, especially in large database designs that required a federated/distributed/replication model. If you can avoid a sequence table, consider using uniqueidentifier columns for PKs instead, they will remove a lot of headache (read: labor hours) and simplify software design at all levels.

2. Locking (table or otherwise) just creates artificial contention, if 1000 clients all decided to create a record at the same time they'd all have to stand in line. *owe*

3. In your sequence table you might consider using a seeded identity column for the PK, and leave the 'sequence name' as a regular data value. You could then write a UDF (function) in sql server that simply inserted the sequence name into the sequence table, and upon completion you acquire the generated number via @.@.IDENTITY (look this up in Books Online if you're not familiar with it already). This will help avoid the locking (which is hell on performance) and still get everything contained within sql server (no need to go the xp route). This is an option so long as the rest of the solution doesn't rely on a contigious set of numbers for a given sequence name (table?).
To answer your question, though, an extended stored procedure (xp/xsp) is implemented as a standard C dll, so you could implement it in C++ so long as you had cdecl exports sql server could consume.

Also, the registration process is tacky (look up sp_addextendedproc) since it requires access to the master table, but yes you can do what you want using an xp and a little elbow grease.

See: Creating an Extended Stored Procedure (MSDN)

Hope that helps,
Shaun

|||The logic that you have below is not quite correct unless you enclose the statements in a transaction. Without a transaction, the UPDLOCK will be released after the SELECT statement completes.

Select @.Last_Number = Last_Number
from SEQUENCE_GENERATOR WITH (UPDLOCK)
WHERE Sequence_Name = <func parameter passed i.e. Sequence Name>

SET @.Last_Number = @.Last_Number +1

UPDATE SEQUENCE_GENERATOR
SET
Last_Number = @.Last_Number
WHERE Sequence_Name = <func parameter passed i.e. Sequence Name>

RETURN
@.Last_Number

A more concise way of writing this in SQL Server is to use the UPDATE statement extension like:

UPDATE SEQUENCE_GENERATOR
SET @.Last_Number = Last_Number = Last_Number + 1
WHERE Sequence_Name = <sequence name>

Having said this, it is still not possible to perform data modifying operations from within UDFs. You can write an extended stored procedure. But that is more trouble actually. It can easily lead to concurrency issues, poor performance etc. You will also have to use bound connections. You could still go this route but be aware of the risks especially in a OLTP environment. You can use Visutal Studio templates to create the stubs required for implementing extended stored procedures. In any case, I would recommend against converting Oracle code verbatim. Identity provides a much faster and efficient mechanism to generate sequence numbers. If you need the sequence mechanism then why not implement it as a stored procedure and call it from within the proc requiring it. This is much more scalaeble way to implement it in TSQL.|||Shaun and Uma

The solutions you have given me instead of using external stored procedures I am aware of that. The application would run on Oracle or SQL Server backedn and the idea is to have most of the things as close as possible. I know this can be achieved by SPs but we desperately need functions to do that.

Uma
The reason we have UPDLOCK hint is for concurrency issues.

Now how can we write T-SQL code in C++ is my question. where do I start with?|||I am still waiting for some inputs on this...The problem is how do I start a xaction, access the database in extended procedure.

Regards
Imtiaz|||

Shaun Wilson wrote:

See: Creating an Extended Stored Procedure (MSDN)

Also

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odssql/ods_6_con_01_22sz.asp

and

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odssql/ods_6_con_01_22sz.asp

Sync the toc on their website, all the docs you need are there. If all else fails you might consider using MSDTC as a transaction coordinator between the 'client', your xp and sql server.