Showing posts with label column. Show all posts
Showing posts with label column. Show all posts

Friday, March 30, 2012

is it possible to pass a report table column in sql reporting serivces

Hi,
I am having a storeprocedure which will return 10 columns data and i designed a table with 10 columns and i made 2 columns, visible = false.
Is it possible to show those two columns visible = true at runtime?
Please give me how to do.
Thanks & Regards
Lokesh

Select the column in the report designer, then set the Hidden property under Visibility in the Properties window to an expression. Set that expression to contain the logic you desire.

Hope that helps,

-Lukasz

is it possible to pass a report table column in sql reporting serivces

Hi,
I am having a storeprocedure which will return 10 columns data and i designed a table with 10 columns and i made 2 columns, visible = false.
Is it possible to show those two columns visible = true at runtime?
Please give me how to do.
Thanks & Regards
Lokesh

Select the column in the report designer, then set the Hidden property under Visibility in the Properties window to an expression. Set that expression to contain the logic you desire.

Hope that helps,

-Lukasz

sql

Is it possible to modify column data type of view

The SQL Server Management Studio shows the data type of each column of views. I am wondering how SQL server determines the types since my SQL code of views does not specifiy data types for any columns.

I am much more interested in knowing whether the data types can be modified. Could anyone offer some hint?

Thanks,

hz

SQL Server uss the underlying schema information to do so unless you don′t specify a different data type than the source data type (liek within CONVERT). You can change the resulting data type in the view e.g. via CONNVERT(VARCHAR(10),GETDATE(),112), which was a datetime before and a varchar afterwards.

HTH, Jens Suessmeyer.|||

Jens, thanks a lot! That is exactly what I was looking for.

hz

Wednesday, March 28, 2012

Is it possible to merge date from 2 or 3 tables into a View?

