Is There A Way We Can Implement Business Logic By Storing It In Colums Of A Table And Calling It?

Jul 20, 2005

What is the way we could implement a business logic from a Table by
storing it statemnnets in a colums and defining an execute sql to
execute it.Some legal requirements make it diffcult for us to create
modify stored procdures so Iwant to have a process where we create new
rows in a table and execute it to execute business logic.


All views are welcome.

Havin g one table two tables different approaches to store ststements
and execute them....Case logic how to implement it?

Flags in the tble colums in the tables


etc



Thanks


Ajay Garg

View 1 Replies


ADVERTISEMENT

Data Access :: Bulk Fetch Records And Insert / Update Same In Other Table With Some Business Logic

Apr 21, 2015

I am currently working with C and SQL Server 2012. My requirement is to Bulk fetch the records and Insert/Update the same in the other table with some  business logic? How do i do this?

View 14 Replies View Related

Implement Logic For Update Or Insert

May 1, 2006

I have a stored procedure that I need to either perform an update if a record exists or an insert if the record doesn't exist.

Here is my procedure:

CREATE PROCEDURE dbo.Insert_Temp_ContactInfo

@sessionid varchar(50),
@FirstName varchar(50),
@LastName varchar(50),
@SchoolName varchar(50),
@address varchar(50),
@City varchar(50),
@State int,
@Zip varchar(5),
@Phone varchar(10),
@Email varchar(50),
@CurrentCustomer varchar(3),
@ImplementationType int,
@ProductType int = null,
@Comment varchar(500)

AS

--check if a current record exists

SET NOCOUNT ON

SELECT FirstName, LastName, SchoolName, Address, City, State, Zip, Phone, Email, CurrentCustomer, ImplementationType, ProductType, Comment
FROM dbo.Temp_ContactInfo
WHERE sessionid = @sessionid


SET NOCOUNT OFF


--if exists update the record

UPDATE dbo.Temp_ContactInfo
SET
FirstName = @FirstName,
LastName = @LastName,
SchoolName = @SchoolName,
Address = @address,
City = @City,
State = @State,
Zip = @Zip,
Phone = @Phone,
Email = @Email,
CurrentCustomer = @CurrentCustomer,
ImplementationType = @ImplementationType,
ProductType = @ProductType,
Comment = @Comment
WHERE sessionid = @sessionid

--if the record does not exist, then insert a new record

INSERT INTO dbo.Temp_ContactInfo (sessionid, FirstName, LastName, SchoolName, address, City, State, Zip, Phone, Email, CurrentCustomer, ImplementationType, ProductType, Comment)
VALUES (@sessionid, @FirstName, @LastName, @SchoolName, @address, @City, @State, @Zip, @Phone, @Email, @CurrentCustomer, @ImplementationType, @ProductType, @Comment)

GO

I think I can use an if statement. Can anyone help me out with this?

Thanks.

View 3 Replies View Related

How To Implement The For Loop Logic In Sql Server Reporting Services

Dec 17, 2007

Hi All,

This is the code for calculating a formula field in Crystal Reports.
I want to implement the same in Sql Server Reporting Services..
But it doesn't have the feature of For Loop....
The strings started with @ are formula fields....
Can anyone tell me, how can the below code be implemented in Sql Server Reporting Services

numbervar YR;
for YR := 1 to {@CalcFiscalAge} step 1 do
(
IF YR = {@CalcLifeCode} +1 then
locFactor1 := 1;
exit for;
IF (YR = 1 OR YR = {@CalcFiscalAge}) THEN
HALF_YEAR := 2
ELSE
HALF_YEAR := 1 ;
LINEAR := ROUND(REM/ ({@CalcLifeCode}-YR+1.5)/HALF_YEAR,4);
MACR := ROUND(REM / {@CalcLifeCode}*{@CalcSRate}/HALF_YEAR,4);
IF MACR >= LINEAR then
DEP := MACR
ELSE
DEP := LINEAR;
locFactor1 := locFactor1 + DEP ;
REM := 1 - locFactor1;
locFactor := locFactor1;
);



Thanks in advance

Regards,

View 3 Replies View Related

Business Logic File Needs Something...

Feb 26, 2008

