Showing posts with label line. Show all posts
Showing posts with label line. Show all posts

Tuesday, March 27, 2012

adding a new line

Hello,

I have a column in my table that is ntext data type and it has html data. I need to strip all the html tags, which is pretty easy to do, but I also need to add a new line for every instance of "

". Do any of you know of a function or anything else that does that?

<p style="margin: 0px">11/21/06 - Position closed and filled by competition.

<p style="margin: 0px">&nbsp;

<p style="margin: 0px">11/3/2006 ADDITIONAL RESUMES NEEDED. HEAVY UNIX/LINUX Update 9/15/06 - Manager is still looking for qualified candidates for this position. Please respond NEW POSITION FOR ETS Location: Princeton, NJ Duration: 6 months New Max Rate: $55.00 Recruiter: Steve McDowell


If you are using SQL Server 2005 then convert the column to nvarchar(max). You can then use any of the built-in string functions to replace the values. However, these are operations that is not meant for SQL Server. It is more appropriate to clean the data on the client side before saving it to the database. If you are using SQL Server 2000 then you can use PATINDEX to search for string

and replace it. Below are some scripts that will help.

http://www.umachandar.com/technical/SQL6x70Scripts/Main62.htm -- strips html tags from varchar field. You have to modify it a bit to use it with ntext

http://www.umachandar.com/technical/SQL6x70Scripts/Main53.htm -- shows how to use updatetext

|||

Hello Uma,

First of, Thanks for your help!

I went through the code and I still dont understand how the code will add a new line for

or <n></n> instances. When you look at the data using IE you will see the columns appears like this:

11/21/06 - Position closed and filled by competition.

11/3/2006 ADDITIONAL RESUMES NEEDED. HEAVY UNIX/LINUX Update 9/15/06 - Manager is still looking for qualified candidates for this position.

But in my table you see the column appears with all the html tags and comes out like this:

<p style="margin: 0px">11/21/06 - Position closed and filled by competition.

<p style="margin: 0px">&nbsp;

<p style="margin: 0px">11/3/2006 ADDITIONAL RESUMES NEEDED. HEAVY UNIX/LINUX Update 9/15/06 - Manager is still looking for qualified candidates for this position.

I need to clean up the data and make it appear as simple text in my table without all the html tags but when that column (the new col) is view using IE, it needs to still show the new line for every

or <n></n>.

Can you help? Please let me know if you have any questions.

Sunday, March 25, 2012

Adding a line to a chart