Suppose I have three tables Type1Events, Type2Events, and Type3Events where
each table has a DateTime column for the date and time the event occurs,
along with some data specific to the event. Can I pull all events from the
three tables into a single View so that the data appears as if it were one
single table, and use a where condition for the date range so that only
events in a certain date range for all three tables appear? So my output
might look like this
EventDate Type
=================
1/1/2001 1
1/2/2001 2
2/1/2003 3
... etc...
Not sure if this makes sense but. I really don't care about the data in the
tables for this example, only the ocurrances in dates ranges for all three.
thanks,
JIM
EventTables
CREATE TABLE dbo.Type1Events (
id int NOT NULL IDENTITY (1, 1),
eventDate datetime NOT NULL,
somedata text NOT NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE dbo.Type2Events (
id int NOT NULL IDENTITY (1, 1),
eventDate datetime NOT NULL,
somedata text NOT NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE dbo.Type3Events (
id int NOT NULL IDENTITY (1, 1),
eventDate datetime NOT NULL,
somedata text NOT NULL
) ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
INSERT INTO Type1Events ( eventDate, someData ) values ( '1/1/2001',
'data1' )
INSERT INTO Type1Events ( eventDate, someData ) values ( '1/1/2002',
'data2' )
INSERT INTO Type2Events ( eventDate, someData ) values ( '1/1/2003',
'data3' )
INSERT INTO Type2Events ( eventDate, someData ) values ( '2/1/2002',
'data4' )
INSERT INTO Type3Events ( eventDate, someData ) values ( '3/1/2001',
'data5' )
INSERT INTO Type3Events ( eventDate, someData ) values ( '4/1/2002',
'data6' )
INSERT INTO Type2Events ( eventDate, someData ) values ( '5/1/2006',
'data7' )
INSERT INTO Type1Events ( eventDate, someData ) values ( '6/1/2004',
'data8' )
INSERT INTO Type3Events ( eventDate, someData ) values ( '7/1/2005',
'data9' )
GOcreate view events
as
select eventDate, someData from Type1Events
union all
select eventDate, someData from Type2Events
union all
select eventDate, someData from Type3Events
go|||Sorry, a more complete solution is:
create view events
as
select 1 as eventType, eventDate, someData from Type1Events
union all
select 2, eventDate, someData from Type2Events
union all
select 3, eventDate, someData from Type3Events
go|||Jeff,
Thanks a lot!, I figured it should be easy but havn't used union much so...
thanks,
JIM
"JeffB" <jeff.bolton@.citigatehudson.com> wrote in message
news:1142016783.270339.21280@.u72g2000cwu.googlegroups.com...
> Sorry, a more complete solution is:
> create view events
> as
> select 1 as eventType, eventDate, someData from Type1Events
> union all
> select 2, eventDate, someData from Type2Events
> union all
> select 3, eventDate, someData from Type3Events
> go
>

Monday, March 26, 2012

Is it possible to get all the column values in a single column?

Hi
Is it possible to get all the column values in a single column from a
table?
For e.g.
a1 a2 a3
== == ==
1 2 3
4 5 6
I need the output like
Allcolums
***********
123
456
I am not ready to mention the column names in the query. It should be
generic.
Thanks in advance.Hi
You would be better of leaving this for the front end otherwise it would
mean resorting to cursors and dynamic SQL.
John
"KssKumar2000" wrote:

> Hi
> Is it possible to get all the column values in a single column from a
> table?
> For e.g.
> a1 a2 a3
> == == ==
> 1 2 3
> 4 5 6
> I need the output like
> Allcolums
> ***********
> 123
> 456
>
> I am not ready to mention the column names in the query. It should be
> generic.
> Thanks in advance.
>|||will this work
assuming that each column is of string data type
select a1+a2+a3 from table
or this one if you have nulls
select isnull(a1,'')+isnull(a1,'')+isnull(a1,''
)
thanks,
Jose de Jesus Jr. Mcp,Mcdba
MCP #2324787
"KssKumar2000" wrote:

> Hi
> Is it possible to get all the column values in a single column from a
> table?
> For e.g.
> a1 a2 a3
> == == ==
> 1 2 3
> 4 5 6
> I need the output like
> Allcolums
> ***********
> 123
> 456
>
> I am not ready to mention the column names in the query. It should be
> generic.
> Thanks in advance.
>|||You might want to learn about First Normal Form (1NF) and what a tiered
architecture is before you try SQL coding. You have missed the
foundations and are asking for kludges in Newsgroups when you need to
be studying.
If you **really** want to be a bad programmer, look up cursors and
always comment your code with a note that it needs to be replaced by a
good SQL programmer.|||You might want to find out why the poster wants to do this before you slag
him or her off.
Just because with your limited real industrial experience in programming
you've not come across a need for this doesn't make the poster a bad
programmer.
You need a serious lesson in maners - go back to school and learn how to
interact with society, perhaps you should just shut up with the dissing
people on here and take lessons on how to politly communicate with people!
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"--CELKO--" <jcelko212@.earthlink.net> wrote in message
news:1134740263.450919.20570@.g47g2000cwa.googlegroups.com...
> You might want to learn about First Normal Form (1NF) and what a tiered
> architecture is before you try SQL coding. You have missed the
> foundations and are asking for kludges in Newsgroups when you need to
> be studying.
> If you **really** want to be a bad programmer, look up cursors and
> always comment your code with a note that it needs to be replaced by a
> good SQL programmer.
>|||Yes BUT...the ng needs wits regardless of the adjective(s) or
quantity(s) that realistically apply :)
Happy Holidays to the full spectrum of wits...
www.rac4sql.net
"Tony Rogerson" <tonyrogerson@.sqlserverfaq.com> wrote in message
news:eLEMwGlAGHA.2040@.TK2MSFTNGP14.phx.gbl...
> You might want to find out why the poster wants to do this before you slag
> him or her off.
> Just because with your limited real industrial experience in programming
> you've not come across a need for this doesn't make the poster a bad
> programmer.
> You need a serious lesson in maners - go back to school and learn how to
> interact with society, perhaps you should just shut up with the dissing
> people on here and take lessons on how to politly communicate with people!
> --
> Tony Rogerson
> SQL Server MVP
> http://sqlserverfaq.com - free video tutorials
>
> "--CELKO--" <jcelko212@.earthlink.net> wrote in message
> news:1134740263.450919.20570@.g47g2000cwa.googlegroups.com...
>

is it possible to freeze column or row in a report?

I am using sql 2000 reporting service. One of the matrix report which has so
many columns and rows and it stretches beyond the width and height of the
paper size specified and the first row and column of the matrix report
showing the description of the data like the column/row header and I wonder
if it is possible to freeze this row and column in the report so that it is
visible when scrolling down or to the right of the report. Thanks.That is possible in RS 2005, but not in RS 2000
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Paul" <paul_mak@.shaw.ca> wrote in message
news:%23O6$fs7EGHA.3700@.TK2MSFTNGP15.phx.gbl...
>I am using sql 2000 reporting service. One of the matrix report which has
>so many columns and rows and it stretches beyond the width and height of
>the paper size specified and the first row and column of the matrix report
>showing the description of the data like the column/row header and I wonder
>if it is possible to freeze this row and column in the report so that it is
>visible when scrolling down or to the right of the report. Thanks.
>

Friday, March 23, 2012

Is it possible to email a reportviewer graph as the email body not as an attachment

I have a page that disaplays a column report in a reportviewer control and the report processing mode is local not server. I was just wondering if its possible to programmatically email this graph as the email body not as an attachment using the system.net.mail classses. The email recepients have MS outlook email addresses.

Thanks in advance.

I still want help on this. And now i'm backing off from sending the report as the email body. It wouldn't hurt if the report is send as an attachment. Please some out there help.

|||

http://www.codeproject.com/csharp/Email_a_PDF_Report.asp

is it possible to do this?

Hi,

I have a table with 2 columns. If the condition for that text box evaluates to true i want to hide the second column and make the first columns width equal to the First and the second... for example this.

Company Match

Years of service Vesting %

its gonna display like this if the condition is false..

if true i want it to display

Company Match

Immediately Eligible (this should be in the middle) right now i can display it like this

Company Match

Immediately elgigible..

Any help will be appreciated.

Regards

Karen

Instead of hiding a column, why dont you use two asp:label and Hide the other if your condition matches. That makes your life more easier.

|||

i want to do this in the report itself?

Regards

Karen

|||

Each colum is act as a textbox

Go to its properties -> Visiblity-> Hidden

The value for Hidden can be an expression like " = iif(CDec(Parameters!xxxVal.Value) > 0.00,false,true)"

|||

Instead of hiding a column, why dont you use two asp:label and Hide theother if your condition matches. That makes your life more easier.

|||

how can i use asp:Label in SSRS? Never mind guys i solved it

Karen

sql

Wednesday, March 21, 2012

Is it possible to create the columns of a #Temp table base on a query result?

I’ve been trying without success something like this…

CREATE TABLE #table

(

(SELECT MAX(Column) FROM Table) varchar(50)

)

I'm working with SQL 2005; thank you for any help in advance.

Not quite like that.

You can SELECT ... INTO.

In the process, you need to provide a column Name for any computed or derived columns, and you can change the datatype.

Something like this:

Code Snippet


USE Northwind
GO

SELECT cast( max( EmployeeID ) AS decimal(6,2)) AS MaxEmp
INTO #MyTable
FROM Employees

|||

There are 2 options,

Create Table #Table (

ColumnValue Varchar(50)

);

