Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Sunday, March 11, 2012

Check Constraint ot Instead of trigger ?

Hi All.. I have a vendor supplied application that writes to a very large
table. I have identified a set of data that the vendors client software send
s
the database that we do not use, but adds 1 million rows of data each day.
I've added an "After" trigger to delete this data as it gets inserted, but
I'm searching for a way from keeping it from getting inserted in the first
place. I can create a check constraint or an instead of trigger. The docs
say use contraints when you can, but does anyone have a different opinion as
how to redirect data to the bit bucket and not insert it into the table ?
And, no the vendor won't help and I can't say who it is ? :>Is the Vendor insert coming from a Strored Procedure? If so, implement your
logic inside the stored procedure before even doing anything to the table
itself.
"JohnW" wrote:

> Hi All.. I have a vendor supplied application that writes to a very large
> table. I have identified a set of data that the vendors client software se
nds
> the database that we do not use, but adds 1 million rows of data each day.
> I've added an "After" trigger to delete this data as it gets inserted, but
> I'm searching for a way from keeping it from getting inserted in the first
> place. I can create a check constraint or an instead of trigger. The docs
> say use contraints when you can, but does anyone have a different opinion
as
> how to redirect data to the bit bucket and not insert it into the table ?
> And, no the vendor won't help and I can't say who it is ? :>|||On Wed, 26 Apr 2006 14:09:02 -0700, JohnW wrote:

>Hi All.. I have a vendor supplied application that writes to a very large
>table. I have identified a set of data that the vendors client software sen
ds
>the database that we do not use, but adds 1 million rows of data each day.
>I've added an "After" trigger to delete this data as it gets inserted, but
>I'm searching for a way from keeping it from getting inserted in the first
>place. I can create a check constraint or an instead of trigger. The docs
>say use contraints when you can, but does anyone have a different opinion a
s
>how to redirect data to the bit bucket and not insert it into the table ?
>And, no the vendor won't help and I can't say who it is ? :>
Hi John,
Adding a CHECK constraint will prevent the insertion of the data and
throw an error. Also, if 100 rows are inserted in a single INSERT
statement and 1 fails the CHECK constraint, they are all rejected. If
this is the behaviour you need, AND the thrid party application can
handle the error condition raised by the CHECK contraint, use it.
Otherwise, use an INSTEAD OF trigger. That can prevent insertion of all
rows, or of only the offending rows, without sputtering error messages
to the client.
Hugo Kornelis, SQL Server MVP|||Just another solution, though if u can do it in the SP thats the best way..
You can use a for insert trigger and
check if the insert should happen, if not rollback the transaction.
like this
(this not syntax.. just pseudo code) check this anyways
create trigger t1 "for insert" on tbl1
begin
if condition = false
rollback tran
end

Wednesday, March 7, 2012

Cheap Enterprize Manger and Query Analyzer

Can anyone tell me a cheap way to get this software, (Enterprize Manger and Query Analyzer). I am tyring to upsize to SQL Server with my Webhost and they are not very helpful in how to best do this.

So I am guessing I need these to connect to my new SQL Database. I know Microsoft has a trial version but isn't there a development version that I can run on my local XP and or 2000 machine and hook up to my webhost SQL server?

Any help would be moslty appreciated!

Thanks,There are free managers and querie analysiers here:

http://www.webattack.com/freeware/webpublish/fwdbquery.html

Also take a look at this amazing control:

http://www.geocities.com/scirocco_ha/DataControl.htm

Originally posted by JimWa
Can anyone tell me a cheap way to get this software, (Enterprize Manger and Query Analyzer). I am tyring to upsize to SQL Server with my Webhost and they are not very helpful in how to best do this.

So I am guessing I need these to connect to my new SQL Database. I know Microsoft has a trial version but isn't there a development version that I can run on my local XP and or 2000 machine and hook up to my webhost SQL server?

Any help would be moslty appreciated!

Thanks,|||See this thread for my opinion of a free manager:

http://81.130.213.94/myforum/forum_posts.asp?TID=84&PN=1

For query plans you'll need this one but it needs documenting:

http://81.130.213.94/myforum/forum_posts.asp?TID=78&PN=1

I've listed some more managers on this thread but you'll need to register for the forum to enter it:

http://81.130.213.94/myforum/forum_topics.asp?FID=25&PN=1

And of course you can use AdoAnywhere www.adoanywhere.com for sql even if you don't need its ADO gui features.

You can connect to my test servers - see details in forum.

Mike|||My Webhost is specific as to what to use:

Enterprisie Manger
Query Analyzer
MS Access 2002/XP

And the upsizing wizard in Access is giving me issues. It goes through the entire process and at the end says,

"The upsizing Wizard only works with Microsoft SQL Server (Versions 6.50 SP5 or higher) Please log into a SQL Server Data source."

And this is my webhosts response.

"We are running Microsoft SQL Server 2000. That is 2 generations newer than SQL Server 6.5. You might search Google or the Microsoft website to find out why Access is giving you that error. "