Or maybe it can't find something it's looking for to make my additional symetrical with everything else. This is from one of my businesslogic files.  What causes Visual Studio to not allow me to add something here and have it behave like the other parameters/  I'm talking about ShortDesc.  Visual studio inserted () and the Get instead of GET like all the others.  It would not allow me to capitalize the "get". There has to be a reason for this. Currently my program is adding all of the fields except the ShortDesc to the table in my database. Does anyone have any thoughts as to why this is the case?
 
 #Region "Pvt Members"        Private _ArticleID As System.Int32        Private _UserID As System.Int32        Private _WebSiteID As System.Int32        Private _ArticleTitle As System.String        Private _Author As System.String        Private _ShortDesc As System.String        Private _ArticleText As System.String        Private _AnchorText As System.String        Private _ShowInDirectory As System.Boolean        Private _Active As System.Boolean        Private _DateAdded As System.DateTime#End Region#Region "Properties"        Public Property ArticleID As System.Int32            GET                Return _ArticleID             End Get             Set(ByVal Value As System.Int32)                _ArticleID= Value             End Set         End Property         Public Property UserID As System.Int32            GET                Return _UserID             End Get             Set(ByVal Value As System.Int32)                _UserID= Value             End Set         End Property         Public Property WebSiteID As System.Int32            GET                Return _WebSiteID             End Get             Set(ByVal Value As System.Int32)                _WebSiteID= Value             End Set         End Property         Public Property ArticleTitle As System.String            GET                Return _ArticleTitle             End Get             Set(ByVal Value As System.String)                _ArticleTitle= Value             End Set         End Property         Public Property Author As System.String            GET                Return _Author             End Get             Set(ByVal Value As System.String)                _Author= Value             End Set         End Property        Public Property ShortDesc() As System.String            Get                Return _ShortDesc            End Get            Set(ByVal value As System.String)            End Set        End Property        Public Property ArticleText As System.String            GET                Return _ArticleText             End Get             Set(ByVal Value As System.String)                _ArticleText= Value             End Set         End Property         Public Property AnchorText As System.String            GET                Return _AnchorText             End Get             Set(ByVal Value As System.String)                _AnchorText= Value             End Set         End Property         Public Property ShowInDirectory As System.Boolean            GET                Return _ShowInDirectory             End Get             Set(ByVal Value As System.Boolean)                _ShowInDirectory= Value             End Set         End Property         Public Property Active As System.Boolean            GET                Return _Active             End Get             Set(ByVal Value As System.Boolean)                _Active= Value             End Set         End Property         Public Property DateAdded As System.DateTime            GET                Return _DateAdded             End Get             Set(ByVal Value As System.DateTime)                _DateAdded= Value             End Set         End Property #End Region

View 1 Replies View Related

Business Logic In Store Procedure

Apr 5, 2006

Hey guys,I have to import a csv file to my database and then add
some values to other fields based on these values. At present I use a
store procedure that does a bulk insert and then I use an update and
fetch inside the sql to perform these updates. I am not sure if this is
the best way. Is this bad, since some amount of busniess logic is in
the store procedure?If it is, how can I do this better?Thanks for the answer.

View 1 Replies View Related

Business Logic Handler Not Loading

Nov 7, 2006

I'm trying to implement a custom conflict resolver by inheriting from

Microsoft.SqlServer.Replication.BusinessLogicSupport.BusinessLogicModule.  The replication is between a SQL Server 2005 Express subscriber and a SQL Server 2005 publisher/distributer.

The problem is that the resolver class in the DLL will not load; although, it does appear to find the DLL.  (If I rename the DLL I get a "file not found error").  The exact error message is:


Microsoft.SqlServer.Replication.ComErrorException

 "Error loading custom class "MergeConflictHandler" from custom assembly "MergeConflictHandler",

Error : "Could not load type 'MergeConflictHandler' from assembly 'MergeConflictHandler, Version=1.0.2502.22393, Culture=neutral, PublicKeyToken=0403e50cc4dc27fa'."."} 

I placed the DLL in the directory of the program that calls SynchronizationAgent.Synchronize and tried it with and without being registered in the GAC.  There was no change.  Interestingly, when I move the file out of that location, but register it in the GAC, the file is not found.  Thinking it may be a security problem, I gave Everyone Read & Execute and Read privileges.  I believe the class is actually instantiated by replmerge.exe, an apparantly unmanaged app, so I tried marking it ComVisible.  No Luck.
I registered the resolver with the following T-SQL code:


sp_registercustomresolver @article_resolver = 'eClinical Notes Conflict Resolver'

, @is_dotnet_assembly = 'true'

, @dotnet_assembly_name = 'MergeConflictHandler'

, @dotnet_class_name = 'MergeConflictHandler'

, @resolver_clsid = Null
The resolver I've created is not much more than a shell at this point.  It is pasted below, but I tried using the code found on MSDN character-for-character and had the same problem.

using System;


using System.Text;

using System.Data;

using System.Data.Common;

using Microsoft.SqlServer.Replication.BusinessLogicSupport;

namespace MergeConflictHandler

{


public class MergeConflictHandler :

Microsoft.SqlServer.Replication.BusinessLogicSupport.BusinessLogicModule

{


// Variables to hold server names.

private string m_PublisherName;

private string m_SubscriberName;

private string m_Artical_Name;

public MergeConflictHandler()

{

}

// Implement the Initialize method to get publication

// and subscription information.

public override void Initialize(string publisher, string subscriber, string distributor, string publisherDB, string subscriberDB,string articleName)

{


m_PublisherName = publisher;

m_SubscriberName = subscriber;

m_Artical_Name = articleName;

}

// Declare what types of row changes, conflicts, or errors to handle.

public override ChangeStates HandledChangeStates

{


get

{

return ChangeStates.UpdateConflicts;

}

}

public override ActionOnUpdateConflict UpdateConflictsHandler(DataSet publisherDataSet, DataSet subscriberDataSet, ref DataSet customDataSet, ref ConflictLogType conflictLogType, ref string customConflictMessage, ref int historyLogLevel, ref string historyLogMessage)

{


if (m_Artical_Name == "PatientAllergies")

{

// Accept the updated data in the Subscriber's data set and apply it to the Publisher.

}

return ActionOnUpdateConflict.AcceptPublisherData;



}

}

}

 
Does anyone have any thoughts or advice?  (Help!)

View 4 Replies View Related

Cannot Debug 'business Logic Handler'

Jul 10, 2006

hi,

i'm following steps described at: http://msdn2.microsoft.com/en-us/library/ms365150.aspx

all goes fine until step 6. of paragraph "To debug a business logic handler on a Web server using Web synchronization, or for a SQL Server Mobile Subscriber".

in my case when attaching to w3wp.exe i can only debug t-sql or native code. when i forcibly check 'managed' i get: "Unable to attach to the process. Access is denied". error picture:

http://img156.imageshack.us/my.php?image=debuggingerror7bp.jpg

i KNOW that the business logic handler gets loaded and executed because i am logging some info in it. i would be grateful for any suggestions.



TIA, kamil nowicki

View 3 Replies View Related

Stored Procedure Business Logic

May 21, 2008

I am working with stored procedures to provide conditional business logic for a customer based on triggers. Is it possible for a stored procedure to execute an external program ie opening or distributing a crystal report?

View 9 Replies View Related

Business Logic Handler Question

Oct 25, 2007

Hi,

I am performing the Merge Replication of Timesheet table between SQL server 2005 and SQL CE on the Pocket PC. For one of the article, I would like to perform web synch for only those rows which have certain field set to true.

I am trying to use Business Logic Handler to implement this logic. I am using following code out of sample on MSDN web site. However I am not sure if this code gets executed for each row for a table during synch or does this get executed once for each table? The answer would help me write logic on applying synch changes only for few rows.

Thanks

public override ActionOnDataChange UpdateHandler(SourceIdentifier updateSource,
DataSet updatedDataSet, ref DataSet customDataSet, ref int historyLogLevel,
ref string historyLogMessage)
{
if (updateSource == SourceIdentifier.SourceIsPublisher)
{
//check the approved status of the timesheet
if (updatedDataSet.Tables["tbl_timesheets"].Rows[0]["ts_approved"] == true)
{
// Set the reference parameter to write the line to the log file.
historyLogMessage = updatedDataSet.Tables["tbl_timesheets"].Rows[0]["ts_id"].ToString();
// Set the history log level to the default verbose level.
historyLogLevel = 1;

// Accept the updated data in the Subscriber's data set and apply it to the Publisher.
return ActionOnDataChange.AcceptData;


}

else
{
return ActionOnDataChange.RejectData;

}



}
else
{
return base.UpdateHandler(updateSource, updatedDataSet,
ref customDataSet, ref historyLogLevel, ref historyLogMessage);
}
}