Insert Into #Table

SELECT MAX(Column) FROM TableName;

--OR

SELECT Cast(MAX(Column) as Varchar(50)) ColumnValue Into #Table FROM TableName;

|||Thank you for the help provided so far. Another question on the same subject. How can the Column name be assigned dynamically after a query result? Thanks.
|||

You should use the aliase name. if you failed to give the aliase name for the expression sql server thow an error says that "No column was specified for column n on tablename".

Code Snippet

Select Max(Column) as MaxColumn Into NewTable From OldTable

Select Max(Column) MaxColumn into Newtable From OldTable

|||

As indicated above, No.

My apologies, I guess this statement was not clear enough.

In the process, you need to provide a column Name for any computed or derived columns...

sql

Is it possible to create a fixed column report?

I was just wondering if it was possible to create a fixed column report that would export to a text file as dat file to be consumed by an outside process. By this I mean that my first column would be characters 1 to 8, column 2 would be 8 to 20, column 3 would be 21 to 40, etc...

If so, how would you do it?

Thanks in advance.

David,

I had to do this for a report. I generated an XML file and applied an XSL translation to get it to fixed field ASCII. Not real difficult, but it required a second step. Don't forget to change the mime output type. I saw somewhere that you can specify the XSL file to apply after exporting to XML within Reporting Services,I just don't remember where.