There support team is so helpful aren't they..|||You might have to get the trial version of SQL server since it comes with the tools you need. I think it runs for 12 weeks.

Can't say why Access is giving you the error , I don't use it, and no - your ISP help desk doesn't sound helpful...

Mike.|||Thanks Mike...

Saturday, February 25, 2012

Charts & Graphics

Does anyone have a good recommendation for software that allows me to create
*very* attractive charts, gauges, graphs, etc.?
Thanks,
-wpOn Mar 21, 2:44 pm, "Wild Packet" <w...@.contoso.com> wrote:
> Does anyone have a good recommendation for software that allows me to create
> *very* attractive charts, gauges, graphs, etc.?
> Thanks,
> -wp
Obviously, SQL Server Reporting Services 2005, Crystal Reports XI and
Dundas (http://www.dundas.com/Products/Chart/NET/index.aspx?
Campaign=GoogleDCP&gclid=CIXsm9urh4sCFR3VgAodRy99Ew) have pretty
decent charting/graphing capabilities; however, for the top of the
line/cream-of-the-crop, I would suggest Adobe Flex:
http://examples.adobe.com/flex2/inproduct/sdk/dashboard/dashboard.html
- http://www.adobe.com/products/flex/ . Hope this is helpful.
Regards,
Enrique Martinez
Sr. Software Consultant|||Thanks! I will givce those a try.
"EMartinez" <emartinez.pr1@.gmail.com> wrote in message
news:1174530873.250975.46390@.n76g2000hsh.googlegroups.com...
> On Mar 21, 2:44 pm, "Wild Packet" <w...@.contoso.com> wrote:
>> Does anyone have a good recommendation for software that allows me to
>> create
>> *very* attractive charts, gauges, graphs, etc.?
>> Thanks,
>> -wp
> Obviously, SQL Server Reporting Services 2005, Crystal Reports XI and
> Dundas (http://www.dundas.com/Products/Chart/NET/index.aspx?
> Campaign=GoogleDCP&gclid=CIXsm9urh4sCFR3VgAodRy99Ew) have pretty
> decent charting/graphing capabilities; however, for the top of the
> line/cream-of-the-crop, I would suggest Adobe Flex:
> http://examples.adobe.com/flex2/inproduct/sdk/dashboard/dashboard.html
> - http://www.adobe.com/products/flex/ . Hope this is helpful.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>

Chart: legend should not scale with the chart