Any Help is appreciated.

Thanks

View 1 Replies View Related

SqlDataSource? What Happened To The Separation Of UI And Business Logic?

Mar 16, 2007

I guess I just don't get the reasoning behind the new SqlDataSource control.  Haven't we just spent the last decade or so evangelizing and learning how and why to separate business logic from the display in VB 6 and VS.NET?  In this age of programming for disparate devices (desktop, mobile, PocketPC, etc.) when this separation makes more sense than ever, why is MS pushing us to go back to putting our logic and data access rules and objects back in the display?  It doesn't make sense.  Why would anyone do this?  And why would all the experts and MVPs at ASP.NET, DevX, 4GuysFromRolla, etc., go along with this?

View 4 Replies View Related

Business Logic Handler Called In Which Direction?

May 17, 2007

When running a business logic handler at the subscriber, you can override SubscriberInserts, SubscriberUpdates and SubscriberDeletes. Are these methods called when data is changed coming from the server to client, from the client to the server, or in both directions?



Thanks,

Bryan

View 1 Replies View Related

Transact SQL :: Adding Constraint For Business Logic

May 27, 2015

ALTER TABLE [dbo].[bkrm_lendcoll] ADD CONSTRAINT
     ReqdCovgAmt_constraint33 CHECK     
( case 
  when CovgAmt = 0 and  ReqdCovgAmt = 0 then 1
  when CovgAmt = 0 and  ReqdCovgAmt = 1 then 1
  when CovgAmt = 1 and  ReqdCovgAmt = 0 then 1
  when CovgAmt = 1 and  ReqdCovgAmt = 1 then 0
end =1
)

This is my first attempt to add a constraint for business logic.  The desired behavior is that the two columns together have the same behavior as a radio button.  (one can be true, the other true, both can be false, but both cannot be true.) I get this error when I attempt to update it.

The ALTER TABLE statement conflicted with the CHECK constraint "ReqdCovgAmt_constraint33". The conflict occurred in database "Std", table "dbo.lendcoll".

So, basically my question is, when you have two bit columns and want them to have the truth table such as described, how can I set a Check constraint to enforce this?

View 14 Replies View Related

Running Custom Business Logic During Synchronization

Oct 30, 2006

I have a merge replication topology that allows some subscribers (clients) to retreive a number for certain columns (ie invoice number, order number, etc).

I have implemented a custom business logic handler to check for inserts from the subscriber and before updating the server, I call a stored proc on the server to generate a new number. I update the data set and call ActionOnDataChange.AcceptCustomData. This works great for the publication db but I am trying to get this new number back into the subscription db. I am using web synchronization so I really don't have a connection back to the subscriber database.

Any Ideas? I was thinking about keeping track of the updates myself and build a sql string and somehow get that back to the subscriber to run updates for those columns... I am wondering if I am pushing the limits of the business logic handler? Was it designed to do this? Of course the easy answer is to modify my client application but I am trying to avoid that at this point.

Any help/suggestions would be greatly appreciated!



View 6 Replies View Related

Multiple Tables In Business Logic Handler

Oct 25, 2007

Hi,

I have 2 related tables in SQL 2005. I am using Business Logic Handler on one of those tables during Merge Replication to reject data for few rows during web synchronization. Once a row is rejected, I would like to run the Business Logic Handler for the related table to reject changes for the row with same foreign key as the rejected row in first table.

Not sure if I need to create separate Business Logic Handlers for each table or can it be achieved in a single Handler.

Also is it possible to get a list of rejected rows back from the handler?

Thanks for help.

View 1 Replies View Related

Custom Business Logic Handler Question

Mar 1, 2007

I am currenly have a simple merge replication topology. The publisher-distibutor is SQL Server 2005 and the subscriber is a SQL Server Express. The type of subscription is non anonymous pull.

I made a custom business logic handler class that is trying the following:

When a new record is inserted in a published table on the pubsliher, some additional records are added in a differenct table in subscriber. Then the "InsertHandler" method returns "AcceptData" in order to allow the agent to add the new record in current table also.

So I am establishing a new connection to the subscriber and I am trying to add the additional recs in the different table. The problem is that this different table is also published as read-only on the subscriber. So my insert fails saying that table is not updatable.

Is there any way to bypass this problem?