R

Monday, March 19, 2012

Is it Possible to Concatenate a Text Column of a Table

Hi All,
I have a table in which one of the columns is Text.
I need to concatenate a hard coded text with the value of the text column
for each and every row of the table. Is this possible.
Sevugan.CI don't understand why you need to concatenate anything, *especially* the
same value for *every row.*
Can't the consuming application do that?
If you aren't storing > 8000 characters, then you could say:
DECLARE @.constant VARCHAR(12);
SET @.constant = 'some prefix';
SELECT @.constant + CONVERT(VARCHAR(7988), textColumn) FROM table;
"Sevugan" <Sevugan@.discussions.microsoft.com> wrote in message
news:A1A3FE64-4D11-4217-97AC-A8A6A380F355@.microsoft.com...
> Hi All,
> I have a table in which one of the columns is Text.
> I need to concatenate a hard coded text with the value of the text column
> for each and every row of the table. Is this possible.
>
> --
> Sevugan.C|||Hi
Thanks for your reply.
I am storing more than 8000 chars in the text column. Then, how this could
be resolved.
Sevugan.C
"Aaron Bertrand [SQL Server MVP]" wrote:

> I don't understand why you need to concatenate anything, *especially* the
> same value for *every row.*
> Can't the consuming application do that?
> If you aren't storing > 8000 characters, then you could say:
> DECLARE @.constant VARCHAR(12);
> SET @.constant = 'some prefix';
> SELECT @.constant + CONVERT(VARCHAR(7988), textColumn) FROM table;
>
>
> "Sevugan" <Sevugan@.discussions.microsoft.com> wrote in message
> news:A1A3FE64-4D11-4217-97AC-A8A6A380F355@.microsoft.com...
>
>|||> I am storing more than 8000 chars in the text column. Then, how this could
> be resolved.
Some options:
(a) have the consuming application perform the concatenation
(b) move to SQL Server 2005, where you can use VARCHAR(MAX)
(c) store your redundant prefix with the data (you can use UPDATETEXT for
that)|||Hi
I am using the third option suggested by You. But, I am getting the
following error.
What could be the reason. How it should be resolved.
Server: Msg 7123, Level 16, State 1, Procedure sp_SendStockRebalanceMails,
Line 100
Invalid text, ntext, or image pointer value
0x0100010000000000331C2F0C00000000.
The statement has been terminated.
--
Sevugan.C
"Aaron Bertrand [SQL Server MVP]" wrote:

> Some options:
> (a) have the consuming application perform the concatenation
> (b) move to SQL Server 2005, where you can use VARCHAR(MAX)
> (c) store your redundant prefix with the data (you can use UPDATETEXT for
> that)
>
>|||> I am using the third option suggested by You. But, I am getting the
> following error.
> What could be the reason. How it should be resolved.
Who knows? You forgot to include DDL, sample data, and the code in your
procedure.
http://www.aspfaq.com/5006|||> I am using the third option suggested by You. But, I am getting the
> following error.
> What could be the reason. How it should be resolved.
Who knows? You forgot to include DDL, sample data, and the code in your
procedure.
http://www.aspfaq.com/5006

is it possible to alter a table to remove IDENTITY attribute

We have a column with an IDENTITY attribute and we no longer want this
column to have the IDENTITY attribute.
I know that set IDENTITY_INSERT will more or less ignore the IDENTITY for
that unit of work however I need the IDENTITY attribute totally removed so
that we don't have to set IDENTITY_INSERT each time.
Thanks in advanceYou can add a new column, copy the contents of the identity column to it,
drop the identity column, and rename the new column.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"TJT" <TJT@.nospam.com> wrote in message
news:egxy3DYXGHA.1200@.TK2MSFTNGP03.phx.gbl...
We have a column with an IDENTITY attribute and we no longer want this
column to have the IDENTITY attribute.
I know that set IDENTITY_INSERT will more or less ignore the IDENTITY for
that unit of work however I need the IDENTITY attribute totally removed so
that we don't have to set IDENTITY_INSERT each time.
Thanks in advance

is it possible to alter a table to remove IDENTITY attribute

We have a column with an IDENTITY attribute and we no longer want this
column to have the IDENTITY attribute.
I know that set IDENTITY_INSERT will more or less ignore the IDENTITY for
that unit of work however I need the IDENTITY attribute totally removed so
that we don't have to set IDENTITY_INSERT each time.
Thanks in advanceYou can add a new column, copy the contents of the identity column to it,
drop the identity column, and rename the new column.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"TJT" <TJT@.nospam.com> wrote in message
news:egxy3DYXGHA.1200@.TK2MSFTNGP03.phx.gbl...
We have a column with an IDENTITY attribute and we no longer want this
column to have the IDENTITY attribute.
I know that set IDENTITY_INSERT will more or less ignore the IDENTITY for
that unit of work however I need the IDENTITY attribute totally removed so
that we don't have to set IDENTITY_INSERT each time.
Thanks in advance

Monday, March 12, 2012

is it posible to put more than 4000 bytes into one column? ( sql server mobile )

varchar can only hold 4000 bytes
and there is no text column in sql server mobile

Hi,
try 'ntext'

Pete

|||I'm using SQL CE 3.5 with VS 2008 Beta 2:

I have a table with some coulmns of NTEXT type, but when i want to update my dataset to database with a row which has that field more than 4000 charachters I got this error:

"InvalidOperationException was unhandled
@.p4 : String truncation: max=4000, len=4374
...."

Regards,
Parham.
|||NTEXT should accept 536870911 charachters! But why iam getting that Error?!
|||

It is probably a problem with the DataSet designer. Check the designer generated code, and you may find that it has limited the @.p4 length to 4000. You can probably manually change this.

|||I'm having the same issue. I checked through the designer code and found the max length set to the correct length for ntext (536870911). Just to be sure I recreated the database and the dataset, but got the same result. I think this might be a genuine bug.

is it posible to put more than 4000 bytes into one column? ( sql server mobile )

varchar can only hold 4000 bytes
and there is no text column in sql server mobile

Hi,
try 'ntext'

Pete

|||I'm using SQL CE 3.5 with VS 2008 Beta 2:

I have a table with some coulmns of NTEXT type, but when i want to update my dataset to database with a row which has that field more than 4000 charachters I got this error:

"InvalidOperationException was unhandled
@.p4 : String truncation: max=4000, len=4374
...."

Regards,
Parham.
|||NTEXT should accept 536870911 charachters! But why iam getting that Error?!
|||