The legend scales with the Chart. My client would the rectangles in the
legend to be perfect squares. Is this possible?
--
Callidus
Software DesignerYes, this is possible if you turn off the legend on the chart and use a
table instead to "draw" the legend for you. I will post a sample within the
next few days which shows how to do this.
Robert M. Bruckner
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Callidus" <Callidus@.discussions.microsoft.com> wrote in message
news:AE04FCEE-6125-4392-A9D0-FBDB89655532@.microsoft.com...
> The legend scales with the Chart. My client would the rectangles in the
> legend to be perfect squares. Is this possible?
> --
> Callidus
> Software Designer|||The sample RDL is shown at the bottom of this posting. It will require some
careful study to see how it works.
Robert M. Bruckner
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:e7Fdia%23VFHA.612@.TK2MSFTNGP12.phx.gbl...
> Yes, this is possible if you turn off the legend on the chart and use a
> table instead to "draw" the legend for you. I will post a sample within
> the next few days which shows how to do this.
>
> --
> Robert M. Bruckner
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Callidus" <Callidus@.discussions.microsoft.com> wrote in message
> news:AE04FCEE-6125-4392-A9D0-FBDB89655532@.microsoft.com...
>> The legend scales with the Chart. My client would the rectangles in the
>> legend to be perfect squares. Is this possible?
>> --
>> Callidus
>> Software Designer
=========================
<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition"
xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Author>Robert M. Bruckner</Author>
<Body>
<ReportItems>
<Table Name="table1">
<Height>0.5in</Height>
<ZIndex>1</ZIndex>
<Style />
<Header>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>3</ZIndex>
<rd:DefaultName>textbox1</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox2">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>2</ZIndex>
<rd:DefaultName>textbox2</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Legend</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Header>
<DataSetName>DataSet1</DataSetName>
<Top>0.125in</Top>
<Width>2in</Width>
<TableGroups>
<TableGroup>
<Header>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Rectangle Name="rectangle1">
<ZIndex>1</ZIndex>
<Style>
<BackgroundColor>=Code.GetColor(Fields!CategoryName.Value)</BackgroundColor>
</Style>
</Rectangle>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="CategoryName">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<rd:DefaultName>CategoryName</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!CategoryName.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Header>
<Grouping Name="table1_Group1">
<GroupExpressions>
<GroupExpression>=Fields!CategoryName.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Sorting>
<SortBy>
<SortExpression>=Fields!CategoryName.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
</TableGroup>
</TableGroups>
<Left>3.25in</Left>
<TableColumns>
<TableColumn>
<Width>0.25in</Width>
</TableColumn>
<TableColumn>
<Width>1.75in</Width>
</TableColumn>
</TableColumns>
</Table>
<Chart Name="chart1">
<ThreeDProperties>
<Rotation>30</Rotation>
<Inclination>30</Inclination>
<Shading>Simple</Shading>
<WallThickness>50</WallThickness>
</ThreeDProperties>
<Style>
<BackgroundColor>White</BackgroundColor>
</Style>
<Legend>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
<Position>BottomCenter</Position>
<Layout>Table</Layout>
</Legend>
<Palette>Default</Palette>
<ChartData>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=Sum(Fields!UnitsInStock.Value)</Value>
</DataValue>
</DataValues>
<DataLabel />
<Style>
<BackgroundColor>=Code.GetColor(Fields!CategoryName.Value)</BackgroundColor>
</Style>
<Marker>
<Size>6pt</Size>
</Marker>
</DataPoint>
</DataPoints>
</ChartSeries>
</ChartData>
<CategoryAxis>
<Axis>
<Title />
<MajorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<Min>0</Min>
</Axis>
</CategoryAxis>
<DataSetName>DataSet1</DataSetName>
<PointWidth>0</PointWidth>
<Type>Bar</Type>
<Top>0.25in</Top>
<Title />
<Width>3in</Width>
<Height>2.5in</Height>
<SeriesGroupings>
<SeriesGrouping>
<DynamicSeries>
<Grouping Name="chart1_SeriesGroup1">
<GroupExpressions>
<GroupExpression>=Fields!CategoryName.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Sorting>
<SortBy>
<SortExpression>=Fields!CategoryName.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
<Label>=Fields!CategoryName.Value</Label>
</DynamicSeries>
</SeriesGrouping>
</SeriesGroupings>
<Subtype>Plain</Subtype>
<PlotArea>
<Style>
<BackgroundColor>LightGrey</BackgroundColor>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</PlotArea>
<Left>0.125in</Left>
<ValueAxis>
<Axis>
<Title />
<MajorGridLines>
<ShowGridLines>true</ShowGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<Min>0</Min>
<Margin>true</Margin>
<Visible>true</Visible>
<Scalar>true</Scalar>
</Axis>
</ValueAxis>
</Chart>
</ReportItems>
<Style />
<Height>3.25in</Height>
</Body>
<TopMargin>1in</TopMargin>
<DataSources>
<DataSource Name="Northwind">
<rd:DataSourceID>f646058b-4784-494d-a09d-27fde13a5679</rd:DataSourceID>
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>data source=(local);initial
catalog=Northwind</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>
<Code> Private Shared colorPalette As String() = {"Green", "Blue",
"Red", "Orange", "Aqua", "Teal", "Gold", "RoyalBlue", "#A59D93", "#B8341B",
"#352F26", "#F1E7D6", "#E16C56", "#CFBA9B"}
Private Shared count As Integer = 0
Private Shared mapping As New System.Collections.Hashtable()
Public Function GetColor(ByVal groupingValue As String) As String
If mapping.ContainsKey(groupingValue) Then
Return mapping(groupingValue)
End If
Dim c As String = colorPalette(count Mod colorPalette.Length)
count = count + 1
mapping.Add(groupingValue, c)
Return c
End Function
</Code>
<Width>6.5in</Width>
<DataSets>
<DataSet Name="DataSet1">
<Fields>
<Field Name="ProductID">
<DataField>ProductID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="ProductName">
<DataField>ProductName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="SupplierID">
<DataField>SupplierID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="CategoryID">
<DataField>CategoryID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="QuantityPerUnit">
<DataField>QuantityPerUnit</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="UnitPrice">
<DataField>UnitPrice</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="UnitsInStock">
<DataField>UnitsInStock</DataField>
<rd:TypeName>System.Int16</rd:TypeName>
</Field>
<Field Name="UnitsOnOrder">
<DataField>UnitsOnOrder</DataField>
<rd:TypeName>System.Int16</rd:TypeName>
</Field>
<Field Name="ReorderLevel">
<DataField>ReorderLevel</DataField>
<rd:TypeName>System.Int16</rd:TypeName>
</Field>
<Field Name="Discontinued">
<DataField>Discontinued</DataField>
<rd:TypeName>System.Boolean</rd:TypeName>
</Field>
<Field Name="CategoryName">
<DataField>CategoryName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Country">
<DataField>Country</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>Northwind</DataSourceName>
<CommandText>SELECT Products.*, Categories.CategoryName,
Suppliers.Country
FROM Products INNER JOIN
Categories ON Products.CategoryID =Categories.CategoryID INNER JOIN
Suppliers ON Products.SupplierID =Suppliers.SupplierID</CommandText>
</Query>
</DataSet>
</DataSets>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<rd:ReportID>e5564b0f-4fab-4cf7-9cef-bda726589920</rd:ReportID>
<BottomMargin>1in</BottomMargin>
<Language>en-US</Language>
</Report>