In fact I realised in general that when my custom logic handler performs some DML operations on the subscriber, these are NOT considered as part of the replication e.g. the NOT FOR REPLICATION constraints and triggers are active for these operations.

Is this normal?

View 1 Replies View Related

Business Logic In Stored Proc VS Aspx.vb Page

Jul 20, 2005

Hello,I stuck in a delimma.Where to put the business logic that involves only one updatebut N number of selects from N tables........with N where conditions

View 5 Replies View Related

Merge Replication – Bug In Business Logic Update Handler

Nov 17, 2006

I have got a business logic update conflict handler working, but I have had to work round what appears to be a bug.

Please can someone confirm if this is indeed a bug €“ and if it is a known bug?

My conflict handler needs to take some columns from the publisher row and some from the subscriber row in the event of conflict.

I can quite happily generate a custom dataset which contains the winning row that I want €“ I can see that because I can step through the conflict handler with debug when a conflict occurs.

However, just returning ActionOnUpdateConflict.AcceptCustomConflictData from the UpdateConflictsHandler method does not set the publisher and subscriber columns correctly. I end up with different values on the two databases.

I have found that the only way to get the correct rows on both publisher and subscriber is to create a new ADO connection to the publisher and actually perform an update €“ updating all the modified columns. This now works reliably in my testing.

Fortunately, due to business rules the frequency of update conflicts are likely to be very infrequent, but I would very much like to avoid having to do the €˜unnecessary€™ update.

Notes:

I am using column level tracking €“ but I have seen the problem with row level tracking too
I have mainly been using SP1 but have repeated the test on a configuration using the SP2 CTP €“ and the problem occurs there too
The problem is not due to complex logic in my code. If the method just sets customDataSet = publisherDataSet.Copy and then returns ActionOnUpdateConflict.AcceptCustomConflictData, the changed and winning publisher values are not sent to the subscriber

Any thoughts would be much appreciated

View 5 Replies View Related

Issues About Deploy Business Logic Handler To A Web Server For Web Replication.

Jul 23, 2007

Pocket PC 2003, SQL Compact Edition, SQL2005, IIS6.0



I implemented a business logic handler to deal with conflicts. When I deploy it on the SQL server which is also the web replication server, the logic handler seems working fine. However, if I deploy this handler to another web server. The logic handler failed to be loaded.

My enviroment settings are desribed as below.



Machine A, distributor, with database and publication. The business logic handler is deployed at C:Program FilesMicrosoft SQL Server90COMBusinessLogicHandler.dll. It's registered by using sp_registercustomresolver. The @assembly is specified as @assembly=C:Program FilesMicrosoft SQL Server90COMBusinessLogicHandler.dll';



Machine B, IIS server. The same business logic handler is deployed at C:Program FilesMicrosoft SQL Server90COMBusinessLogicHandler.dll on the Machine B itself.



When I ran the web replication, the Merge Agent reported the error as below.

Error loading custom assembly "C:Program FilesMicrosoft SQL Server90COMBusinessLogicHandler.dll", Error: "Could not load file or assembly 'C:\Program Files\Microsoft SQL Server\90\COM\BusinessLogicHandler.dll' or one of its dependencies. The given assembly name or codebase was invalid.



It seemed that the Merge Agent had trouble to find my logic handler because the path reported in the error log has two backward slashes. I have no idea where did that came from. I am not sure if that's the cause of the error. Without business logic handler. I had successfully finished web replication of Machine B to sync with Machine A. If I setup web replication directly on Machine A with business logic handler, I can successfully sync as well.



Does anyone has any idea about how to correctly deploy business logic handler on a web server?



Thanks,

Nigel

View 1 Replies View Related

Calling A SP In UDF And Storing Value Return By SP In UDF

Sep 27, 2005

Hi EveryBody,                        I need to call a Stored Procedure in a UDF.This input of SP would be a string and in turn that output Of SP would also be a string.Also i need to store the output of SP in a Calling UDF.Is it possible if Yes Please tell me How can i make It.Please help.Thanks!!!Dheeraj

View 3 Replies View Related

SSIS Calling Into BizTalk Business Rules Engine (BTS BRE)

Oct 11, 2007

Hi,
We are planning to use the BTS BRE for our business rules and calling these from a data flow transformation (e.g. for every row in a flat file during import). One way would be to use a script component.
However, the question is that the script component would have to create and destroy BRE objects (e.g. a BRE Policy object) for every row in the flat file.
Is there a way to instantiate objects and whole on to them for the lifetime of the package or a container within a package?