It is probably a problem with the DataSet designer. Check the designer generated code, and you may find that it has limited the @.p4 length to 4000. You can probably manually change this.

|||I'm having the same issue. I checked through the designer code and found the max length set to the correct length for ntext (536870911). Just to be sure I recreated the database and the dataset, but got the same result. I think this might be a genuine bug.

is it posible to put more than 4000 bytes into one column? ( sql server mobile )

varchar can only hold 4000 bytes
and there is no text column in sql server mobile

Hi,
try 'ntext'

Pete

|||I'm using SQL CE 3.5 with VS 2008 Beta 2:

I have a table with some coulmns of NTEXT type, but when i want to update my dataset to database with a row which has that field more than 4000 charachters I got this error:

"InvalidOperationException was unhandled
@.p4 : String truncation: max=4000, len=4374
...."

Regards,
Parham.
|||NTEXT should accept 536870911 charachters! But why iam getting that Error?!
|||

It is probably a problem with the DataSet designer. Check the designer generated code, and you may find that it has limited the @.p4 length to 4000. You can probably manually change this.

|||I'm having the same issue. I checked through the designer code and found the max length set to the correct length for ntext (536870911). Just to be sure I recreated the database and the dataset, but got the same result. I think this might be a genuine bug.

is it posible to put more than 4000 bytes into one column? ( sql server mobile )

varchar can only hold 4000 bytes
and there is no text column in sql server mobile

Hi,
try 'ntext'

Pete

Wednesday, March 7, 2012

Is is possible to make index over datepart in datetime column?

For example, i want to make index over dd-mm-yyyy not including hh:mm:ss, or sometimes only mm-yyyy. Is this possible?Yes, that's possible, create a view and then index your view.

Friday, February 24, 2012

Is HierarchyUniqueNameStyle Enumeration Working?

Hi,

When I am performing a drillthrough on my cubes I discover the header of my drillthrough report of all column consist of [<DimensionUniqueName>].[<HierarchyName>]. I am trying to make the header of all columns to contain only [<HierarchyName>].

After reading http://msdn2.microsoft.com/en-us/library/microsoft.analysisservices.hierarchyuniquenamestyle.aspx, I set this property in my cube to ExcludeDimensionName, however, it does not solve remove the DimensionUniqueName from my drillthrough report.

Anyone has any idea how to remove DimensionUniqueName from the header of my drillthrough report?

I am having the same problem. hierarchyuniquenamestyle set to ExcludeDimensionNam doesn't work neither.

Is getting table-comments out of SQL Server with selects possible?

Hi,
We have used Enterprise Manager to add comments to all our column
definitions. Unfortunately, the only place we can see these comments are in
the windows of Enterprise Manager. We would like to be able to query for
these comments, just like it is possible to query for the names of all
tables and columns from systables, sysobjects, information_schema.tables
etc.
For example
use master
select * from information_schema.columns
So, anyone who can say where our comments are stored (we sure hope they are
stored inside the database in more or less clear text somewhere).
Best regards,
Helge G Solheim, MCSD
Computas
hgs at computasnospam dot comIt is in sysproperties, but the supported measures you find if you search BOL for "extended
properties". For instance the fn_listextendedproperty() function.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Helge G Solheim" <hgs@.nospam.org> wrote in message news:OdmqwJCiDHA.2320@.TK2MSFTNGP12.phx.gbl...
> Hi,
> We have used Enterprise Manager to add comments to all our column
> definitions. Unfortunately, the only place we can see these comments are in
> the windows of Enterprise Manager. We would like to be able to query for
> these comments, just like it is possible to query for the names of all
> tables and columns from systables, sysobjects, information_schema.tables
> etc.
> For example
> use master
> select * from information_schema.columns
> So, anyone who can say where our comments are stored (we sure hope they are
> stored inside the database in more or less clear text somewhere).
> Best regards,
> Helge G Solheim, MCSD
> Computas
> hgs at computasnospam dot com
>