Hi,
Does anyone know how to manually add a line to a chart in whatever location
I want without using any sort of dataset? Or is this even possible?
ThanksIt depends.
(1) If you do NOT have any dynamic series groupings in the chart, it is
easy. Just add another item in the "Values" section of the chart properties
dialog / data tab. For the value you can use a constant expression like
=10000 to get a line at y-axis value 10000.
(2) If you have a series grouping (e.g. group by year), then you would have
one "Value" (i.e. static series) for the actual value to be shown and you
would add a second "Value" for the line. Since you would want this line to
only show up once even though there are several series groups at runtime,
you have use an expression to show a constant value only for one particular
grouping value and Nothing for all other grouping values of the series
grouping.
You will find an example at the bottom of this posting based on Northwind
data. The example will need some careful study to see how to make the
constant line appear only once in the chart. Note: the additional legend
entries cannot be removed. The only alternative here is to not draw any
legend on the chart and use an expression to show certain datapoint labels
inside the chart e.g. only on the first datapoint of every series.
--
Robert M. Bruckner
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
All code samples are provided "AS IS" without warranty of any kind, either
express or implied, including but not limited to the implied warranties of
merchantability and/or fitness for a particular purpose.
"Spencer23" <Spencer23@.discussions.microsoft.com> wrote in message
news:30C566FB-2146-484B-8AD2-6D48D4E0BF9D@.microsoft.com...
> Hi,
> Does anyone know how to manually add a line to a chart in whatever
location
> I want without using any sort of dataset? Or is this even possible?
> Thanks
===========================================
<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefini
tion"
xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Chart Name="Sales">
<ThreeDProperties>
<Rotation>30</Rotation>
<Inclination>30</Inclination>
<Shading>Simple</Shading>
<WallThickness>50</WallThickness>
</ThreeDProperties>
<Style />
<Legend>
<Visible>true</Visible>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<Color>Brown</Color>
</Style>
<Position>BottomCenter</Position>
<Layout>Table</Layout>
</Legend>
<Palette>Default</Palette>
<ChartData>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=Sum(Fields!UnitPrice.Value *
Fields!Quantity.Value)</Value>
</DataValue>
</DataValues>
<DataLabel />
<Marker>
<Size>6pt</Size>
</Marker>
</DataPoint>
</DataPoints>
</ChartSeries>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=iif(1997 = Year(Fields!OrderDate.Value), 130000,
Nothing)</Value>
</DataValue>
</DataValues>
<DataLabel />
<Marker>
<Size>6pt</Size>
</Marker>
</DataPoint>
</DataPoints>
</ChartSeries>
</ChartData>
<CategoryAxis>
<Axis>
<Title>
<Style />
</Title>
<Style />
<MajorGridLines>
<ShowGridLines>true</ShowGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<Visible>true</Visible>
</Axis>
</CategoryAxis>
<DataSetName>Northwind</DataSetName>
<PointWidth>100</PointWidth>
<Type>Line</Type>
<Title>
<Caption>Sales</Caption>
<Style>
<FontSize>14pt</FontSize>
<FontWeight>700</FontWeight>
</Style>
</Title>
<CategoryGroupings>
<CategoryGrouping>
<DynamicCategories>
<Grouping Name="Sales_CategoryGroup1">
<GroupExpressions>
<GroupExpression>=Month(Fields!OrderDate.Value)</GroupExpression>
</GroupExpressions>
</Grouping>
<Sorting>
<SortBy>
<SortExpression>=Month(Fields!OrderDate.Value)</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
<Label>=MonthName(Month(Fields!OrderDate.Value))</Label>
</DynamicCategories>
</CategoryGrouping>
</CategoryGroupings>
<Height>6.125in</Height>
<SeriesGroupings>
<SeriesGrouping>
<DynamicSeries>
<Grouping Name="Sales_SeriesGroup1">
<GroupExpressions>
<GroupExpression>=Year(Fields!OrderDate.Value)</GroupExpression>
</GroupExpressions>
</Grouping>
<Label>=""</Label>
</DynamicSeries>
</SeriesGrouping>
<SeriesGrouping>
<StaticSeries>
<StaticMember>
<Label>="Sales " & Year(Fields!OrderDate.Value)</Label>
</StaticMember>
<StaticMember>
<Label>=iif(1997 = Year(Fields!OrderDate.Value), "Target", "
")</Label>
</StaticMember>
</StaticSeries>
</SeriesGrouping>
</SeriesGroupings>
<Subtype>Plain</Subtype>
<PlotArea>
<Style>
<BackgroundGradientEndColor>White</BackgroundGradientEndColor>
<BackgroundGradientType>TopBottom</BackgroundGradientType>
<BackgroundColor>LightGrey</BackgroundColor>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</PlotArea>
<ValueAxis>
<Axis>
<Title>
<Style />
</Title>
<Style />
<MajorGridLines>
<ShowGridLines>true</ShowGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<MinorTickMarks>Outside</MinorTickMarks>
<Min>0</Min>
<Margin>true</Margin>
<Visible>true</Visible>
<Scalar>true</Scalar>
</Axis>
</ValueAxis>
</Chart>
</ReportItems>
<Style />
<Height>6.5in</Height>
</Body>
<TopMargin>1in</TopMargin>
<DataSources>
<DataSource Name="Northwind">
<rd:DataSourceID>da5964d0-11a7-4e51-9b22-cc4fa55fdd7a</rd:DataSourceID>
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>data source=(local);initial
catalog=Northwind</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>
<Width>6.5in</Width>
<DataSets>
<DataSet Name="Northwind">
<Fields>
<Field Name="UnitPrice">
<DataField>UnitPrice</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="Quantity">
<DataField>Quantity</DataField>
<rd:TypeName>System.Int16</rd:TypeName>
</Field>
<Field Name="OrderDate">
<DataField>OrderDate</DataField>
<rd:TypeName>System.DateTime</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>Northwind</DataSourceName>
<CommandText>SELECT [Order Details].UnitPrice, [Order
Details].Quantity, Orders.OrderDate
FROM Orders INNER JOIN
[Order Details] ON Orders.OrderID = [Order
Details].OrderID
ORDER BY Orders.OrderDate</CommandText>
<Timeout>30</Timeout>
</Query>
</DataSet>
</DataSets>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<rd:ReportID>bc811835-2302-4f9e-9c89-a99d4d3f5fd2</rd:ReportID>
<BottomMargin>1in</BottomMargin>
</Report>

Adding a line return to an SQL messge

HI all,
I'm adding a custom SQL message. How do I insert a new line, line feed. So
that the message is split between a few lines
Thanks
RobertRobert
SELECT 'HELLO'+ CHAR(13)+'World'
"Robert Bravery" <me@.u.com> wrote in message
news:ukG8HCflGHA.4772@.TK2MSFTNGP03.phx.gbl...
> HI all,
> I'm adding a custom SQL message. How do I insert a new line, line feed. So
> that the message is split between a few lines
> Thanks
> Robert
>|||select 'error' + char(13) + 'message'
--
-Omnibuzz (The SQL GC)
http://omnibuzz-sql.blogspot.com/
"Robert Bravery" wrote:

> HI all,
> I'm adding a custom SQL message. How do I insert a new line, line feed. So
> that the message is split between a few lines
> Thanks
> Robert
>
>|||A "proper" CR+LF pair is:
SELECT 'foo' + CHAR(13) + CHAR(10) + 'bar';
"Robert Bravery" <me@.u.com> wrote in message
news:ukG8HCflGHA.4772@.TK2MSFTNGP03.phx.gbl...
> HI all,
> I'm adding a custom SQL message. How do I insert a new line, line feed. So
> that the message is split between a few lines
> Thanks
> Robert
>|||A "proper" CR+LF pair is:
SELECT 'foo' + CHAR(13) + CHAR(10) + 'bar';
"Robert Bravery" <me@.u.com> wrote in message
news:ukG8HCflGHA.4772@.TK2MSFTNGP03.phx.gbl...
> HI all,
> I'm adding a custom SQL message. How do I insert a new line, line feed. So
> that the message is split between a few lines
> Thanks
> Robert
>|||Another method:
EXEC sp_addmessage 60000, 10, 'This
is
a
multi-line
message'
RAISERROR(60000, 10, 1)
Hope this helps.
Dan Guzman
SQL Server MVP
"Robert Bravery" <me@.u.com> wrote in message
news:ukG8HCflGHA.4772@.TK2MSFTNGP03.phx.gbl...
> HI all,
> I'm adding a custom SQL message. How do I insert a new line, line feed. So
> that the message is split between a few lines
> Thanks
> Robert
>|||Thanks
Robert
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:uHwpxnflGHA.4080@.TK2MSFTNGP03.phx.gbl...
> Another method:
> EXEC sp_addmessage 60000, 10, 'This
> is
> a
> multi-line
> message'
> RAISERROR(60000, 10, 1)
>
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Robert Bravery" <me@.u.com> wrote in message
> news:ukG8HCflGHA.4772@.TK2MSFTNGP03.phx.gbl...
So
>|||This begs the question about why format output from SQL Server instead of
the client application...
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"Robert Bravery" <me@.u.com> wrote in message
news:ukG8HCflGHA.4772@.TK2MSFTNGP03.phx.gbl...
> HI all,
> I'm adding a custom SQL message. How do I insert a new line, line feed. So
> that the message is split between a few lines
> Thanks
> Robert
>|||Sometimes it's just a heck of a lot easier to do in SS than a given client.
A good example is a spreadsheet I created for one of my coworkers that draws
data from some SS queries. Word wrap wasn't working the way he wanted on
some column headers and adding the CR between 2 key parts of the field alias
solved the problem.
Randall Arnold
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:upvDfGhlGHA.836@.TK2MSFTNGP02.phx.gbl...
> This begs the question about why format output from SQL Server instead of
> the client application...
> --
> Arnie Rowland, YACE*
> "To be successful, your heart must accompany your knowledge."
> *Yet Another certification Exam
>
> "Robert Bravery" <me@.u.com> wrote in message
> news:ukG8HCflGHA.4772@.TK2MSFTNGP03.phx.gbl...
>|||>> I'm adding a custom SQL message. How do I insert a new line, line feed. S
o that the message is split between a few lines <<
Why are you doing display in the database and not the front end? The
basic principle of a tiered architecture is that display is done in the
front end and never in the back end. This a more basic programming
principle than just SQL and RDBMS.

Adding a line number to SQL Output

Guess I am going brain dead at the momnet!

I want to add a line number to a simple SQL query so the output would look something like:

1 Output of the select statement
2 Output of the select statement
3 Output of the select statement

My current statement is basically:

Select field1, field2, field3, field4
From table1
where field1 = somevalue

Like I typed, very simple. I am just not finding how I should add a line number to the output.

Any help would be appreciated!Originally posted by jhimes

Select field1, field2, field3, field4
From table1
where field1 = somevalue


Try adding rownum to your select statement.

[code]

Select field1, field2, field3, field4, rownum as count
From table1
where field1 = somevalue

Oh - yea an update to this - I assume you are on Oracle - if its another database, that probably wont work.|||Thank you, that is just what I needed!|||And yes I am on Oracle & just learning real SQL (from Microsoft Access SQL).|||Originally posted by jhimes
And yes I am on Oracle & just learning real SQL (from Microsoft Access SQL).

You're welcome - Oracle is the place to be! Good luck and check back with questions because I am still always learning something new myself.

Adding a line

Is it possible to add this line into the main select:
SELECT 1 as Tag, NULL As Parent,
'http://PartnerLink.Artifacts.StockMovement.Schemas.StockMovement_BTSQL' As
[StockMovement!1!xmlns]
for xml explicit
output
<StockMovement
xmlns="http://PartnerLink.Artifacts.StockMovement.Schemas.StockMovement_BTSQ
L"/>
SELECT Delivery.DeliveryID, DeliveryType, DeliveryDate, DeliveryInfo,
ReceiveStore, ReceiveCountry, ReceiveCurrency, SenderStore, SenderCountry,
SenderCurrency, Status, Direction, GUID,
Style.DeliveryID as StyleTableDeliveryID, Style.LineNumber as
StyleLineNumber, StyleID, MasterEAN, Category, Department, [Description],
Style.Quantity as StyleQty, CostPrice, SalesPrice, VatCode,
InfoTextReference,
Variant.DeliveryID as VariantTableDeliveryID, Variant.LineNumber as
VariantTableLineNumber, VariantEAN, Variant.Quantity as VariantQty, Color,
Length, [Size]
FROM Delivery
inner join Style on Delivery.DeliveryID = Style.DeliveryID
inner join Variant on Style.LineNumber = Variant.LineNumber AND
Delivery.DeliveryID = Variant.DeliveryID
Where Delivery.Status = 1
for xml auto, elements
Output
<Delivery><DeliveryID>1</DeliveryID><DeliveryType>35</DeliveryType><Delivery
Date>20060431</DeliveryDate><DeliveryInfo>Afleveres
ved
porten</DeliveryInfo><ReceiveStore>1</ReceiveStore><ReceiveCountry>1</Receiv
eCountry><ReceiveCurrency>1</ReceiveCurrency><Se
Result should be
<StockMovement
xmlns="http://PartnerLink.Artifacts.StockMovement.Schemas.StockMovement_BTSQ
L">
<Delivery><DeliveryID>1</DeliveryID><DeliveryType>35</DeliveryType><Delivery
Date>20060431</DeliveryDate><DeliveryInfo>Afleveres
ved
porten</DeliveryInfo><ReceiveStore>1</ReceiveStore><ReceiveCountry>1</Receiv
eCountry><ReceiveCurrency>1</ReceiveCurrency><SeNo, not as long as you specify , ELEMENTS (I am guessing that you are on SS
2000, otherwise have a look at FOR XML PATH).
/ Tobias

Adding a horizontal bar chart to results

I want to add a horizontal bar chart to each line of my results:
Question Choice Percentage Chart
1 Yes %75 |||||||||| |
2 No %25 |||| |
Is there a way to do this in SQL Server Reporting Services?
BrandonYou could write custom function to generate bitmap image.
Email me if you want an example
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brandon Tyler" <tyler_brandon[NOSPAMO]@.hotmail.com> wrote in message
news:%23ZVseeDGFHA.1044@.TK2MSFTNGP14.phx.gbl...
>I want to add a horizontal bar chart to each line of my results:
> Question Choice Percentage Chart
> 1 Yes %75 |||||||||| |
> 2 No %25 |||| |
> Is there a way to do this in SQL Server Reporting Services?
> Brandon
>|||You could do it with charts: add a table and a table group based on Question
/ Choice and drop a chart into the group *header*.
Though, Lev's suggestion is in many cases better from a performance point of
view, etc.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Lev Semenets [MSFT]" <levs@.microsoft.com> wrote in message
news:ufj20qGGFHA.3648@.TK2MSFTNGP09.phx.gbl...
> You could write custom function to generate bitmap image.
> Email me if you want an example
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Brandon Tyler" <tyler_brandon[NOSPAMO]@.hotmail.com> wrote in message
> news:%23ZVseeDGFHA.1044@.TK2MSFTNGP14.phx.gbl...
>>I want to add a horizontal bar chart to each line of my results:
>> Question Choice Percentage Chart
>> 1 Yes %75 |||||||||| |
>> 2 No %25 |||| |
>> Is there a way to do this in SQL Server Reporting Services?
>> Brandon
>>
>|||Lev,
I am interested in that code! How do I get hold of it? I do not have email
address for you. Mine is wiseteufel[AT]yahoo.com. Thanks in advance.
--
Message posted via http://www.sqlmonster.com|||Hello James,
I've posted it here: http://blogs.msdn.com/levs/archive/2005/02/24.aspx
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"James Woo via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:b213f85c9f314f1e82c6c9606d00936b@.SQLMonster.com...
> Lev,
> I am interested in that code! How do I get hold of it? I do not have email
> address for you. Mine is wiseteufel[AT]yahoo.com. Thanks in advance.
> --
> Message posted via http://www.sqlmonster.com|||thanks. looks very nice.
--
Message posted via http://www.sqlmonster.comsql

Adding a DTS package

Can a DTS package be added to a server via the command line using OSQL?
Thanks in advance
JohnI don't think this is possible.
Anithsql

adding a datestamp automatically

Hi,
As a convert from Access, I need a little help please.
I need to get a datestamp into a new record when it is created.
I can see the line for Default Value, but don't know what code to insert
here.
Many thanks,
NEIL
In news:csisi5$9ge$1$8300dec7@.news.demon.co.uk,
Neil Jarman <neil@.tNOiSPAMvPLEASEy.co.uk> said:
> Hi,
> As a convert from Access, I need a little help please.
> I need to get a datestamp into a new record when it is created.
> I can see the line for Default Value, but don't know what code to
> insert here.
Default should be:
getDate()
Steve
|||Hi Steve,
Many thanks!
NEIL
"Steve" <steve@.somewhere.invalid.com> wrote in message
news:FH6Hd.958160$2W1.74289@.news.easynews.com...
> In news:csisi5$9ge$1$8300dec7@.news.demon.co.uk,
> Neil Jarman <neil@.tNOiSPAMvPLEASEy.co.uk> said:
> Default should be:
> getDate()
> --
> Steve
>

adding a datestamp automatically

Hi,
As a convert from Access, I need a little help please.
I need to get a datestamp into a new record when it is created.
I can see the line for Default Value, but don't know what code to insert
here.
Many thanks,
NEILIn news:csisi5$9ge$1$8300dec7@.news.demon.co.uk,
Neil Jarman <neil@.tNOiSPAMvPLEASEy.co.uk> said:
> Hi,
> As a convert from Access, I need a little help please.
> I need to get a datestamp into a new record when it is created.
> I can see the line for Default Value, but don't know what code to
> insert here.
Default should be:
getDate()
Steve|||Hi Steve,
Many thanks!
NEIL
"Steve" <steve@.somewhere.invalid.com> wrote in message
news:FH6Hd.958160$2W1.74289@.news.easynews.com...
> In news:csisi5$9ge$1$8300dec7@.news.demon.co.uk,
> Neil Jarman <neil@.tNOiSPAMvPLEASEy.co.uk> said:
> Default should be:
> getDate()
> --
> Steve
>

adding a datestamp automatically

Hi,
As a convert from Access, I need a little help please.
I need to get a datestamp into a new record when it is created.
I can see the line for Default Value, but don't know what code to insert
here.
Many thanks,
NEILIn news:csisi5$9ge$1$8300dec7@.news.demon.co.uk,
Neil Jarman <neil@.tNOiSPAMvPLEASEy.co.uk> said:
> Hi,
> As a convert from Access, I need a little help please.
> I need to get a datestamp into a new record when it is created.
> I can see the line for Default Value, but don't know what code to
> insert here.
Default should be:
getDate()
--
Steve|||Hi Steve,
Many thanks!
NEIL
"Steve" <steve@.somewhere.invalid.com> wrote in message
news:FH6Hd.958160$2W1.74289@.news.easynews.com...
> In news:csisi5$9ge$1$8300dec7@.news.demon.co.uk,
> Neil Jarman <neil@.tNOiSPAMvPLEASEy.co.uk> said:
>> Hi,
>> As a convert from Access, I need a little help please.
>> I need to get a datestamp into a new record when it is created.
>> I can see the line for Default Value, but don't know what code to
>> insert here.
> Default should be:
> getDate()
> --
> Steve
>

Thursday, March 22, 2012

Adding a blank line after a group of rows

I have an rdl report that shows rows group by category. I would like to include a blank line after each set of categories. Can anyone point me to how I would do that in the rdl.

thanks

idriss

Hi,

Add a blank Group Footer and increase the height of it as per your requirements.

HTH,
Suprotim Agarwal

--
http://www.dotnetcurry.com
--

Tuesday, March 20, 2012

AddcurrentRange ?

Report.ParameterFields(4).AddCurrentRange "000", "999", 3
In this line of code, what does number 3 stands for ? 000 is start and 999 is end range I presume, but number 3 is a mistery 2 me.According to info I found :

"Use this bitwise value to indicate whether the upper and/or lower bound of the range should be included".

I'm not sure which value indicates what, though.

Hope this helps.|||http://support.businessobjects.com/library/kbase/articles/c2007345.asp :

'crRangeNotIncludeUpperLowerBound 0
'crRangeIncludeLowerBound 2
'crRangeIncludeUpperBound 1
'crRangeNoLowerBound 8
'crRangeNoUpperBound 4

I would guess the value 3 probably means include both upper and lower?

Tuesday, March 6, 2012

Add Line for Series Group Total to chart

Have trend chart with lines for monthly costs for individual assets. I need
to add another line for the total each month. When I add a new Value to sum
the costs, I get duplicate lines on the chart. What am I doing wrong?
TIA
DeanIn your new Value set the following value:
= sum(Fields!Yourfield.Value, "DATASETNAME")
Hope this helps.
"Dean" <deanl144@.hotmail.com.nospam> escribió en el mensaje
news:uv2uapZEIHA.3548@.TK2MSFTNGP06.phx.gbl...
> Have trend chart with lines for monthly costs for individual assets. I
> need to add another line for the total each month. When I add a new Value
> to sum the costs, I get duplicate lines on the chart. What am I doing
> wrong?
> TIA
> Dean
>

Thursday, February 16, 2012

add a login to a database role (was "Very Confusing")

This stuff makes no sense what so ever,

In the Books on Line of MSSQL2000
In "Adding a Member to a SQL Server Database Role"

There is this
"Note : When you add a Windows NT 4.0 or Windows 2000 login without a user account in the database to a SQL Server database role, SQL Server creates a user account in the database automatically, even if that Windows NT 4.0 or Windows 2000 login cannot otherwise access the database."

I mean how can anyone add a login to a database role without making the login a user of the database.:shocked:
Also if it worked, a new fancy feature to add new logins??:eek:
Plz help:SI believe it adds it as a user automatically.|||I believe it adds it as a user automatically.

But i cannot do it:eek:
"user" must exist before "role".
If you can do it,plz explain:)|||The following discussion assumes that BUILTIN\Administrators is part of the SQL Server sysadmin group:

1. Create a junk Windows login
2. Make that login a member of the machine's Administrators group
3. Start SQL Enterprise Mangler
4. Select the target database
5. Create a new (junk) role within the database.
6. Verify there is no user in the db for your junk login
7. Add your junk Windows login to your junk role.
8. Verify there is now a user in the db for your junk login

The reason that you could add the login to the role was because they implicitly have access to the database because they are members of the sysadmin role. Once you assign them to a role within the database, SQL Server needs some way to store that membership information, so it has to create a user where none explicitly existed before.

-PatP|||7. Add your junk Windows login to your junk role.
-PatP

1&2>created a user account with account type computer administrator.
3>started enterprise manager
4>selected a target db
5>created junk dbrole
6>verified no junk user
7>double clicked junk dbrole, clicked add..
:confused: junk user not there:confused:
Only users who are database "users" are appearing.

I am working on an XP,maybe thats why the difference.|||So you can see the junk login inside the junk group, but you can not see the junk login in the database users ?!?!

-PatP|||No, the junk login does not appear when i click the add button of the junk role.

The junklogin will appear only if i give junklogin access to the SQL server first and then make the junklogin a user of the database first.
Only after this is done, can i see the junklogin, infact any login works this way.|||I'm one of the "scripts our us" kind of guys... Rather than asking you to do 10,000 clicks, can you run:DECLARE @.cJunque sysname
SELECT @.cJunque = 'MyMachine\JunqueLogin' -- Machine Administrator

EXECUTE sp_helpuser @.cJunque -- Prove "no one home"

EXECUTE sp_addrole 'Junque' -- Create group
EXECUTE sp_helprole 'Junque' -- Confirm still empty

EXECUTE sp_addrolemember 'Junque', @.cJunque -- Add junk login

EXECUTE sp_helprole 'Junque' -- See who's "home" now
EXECUTE sp_helpuser @.cJunque -- Should be a user

EXECUTE sp_droprole 'Junque' -- Tidy up...
EXECUTE sp_dropuser @.cJunque -- ...completely...and post the output?

-PatP|||That worked :D
It even says in Enterprise Manager, "Database Access : Via group membership" for junkuser.
Only i think the user has to be droped before the group.

I dont think this can be done through Enterprise Manager directly??

:beer: Thanks.:beer:|||Server: Msg 15198, Level 16, State 1, Procedure sp_helpuser, Line 189
The name supplied (piii\junkuser) is not a user, role, or aliased login.
New role added.

(1 row(s) affected)

'piii\dbtemp' added to role 'Junque'.

(1 row(s) affected)

Server: Msg 15198, Level 16, State 1, Procedure sp_helpuser, Line 189
The name supplied (piii\junkuser) is not a user, role, or aliased login.
Server: Msg 15144, Level 16, State 1, Procedure sp_droprole, Line 53
The role has members. It must be empty before it can be dropped.

User has been dropped from current database.

Add a line feed to a string

How do you add a line feed to string variable?
="Activate Item " + Fields!item_id.Value + \n + Fields!
item_desc.Value
Thanks
BobRS uses .Net
"foo" + System.Environment.NewLine