Any suggestions regarding achieving the above most efficiently would be much appreciated.

Regards,
TD

View 3 Replies View Related

Storing And Calling Audio Files.

Mar 8, 2006

how can i stored audio file in Sql Server, so that i can loop my web page to fill the table with a link to download the audio. What will be the best way to achieve that.

View 1 Replies View Related

How To Copy A Column(or Colums) From A Table In One Database To Another Table In A Different Databas

Oct 1, 2001

How do I copy a column(or colums) from a table in one database to another table in a different database

View 1 Replies View Related

INNER JOIN: Joining Two Different Colums With One Table?

Nov 15, 2004

Hello everyone,

I'm stuck on something here. Any help would be great. This is a relational database question.

I'm trying to inner join two columns of one table with one column of another. The follwoing code doesn't work, but I think you can see what I'm trying to do.



Procedure _Links_List
AS
CREATE TABLE #TempTable
(
LinkId int,
LinkCategory varchar(50),
LinkStatus varchar(50),
LinkName varchar(50)
)
INSERT INTO #TempTable
(
LinkId,
LinkCategory,
LinkStatus,
LinkName
)
SELECT
LinkId,
_SubCategories.SubCategoryName,
_SubCategories.SubCategoryName,
LinkName
FROM
_Links
INNER JOIN
_SubCategories ON _Links.CategoryId = _SubCategories.SubCategoryId
INNER JOIN
_SubCategories ON _Links.StatusId = _SubCategories.SubCategoryId
SELECT
LinkId,
LinkCategory,
LinkStatus,
LinkName
FROM
#TempTable



Also, I know how to do this if I had seperate category tables for each category (LinkCategory, LinkStatus). For examlple:



Procedure _Links_List
AS
CREATE TABLE #TempTable
(
LinkId int,
LinkCategory varchar(50),
LinkStatus varchar(50),
LinkName varchar(50)
)
INSERT INTO #TempTable
(
LinkId,
LinkCategory,
LinkStatus,
LinkName
)
SELECT
LinkId,
_Links_Categories.CategoryName,
_Links_StatusCategories.StatusName,
LinkName
FROM
_Links
INNER JOIN
_Links_Categories ON _Links.CategoryId = _Links_Categories.CategoryId
INNER JOIN
_Links_StatusCategories ON _Links.StatusId = _Links_StatusCategories.StatustId
SELECT
LinkId,
LinkCategory,
LinkStatus,
LinkName
FROM
#TempTable


I know the above works but I'm trying to figure out how to have just one category table and one subcategory table for all of my categories of all my tables.

Table_Categories: CategoryId (Primary Key), CategoryName

Table_SubCategories: CategoryId, SubCategoryId (Primary Key), SubCategoryName

So instead of having to create a new table for every category and all the procedures for them for all my tables, I want to be able to just use these two tables.

If anyone knows how I go about this, especially when a table uses two category columns, I Thank you.


Alec

View 3 Replies View Related

Variable Colums In Stacked Table

Dec 14, 2007

Hello, and thanks for taking the time to read this.

NOOB question:

In dealing with, say, shirts -- I have a DB that serves as a template for several customers. Each customer may have different ranges of sizes (one may have S,M,L and the other might also have XL,XXL). So the CATALOG table is:

CREATE TABLE [dbo].[T_Catalog](
[StlyeID] [int]
) ON [PRIMARY]
with data:
1
2


the SIZES table (filled in by the customer with all the size ranges they carry) is:

CREATE TABLE [dbo].[T_Sizes](
[SizeID] [int],
[SizeName] [nchar](10)
) ON [PRIMARY]
with data:

1,Small
2,Medium
3,Large
4,Xtra-Large

and the AVAILSIZES table would be:

CREATE TABLE [dbo].[T_AvailSizes](
[StyleID] [int],
[SizeID] [int]
) ON [PRIMARY]

1,1
1,2
1,3
2,1
2,3
2,4

Basically, then, we know that:

style 1 comes in Small, Medium, and Large
style 2 xomes in Small, Large, and Xtra large

WE know that, but getting SQL to tell us that is a major PIA!!

Now,

SELECT
t_Catalog.StyleId, t_AvailSizes.SizeID
FROM
t_Catalog
INNER JOIN t_AvailSizes ON
t_Catalog.StyleId = t_AvailSizes.StyleId

will give me a nice list of each item number with a separate row for each size number.

My questions are:

How do I get the size NAMES?

How would I get all of the sizes into a single row, so that there is a single row for each catalog StyleID (that's all I ever wanted to begin with)?

Is this the right way of doing this?

In reality I have about six columns that can contain multiple and variable items like this, and when trying to even think about resolving it all into a single record my brain tries desparately to crawl out my left ear.

Thanks for any help and information you can provide.

View 2 Replies View Related

How To Implement Alter Database Implement Restrictions On SQL2K ?

Dec 28, 2007

Hi Guyz

it is taken from SQL2K5 SP2 readme.txt. Anyone have idea what to do to implement this ?
Our sp2 is failing. we suspect the above problem and researching it.we are running on default instance of SQL2K5 on win2003 ent sp2

"When you apply SP2, Setup upgrades system databases. If you have implemented restrictions on the ALTER DATABASE syntax, this upgrade may fail. Restrictions to ALTER DATABASE may include the following:

Explicitly denying the ALTER DATABASE statement.


A data definition language (DDL) trigger on ALTER DATABASE that rolls back the transaction containing the ALTER DATABASE statement.


If you have restrictions on ALTER DATABASE, and Setup fails to upgrade system databases to SP2, you must disable these restrictions and then re-run Setup."

thanks in advance.

View 4 Replies View Related

How To Implement A DropDownList W/o A Table

Jun 9, 2007

I am using Visual Studio 2005 & SQL Server. How do i implement a DDL for users to select which value to input. like i can with Access. i do not need a table i think. if not the table would have only ID & Value.?

View 2 Replies View Related

How To Implement SCD Type1 And Type2 At The Same Table

Apr 7, 2008

Hi All,
I want to implement SCD Type1 and Type2 in one table, i.e. my columns has got type1 and type2. I have the following table made from different tables; the columns are Column1, Column 2, Column3, Column4, Column5, and Column6. Here I have two type1 (Column2 and Column3 ) I want these to be Typ1, the rest will be Type2. My concern is I don€™t want use SCD component of the SSIS (b/se of performance issue, I hope) but I am using Lookup and conditional Split instead. The General concept is i have type1 and type2 dimensions in one table (dimension table). The question is:
1. Can I meet my goal using these components I mean without SCD transformation component and again i am thinking to avoid OLE DB Command transformation Component?
2. If yes then how do I use the conditional split, I mean how to write the condition for type1 and type2.
3. Is there any other option to use instead of SCD transformation component having type1 and type2 at the same table?
Thank you in advance for everything, I hope to get one solution from all of you guys. Have a great day.
Thank you,

View 3 Replies View Related

SQL Server 2005 Common Table Expression(CTE) Implement Reg.

Aug 30, 2006

Hi,

We are developing the web application using ASP.NET 2.0 using C# with Backend of SQL Server 2005.

Now we have one requirement with my client, Already our application live in ASP using MS Access Database. In Access Database our client already wrote the query, those query call the another query from same database. So I want to over take this functionality in SQL Server 2005.

In ASP Application, We call this query €œ081Stats€? from Record set.

This €˜081Stats€™ query call below sub query itself

Master Query: 081Stats

SELECT DISTINCTROW [08Applicants].school, [08Applicants].Applicants, [08Interviewed].Interviewed, [Interviewed]/[Applicants] AS [interviewed%], [08Accepted].Accepted, [Accepted]/[Applicants] AS [Accepted%], [08Dinged].Dinged, [Dinged]/[Applicants] AS [Dinged%], [08Waitlisted].Waitlisted, [Applicants]-[Accepted]-[Dinged] AS Alive, [08Matriculating].Matriculating, [Matriculating]/[Accepted] AS [Yield%]
FROM ((((08Applicants LEFT JOIN 08Interviewed ON [08Applicants].school = [08Interviewed].school) LEFT JOIN 08Accepted ON [08Applicants].school = [08Accepted].school) LEFT JOIN 08Dinged ON [08Applicants].school = [08Dinged].school) LEFT JOIN 08Waitlisted ON [08Applicants].school = [08Waitlisted].school) LEFT JOIN 08Matriculating ON [08Applicants].school = [08Matriculating].school;

Sub Query 1: 08Accepted

SELECT statusTbl.school, Count(1) AS Accepted
FROM statusTbl
WHERE (((statusTbl.decision)=1) AND ((statusTbl.yearapp)="2008"))
GROUP BY statusTbl.school
ORDER BY Count(1) DESC;

Sub Query 2: 08Applicants

SELECT statusTbl.school, Count(1) AS Accepted
FROM statusTbl
WHERE (((statusTbl.decision)=1) AND ((statusTbl.yearapp)="2008"))
GROUP BY statusTbl.school
ORDER BY Count(1) DESC;

Sub Query 3: 08Dinged

SELECT statusTbl.school, Count(1) AS Dinged
FROM statusTbl
WHERE (((statusTbl.decision)=0) AND ((statusTbl.yearapp)="2008"))
GROUP BY statusTbl.school
ORDER BY Count(1) DESC;

Sub Query 4: 08Interviewed

SELECT statusTbl.school, Count(1) AS Interviewed
FROM statusTbl
WHERE (((statusTbl.interview)=True) AND ((statusTbl.yearapp)="2008"))
GROUP BY statusTbl.school
ORDER BY Count(1) DESC;

Sub Query 5: 08Matriculating

SELECT statusTbl.school, Count(1) AS Matriculating
FROM statusTbl
WHERE (((statusTbl.userdec)=True) AND ((statusTbl.yearapp)="2008"))
GROUP BY statusTbl.school
ORDER BY Count(1) DESC;

So now I got the solution from SQL Server 2005. I.e. Common Table Expressions, So I got the syntax and other functionality, Now my doubts is how do implement the CTE in SQL Server 2005, where can I store the CTE in SQL Server 2005.

How can I call that CTE from ASP.NET 2.0 using C#?

CTE is replacing the Stored Procedure and Views, because it is memory based object in SQL Server 2005.

How can I implement the CTE, where can I write the CTE and where can I store the CTE.

And how can I call the CTE from ASP.NET 2.0 using C#.

It€™s Very Urgent Requirements.

We need your timely help.

With Thanks & Regards,
Sundar

View 1 Replies View Related

Integration Services :: How To Implement SCD For No Unique Columns In A Table

May 11, 2015

I would like to know what is the use of business key? Is it necessary to have unique key between source and destination? If no, How can we implement SCD?

PS : My source is CSV files and Destination is Oracle DB?

View 2 Replies View Related

Table Logic?

Feb 22, 2007

I am just getting started with the integration between SQL Server and ASP.NET 2. I am at a loss of how to move data in and out.

I need to track a vehicle inventory, properties to be track are, year, make, and model, color and so on. These have not presented me with much of a problem; however the vehicle options have left me totally confused.

I have an Options table and a Vehicle table. The Options table has a numeric primary key OptionsID, and a field for the option. The Vehicle table has a numeric primary key, VehicleID. I have tried using a join table named VehicleOptions with two fields, VehicleID and OptionsID. I have tried a join table (VehicleOptions) with a field for the VehicleID and separate fields for every OptionsID, inputting true or false, as needed.

I have tried passing a string with each OptionID separated with a comma, to a stored procedure, parsing the string, looping through setting the value to true or false as needed.

I have also tried matching the VehicleID with the OptionsID in the code for the web page then passing this to a separate stored procedure.

Thanks in advance for any help?

View 4 Replies View Related

Installing VS2005 And Business Intelligence Report Projects On A Vista Business Workstation

Oct 23, 2007

Does anyone have a successful prescribed sequence for installing VS2005 and Business Intelligence Reports Projects on a Vista Business workstation to be used to create reports for a server?

I've looked through everything I can find here and I don't seem to see a clear solution without a lot of trial and error.

Fact is, I've not been successful getting just the reports to install on a plain XP box. Of course, the report creation looks fine on the server but I don't want to work directly on the server.


Thank you

View 1 Replies View Related

Synchronization Of Business Contacts In Outlook With Small Business Accounting

Jun 10, 2006

Can anyone take me through synchronization of contacts within Business Contacts Outlook into Microsoft Small Business Accounts?

I run a stand alone PC with NO network. When SBA came SQL was also installed. Apparently you can synchronise Contacts within Business Contacts with SBA but both SBA & Outlook should work through the same SQL server.

Has anyone tried this?

Can someone walk me through the process?

Thanks

Debbie

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved