Saturday, February 25, 2012

Change the active user in sp

Hello,
I would like to change the active user in a stored procedure
Ex. :
I'm logged on sql as "userA".
I call the stored procedure "spGetInfo".
In the first line of "spGetInfo" I would like to do something like "su poweruser", query some data and do "su system_user"

Is there anything like the unix "su" command in SQL ?

Thank a lot

Felix Pageau
fpageau@.SPAMSUCK.str.caI'm not quite sure what you are asking. Assuming that the user has the permission to execute a stored procedure, that stored procedure executes in the security context of the user that CREATES the procedure. If the dbo creates a procedure, the procedure can do anything that the dbo can do when any user runs it.

The only exception is that dynamic SQL always runs in the context of the currently logged in user. That can hang you up, but otherwise you should be fine.

-PatP|||Hello,

my problem is that the stored procedure contain dynamic sql. I need to execute the dynamic sql query without giving the user to query the table.

I thought that with a kind of "impersonation" I would be able to do so but I haven't found any.

Do you know a way to execute dynamic sql in another context than then one of the user that has called the sp ?

Thank for your reply|||The quickest and easiest answer is probably an extended stored procedure (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_ar_sa2_67vp.asp). I don't know of anything in Transact-SQL that will allow you to do that.

-PatP|||Do you mean I should create an extended sp with my sql code or that I should call an existing extend sp ?|||If you need to "switch context" to allow dynamic SQL to execute, I'm suggesting that you write an extended stored procedure that allows you to control what gets executed and how. I don't know of a way to get you what you want using just Transact-SQL.

-PatP|||Even if you change the user inside your stored procedure from simple user to system admin user, the proc would still be running under the simple user access rights.
Best would be to define the access rights using the role, stored procedure etc etc and then control the sql.

Unix and SQL are entirely two different world.

Change the @@Servername

Hi,
We have changed the server name. If I run select @.@.servername, it came out
the same server name.
any ideas>
Thanks,Change the script below to specify the new server name and execute. Then
restart SQL Server.
EXEC sp_dropserver @.@.SERVERNAME
EXEC sp_addserver 'NewServerName', 'local'
--
Hope this helps.
Dan Guzman
SQL Server MVP
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OsK7a4brGHA.4508@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We have changed the server name. If I run select @.@.servername, it came out
> the same server name.
> any ideas>
> Thanks,
>|||Check out sp_dropserver and sp_addserver in the BOL.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OsK7a4brGHA.4508@.TK2MSFTNGP04.phx.gbl...
Hi,
We have changed the server name. If I run select @.@.servername, it came out
the same server name.
any ideas>
Thanks,|||thanks all
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OsK7a4brGHA.4508@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We have changed the server name. If I run select @.@.servername, it came out
> the same server name.
> any ideas>
> Thanks,
>|||In addition, if you had any SQL Agent jobs defined before the rename you
need to take an additional step or you won't be able to modify them. See
http://www.karaszi.com/SQLServer/info_change_server_name.asp
--
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OsK7a4brGHA.4508@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We have changed the server name. If I run select @.@.servername, it came out
> the same server name.
> any ideas>
> Thanks,
>|||thanks all
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OsK7a4brGHA.4508@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We have changed the server name. If I run select @.@.servername, it came out
> the same server name.
> any ideas>
> Thanks,
>|||thanks all
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OsK7a4brGHA.4508@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We have changed the server name. If I run select @.@.servername, it came out
> the same server name.
> any ideas>
> Thanks,
>

Change the @@Servername

Hi,
We have changed the server name. If I run select @.@.servername, it came out
the same server name.
any ideas>
Thanks,Change the script below to specify the new server name and execute. Then
restart SQL Server.
EXEC sp_dropserver @.@.SERVERNAME
EXEC sp_addserver 'NewServerName', 'local'
Hope this helps.
Dan Guzman
SQL Server MVP
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OsK7a4brGHA.4508@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We have changed the server name. If I run select @.@.servername, it came out
> the same server name.
> any ideas>
> Thanks,
>|||Check out sp_dropserver and sp_addserver in the BOL.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OsK7a4brGHA.4508@.TK2MSFTNGP04.phx.gbl...
Hi,
We have changed the server name. If I run select @.@.servername, it came out
the same server name.
any ideas>
Thanks,|||thanks all
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OsK7a4brGHA.4508@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We have changed the server name. If I run select @.@.servername, it came out
> the same server name.
> any ideas>
> Thanks,
>|||In addition, if you had any SQL Agent jobs defined before the rename you
need to take an additional step or you won't be able to modify them. See
http://www.karaszi.com/SQLServer/in...server_name.asp
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OsK7a4brGHA.4508@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We have changed the server name. If I run select @.@.servername, it came out
> the same server name.
> any ideas>
> Thanks,
>|||thanks all
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OsK7a4brGHA.4508@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We have changed the server name. If I run select @.@.servername, it came out
> the same server name.
> any ideas>
> Thanks,
>|||thanks all
"mecn" <mecn2002@.yahoo.com> wrote in message
news:OsK7a4brGHA.4508@.TK2MSFTNGP04.phx.gbl...
> Hi,
> We have changed the server name. If I run select @.@.servername, it came out
> the same server name.
> any ideas>
> Thanks,
>

Change the "text filegroup" property of an existing table

How can I change the property "text filegroup" of an existing Table?

Thanks
Markus

In enterprise manager, right click the table and choose "design table", then click the "table and index properties" icon (2nd from left, next to save) and then set the Text Filegroup option as appropriate.|||I'm using SQL Server 2005|||right click on the table and select properties. you have the option to change it there.|||at the properties tab, General, everything is write protected (SQL Server Management Studio)|||TextFilegroup is set at the creation of the table via the TextImage_On {fg}. In sql2k, when you modify the TextFilegroup property, the system actually:
1. create a new table with textimage_on
2. insert into the new table with the old table data
3. drop the old table
4. rename the new table to old

The above functionality still exists and works the same in sql2k5. Right click on the table; select "modify"; press F4 to bring up the properties pane; change the TextFilegroup as desired.

Change Textbox value with diferent print copy

I want to print a report (localreport) 4 times, and i have a textbox that need to have different value for specific copy.

Ex.:

Copy 1 - Original

Copy 2 - Duplicate

...

Can i dynamically do this in the report?

Thanks

If you can place the changing text at the top of each copy, you could have one report without this heading that was the basic report. Then you could have a second report with 4 subreports, each pointing to the main report. At the top of each subreport you would place the "copy 1" etc. At the bottom of each subreport you would force a page break.

There may be a better way, such as driven from your data and using a single report, but without knowing details I think that would work.

Change Text to a date

I have a text field that I need to display in a data format
currently the text field is shown as this yyyymmdd
I need to display it in a date format as mm/dd/yyyy
I have tried just using the date format, but it is not recognized as a date.
Any suggestions how to write an expression to manipulate the field? I know
how to do it in Access & excel either of the folowing works:
=Mid([promise_dt],5,2) & "/" & Right([promise_dt],2) & "/" &
Left([promise_dt],4)
=(DATE(LEFT(A3,4),MID(A3,5,2),RIGHT(A3,2)))
any suggestions would be great.
thanks
--
Jeanne Conde, MCPJeanne:
Try to use SQL standard command:
declare @.InputStringDate varchar(10)
set @.InputStringDate ='20060314'
select convert(datetime, @.InputStringDate)
select convert(varchar,convert(datetime, @.InputStringDate),101)
Good luck!!
Waikiki Frog
Jeanne Conde wrote:
>I have a text field that I need to display in a data format
>currently the text field is shown as this yyyymmdd
>I need to display it in a date format as mm/dd/yyyy
>I have tried just using the date format, but it is not recognized as a date.
>Any suggestions how to write an expression to manipulate the field? I know
>how to do it in Access & excel either of the folowing works:
>=Mid([promise_dt],5,2) & "/" & Right([promise_dt],2) & "/" &
>Left([promise_dt],4)
>=(DATE(LEFT(A3,4),MID(A3,5,2),RIGHT(A3,2)))
>any suggestions would be great.
>thanks
>
--
Message posted via http://www.sqlmonster.com|||Thanks.
i will give it a try
--
Jeanne Conde, MCP
"WaikikiFrog via SQLMonster.com" wrote:
> Jeanne:
> Try to use SQL standard command:
> declare @.InputStringDate varchar(10)
> set @.InputStringDate ='20060314'
> select convert(datetime, @.InputStringDate)
> select convert(varchar,convert(datetime, @.InputStringDate),101)
> Good luck!!
> Waikiki Frog
>
> Jeanne Conde wrote:
> >I have a text field that I need to display in a data format
> >currently the text field is shown as this yyyymmdd
> >
> >I need to display it in a date format as mm/dd/yyyy
> >I have tried just using the date format, but it is not recognized as a date.
> >Any suggestions how to write an expression to manipulate the field? I know
> >how to do it in Access & excel either of the folowing works:
> >=Mid([promise_dt],5,2) & "/" & Right([promise_dt],2) & "/" &
> >Left([promise_dt],4)
> >=(DATE(LEFT(A3,4),MID(A3,5,2),RIGHT(A3,2)))
> >
> >any suggestions would be great.
> >thanks
> >
> --
> Message posted via http://www.sqlmonster.com
>

change text of msg 547,level 16

Hi
I've SQL Server 2000,now I want to change the default
text message of msg number 547,level 16.
how is it possible?
any help would be greatly appreiciated.
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/RM wrote:
> Hi
> I've SQL Server 2000,now I want to change the default
> text message of msg number 547,level 16.
> how is it possible?
If all you want is localize the message, you may try the suggestions from
this article
INF: How to Install Localized SQL Server Error Messages
http://support.microsoft.com/defaul...kb;en-us;277535
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.

Change text color

Dear all,

May I know how can I change a text color if the data meet certain condition?

Thanks in advance

Levine

You can set this in the properties window.
Click on the textbox you want to change and then click in the "Color" box.. select the dropdown in that field and clickon "Expression..".

Then use a formula such as:

=IIF( Sum(Fields!Hours.Value)>=7 , "Black", "Crimson")

The expression builder can assist you with your own data fields etc.

Change temporary tables location

Hi:
I was wondering if it is possible, in SQL Server, change the database
where temp tables are generated by default.
I know that temp tables are generated on tempdb, but this is very bad
when there's much concurrency...
I need some "magic configuration" that allows me to specify the
temporary tables location for each database, like in Oracle.
Is there anything like that in SQL Server?
Thanks,
Ravi Wallau
nospam@.nospam.orgThere magic is anywhere else, but not in this settings of SQL Server.
HTH, Jens Suessmeyer.|||As far as I am aware there isn't a way of doing what your asking inside SQL
Server
---
Retrograde
"Ravi Ambros Wallau" wrote:

> Hi:
> I was wondering if it is possible, in SQL Server, change the database
> where temp tables are generated by default.
> I know that temp tables are generated on tempdb, but this is very bad
> when there's much concurrency...
> I need some "magic configuration" that allows me to specify the
> temporary tables location for each database, like in Oracle.
> Is there anything like that in SQL Server?
> Thanks,
> --
> Ravi Wallau
> nospam@.nospam.org
>
>

Change temporary tables location

Hi:
I was wondering if it is possible, in SQL Server, change the database
where temp tables are generated by default.
I know that temp tables are generated on tempdb, but this is very bad
when there's much concurrency...
I need some "magic configuration" that allows me to specify the
temporary tables location for each database, like in Oracle.
Is there anything like that in SQL Server?
Thanks,
Ravi Wallau
nospam@.nospam.org
There magic is anywhere else, but not in this settings of SQL Server.
HTH, Jens Suessmeyer.
|||As far as I am aware there isn't a way of doing what your asking inside SQL
Server
Retrograde
"Ravi Ambros Wallau" wrote:

> Hi:
> I was wondering if it is possible, in SQL Server, change the database
> where temp tables are generated by default.
> I know that temp tables are generated on tempdb, but this is very bad
> when there's much concurrency...
> I need some "magic configuration" that allows me to specify the
> temporary tables location for each database, like in Oracle.
> Is there anything like that in SQL Server?
> Thanks,
> --
> Ravi Wallau
> nospam@.nospam.org
>
>

Change temporary tables location

Hi:
I was wondering if it is possible, in SQL Server, change the database
where temp tables are generated by default.
I know that temp tables are generated on tempdb, but this is very bad
when there's much concurrency...
I need some "magic configuration" that allows me to specify the
temporary tables location for each database, like in Oracle.
Is there anything like that in SQL Server?
Thanks,
--
Ravi Wallau
nospam@.nospam.orgThere magic is anywhere else, but not in this settings of SQL Server.
HTH, Jens Suessmeyer.|||As far as I am aware there isn't a way of doing what your asking inside SQL
Server
---
Retrograde
"Ravi Ambros Wallau" wrote:
> Hi:
> I was wondering if it is possible, in SQL Server, change the database
> where temp tables are generated by default.
> I know that temp tables are generated on tempdb, but this is very bad
> when there's much concurrency...
> I need some "magic configuration" that allows me to specify the
> temporary tables location for each database, like in Oracle.
> Is there anything like that in SQL Server?
> Thanks,
> --
> Ravi Wallau
> nospam@.nospam.org
>
>

Change Table's Font

Dear All
I would like to change TABLE FONT other english lange in MS SQL SERVER
2000,can? if yes How could we do?
TIATables don't have fonts. The display font is determined by your client
application and you haven't told us what that is. Assuming you are
using Query Analyzer, go to Tools/Options/Fonts.
--
David Portas
SQL Server MVP
--

Change Table's Font

Dear All
I would like to change TABLE FONT other english lange in MS SQL SERVER
2000,can? if yes How could we do?
TIA
Tables don't have fonts. The display font is determined by your client
application and you haven't told us what that is. Assuming you are
using Query Analyzer, go to Tools/Options/Fonts.
David Portas
SQL Server MVP

Change Table's Font

Dear All
I would like to change TABLE FONT other english lange in MS SQL SERVER
2000,can? if yes How could we do?
TIATables don't have fonts. The display font is determined by your client
application and you haven't told us what that is. Assuming you are
using Query Analyzer, go to Tools/Options/Fonts.
--
David Portas
SQL Server MVP
--

Change Tables FileGroup

Hi!!!
I would like change table's filegroup.
How can I do by script?
Thank you.
Bye.I think you may have to create a new table in different filegroup, and transfer the data to this new table and create all the relationships. Then
finally drop the old table and rename the new table to the old one.

Anybody has better way?|||The only way of doing this (of which I am aware) is to drop and re-create the table using the ON option.

You might try:

CREATE MyTable_Temp (
Foo varchar(10) NOT NULL,
Bar int NULL
) ON [MyFileGroup]

INSERT INTO MyTable_Temp (Foo, Bar)
SELECT Foo, Bar
FROM MyTable

DROP TABLE MyTable

sp_rename N'MyTable', N'MyTableTemp'

Note that this example does not include any constraints, indexes, dependent objects or anything else. Actual mileage may vary. Wear your seatbelt.

Regards,

Hugh Scott|||It's true that those are the only ways to do it by script. However, if you only need to do it for a few tables, it may be quicker to use Enterprise Manager instead.

Change tablerow height at runtime

Hi,
I need to change the height of a row at runtime, anyone knows how can
I do it?
Thanks for your help.On Oct 17, 5:26 am, BPiano <bernardo.pi...@.sapo.pt> wrote:
> Hi,
> I need to change the height of a row at runtime, anyone knows how can
> I do it?
> Thanks for your help.
There's not really a way to directly control this; however, if you are
wanting to increase the row/cell size across the board you can set the
'Textbox Height' property to: 'Can increase to accommodate
contents' (via: selecting a table cell in Layout view >> right-click
>> select Properties >> select Format tab). Something that could
possibly work is to set the BorderWidth: Top or Bottom property (via:
selecting a table cell in Layout view >> select F4/Properties Window
>> select drop-down to the right of item >> select <Expression...>) to
an expression. I'm not sure of your particular scenario; but you might
use an expression like:
=iif(Fields!SomeField.Value > 50, "5pt", "1pt")
Where if SomeField's value is greater than 50 set the border width for
the top to 5pt otherwise, set it to 1pt. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant

Change Table Ownership.

I have a DB that I moved to another server recently and in the process we
created a new user/pass combination.
All the tables for the main app are listed as "system" and the main app runs
great.
There is a secondary app using 12 tables in the DB and although we changed
the user/pass in the app and it connects fine the app won't run saying
"Invalid object name 'tablename'."
The table is there. The only thing I notice that seems odd is the tables are
listed as "user" and not "system" and the user assigned is the old user.
How can I either,
A. change what user owns the table? or,
B. Change it from a "user" table to a "system" table?
Thanks for any replies.
Check out sp_changeobjectowner in BOL.
"Jim" <Jim@.abc.com> wrote in message
news:OX%234ZddPEHA.3300@.TK2MSFTNGP09.phx.gbl...
> I have a DB that I moved to another server recently and in the process we
> created a new user/pass combination.
> All the tables for the main app are listed as "system" and the main app
runs
> great.
> There is a secondary app using 12 tables in the DB and although we changed
> the user/pass in the app and it connects fine the app won't run saying
> "Invalid object name 'tablename'."
> The table is there. The only thing I notice that seems odd is the tables
are
> listed as "user" and not "system" and the user assigned is the old user.
> How can I either,
> A. change what user owns the table? or,
> B. Change it from a "user" table to a "system" table?
>
> Thanks for any replies.
>
>
>
|||System tables are there for SQL to run properly. User tables are what you
put information into. You don't need to or want to change a user table to a
system table.
You probably do need to change the owner of the tables. Look up
sp_changeobjectowner on BOL (Books On-Line) for exact instructions on how to
do this.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Jim" <Jim@.abc.com> wrote in message
news:OX%234ZddPEHA.3300@.TK2MSFTNGP09.phx.gbl...
> I have a DB that I moved to another server recently and in the process we
> created a new user/pass combination.
> All the tables for the main app are listed as "system" and the main app
runs
> great.
> There is a secondary app using 12 tables in the DB and although we changed
> the user/pass in the app and it connects fine the app won't run saying
> "Invalid object name 'tablename'."
> The table is there. The only thing I notice that seems odd is the tables
are
> listed as "user" and not "system" and the user assigned is the old user.
> How can I either,
> A. change what user owns the table? or,
> B. Change it from a "user" table to a "system" table?
>
> Thanks for any replies.
>
>
>
|||> "Invalid object name 'tablename'."
Have you tried explicitly naming the object? e.g. dbo.tablename?
Also see http://www.aspfaq.com/2284
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
|||Thanks for the replies guys.
What I did was ran into the lazy GUI method.

>EM>Design Table>relationships icon from the top>Table tab> Change
ownership.
All set, app is behaving again.
Thanks.
"Jim" <Jim@.abc.com> wrote in message
news:OX%234ZddPEHA.3300@.TK2MSFTNGP09.phx.gbl...
> I have a DB that I moved to another server recently and in the process we
> created a new user/pass combination.
> All the tables for the main app are listed as "system" and the main app
runs
> great.
> There is a secondary app using 12 tables in the DB and although we changed
> the user/pass in the app and it connects fine the app won't run saying
> "Invalid object name 'tablename'."
> The table is there. The only thing I notice that seems odd is the tables
are
> listed as "user" and not "system" and the user assigned is the old user.
> How can I either,
> A. change what user owns the table? or,
> B. Change it from a "user" table to a "system" table?
>
> Thanks for any replies.
>
>
>

Change Table Ownership.

I have a DB that I moved to another server recently and in the process we
created a new user/pass combination.
All the tables for the main app are listed as "system" and the main app runs
great.
There is a secondary app using 12 tables in the DB and although we changed
the user/pass in the app and it connects fine the app won't run saying
"Invalid object name 'tablename'."
The table is there. The only thing I notice that seems odd is the tables are
listed as "user" and not "system" and the user assigned is the old user.
How can I either,
A. change what user owns the table? or,
B. Change it from a "user" table to a "system" table?
Thanks for any replies.Check out sp_changeobjectowner in BOL.
"Jim" <Jim@.abc.com> wrote in message
news:OX%234ZddPEHA.3300@.TK2MSFTNGP09.phx.gbl...
> I have a DB that I moved to another server recently and in the process we
> created a new user/pass combination.
> All the tables for the main app are listed as "system" and the main app
runs
> great.
> There is a secondary app using 12 tables in the DB and although we changed
> the user/pass in the app and it connects fine the app won't run saying
> "Invalid object name 'tablename'."
> The table is there. The only thing I notice that seems odd is the tables
are
> listed as "user" and not "system" and the user assigned is the old user.
> How can I either,
> A. change what user owns the table? or,
> B. Change it from a "user" table to a "system" table?
>
> Thanks for any replies.
>
>
>|||System tables are there for SQL to run properly. User tables are what you
put information into. You don't need to or want to change a user table to a
system table.
You probably do need to change the owner of the tables. Look up
sp_changeobjectowner on BOL (Books On-Line) for exact instructions on how to
do this.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Jim" <Jim@.abc.com> wrote in message
news:OX%234ZddPEHA.3300@.TK2MSFTNGP09.phx.gbl...
> I have a DB that I moved to another server recently and in the process we
> created a new user/pass combination.
> All the tables for the main app are listed as "system" and the main app
runs
> great.
> There is a secondary app using 12 tables in the DB and although we changed
> the user/pass in the app and it connects fine the app won't run saying
> "Invalid object name 'tablename'."
> The table is there. The only thing I notice that seems odd is the tables
are
> listed as "user" and not "system" and the user assigned is the old user.
> How can I either,
> A. change what user owns the table? or,
> B. Change it from a "user" table to a "system" table?
>
> Thanks for any replies.
>
>
>|||> "Invalid object name 'tablename'."
Have you tried explicitly naming the object? e.g. dbo.tablename?
Also see http://www.aspfaq.com/2284
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||Thanks for the replies guys.
What I did was ran into the lazy GUI method.
>EM>Design Table>relationships icon from the top>Table tab> Change
ownership.
All set, app is behaving again.
Thanks.
"Jim" <Jim@.abc.com> wrote in message
news:OX%234ZddPEHA.3300@.TK2MSFTNGP09.phx.gbl...
> I have a DB that I moved to another server recently and in the process we
> created a new user/pass combination.
> All the tables for the main app are listed as "system" and the main app
runs
> great.
> There is a secondary app using 12 tables in the DB and although we changed
> the user/pass in the app and it connects fine the app won't run saying
> "Invalid object name 'tablename'."
> The table is there. The only thing I notice that seems odd is the tables
are
> listed as "user" and not "system" and the user assigned is the old user.
> How can I either,
> A. change what user owns the table? or,
> B. Change it from a "user" table to a "system" table?
>
> Thanks for any replies.
>
>
>

Change Table Ownership.

I have a DB that I moved to another server recently and in the process we
created a new user/pass combination.
All the tables for the main app are listed as "system" and the main app runs
great.
There is a secondary app using 12 tables in the DB and although we changed
the user/pass in the app and it connects fine the app won't run saying
"Invalid object name 'tablename'."
The table is there. The only thing I notice that seems odd is the tables are
listed as "user" and not "system" and the user assigned is the old user.
How can I either,
A. change what user owns the table? or,
B. Change it from a "user" table to a "system" table?
Thanks for any replies.Check out sp_changeobjectowner in BOL.
"Jim" <Jim@.abc.com> wrote in message
news:OX%234ZddPEHA.3300@.TK2MSFTNGP09.phx.gbl...
> I have a DB that I moved to another server recently and in the process we
> created a new user/pass combination.
> All the tables for the main app are listed as "system" and the main app
runs
> great.
> There is a secondary app using 12 tables in the DB and although we changed
> the user/pass in the app and it connects fine the app won't run saying
> "Invalid object name 'tablename'."
> The table is there. The only thing I notice that seems odd is the tables
are
> listed as "user" and not "system" and the user assigned is the old user.
> How can I either,
> A. change what user owns the table? or,
> B. Change it from a "user" table to a "system" table?
>
> Thanks for any replies.
>
>
>|||System tables are there for SQL to run properly. User tables are what you
put information into. You don't need to or want to change a user table to a
system table.
You probably do need to change the owner of the tables. Look up
sp_changeobjectowner on BOL (Books On-Line) for exact instructions on how to
do this.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Jim" <Jim@.abc.com> wrote in message
news:OX%234ZddPEHA.3300@.TK2MSFTNGP09.phx.gbl...
> I have a DB that I moved to another server recently and in the process we
> created a new user/pass combination.
> All the tables for the main app are listed as "system" and the main app
runs
> great.
> There is a secondary app using 12 tables in the DB and although we changed
> the user/pass in the app and it connects fine the app won't run saying
> "Invalid object name 'tablename'."
> The table is there. The only thing I notice that seems odd is the tables
are
> listed as "user" and not "system" and the user assigned is the old user.
> How can I either,
> A. change what user owns the table? or,
> B. Change it from a "user" table to a "system" table?
>
> Thanks for any replies.
>
>
>|||> "Invalid object name 'tablename'."
Have you tried explicitly naming the object? e.g. dbo.tablename?
Also see http://www.aspfaq.com/2284
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/|||Thanks for the replies guys.
What I did was ran into the lazy GUI method.

>EM>Design Table>relationships icon from the top>Table tab> Change
ownership.
All set, app is behaving again.
Thanks.
"Jim" <Jim@.abc.com> wrote in message
news:OX%234ZddPEHA.3300@.TK2MSFTNGP09.phx.gbl...
> I have a DB that I moved to another server recently and in the process we
> created a new user/pass combination.
> All the tables for the main app are listed as "system" and the main app
runs
> great.
> There is a secondary app using 12 tables in the DB and although we changed
> the user/pass in the app and it connects fine the app won't run saying
> "Invalid object name 'tablename'."
> The table is there. The only thing I notice that seems odd is the tables
are
> listed as "user" and not "system" and the user assigned is the old user.
> How can I either,
> A. change what user owns the table? or,
> B. Change it from a "user" table to a "system" table?
>
> Thanks for any replies.
>
>
>

change table ownership 2005

I have never been able to get this to work for 2005. Can anyone help
me troubleshoot my problem? I run this:
ALTER AUTHORIZATION ON db.table TO dbo;
GO
And get incorrect syntax near the keyword 'authorization'
I am supposed to run it as a query right?That's the correct syntax, yes. Does the following script run without error
for you:
use tempdb
go
create user auser without login
go
create table xyz (xxyyzz int)
go
alter authorization on xyz to auser
go
drop table xyz
go
drop user auser
go
--
Adam Machanic
SQL Server MVP
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
<glayla@.gmail.com> wrote in message
news:1182458122.375047.227480@.k79g2000hse.googlegroups.com...
>I have never been able to get this to work for 2005. Can anyone help
> me troubleshoot my problem? I run this:
> ALTER AUTHORIZATION ON db.table TO dbo;
> GO
> And get incorrect syntax near the keyword 'authorization'
> I am supposed to run it as a query right?
>

change table ownership 2005

I have never been able to get this to work for 2005. Can anyone help
me troubleshoot my problem? I run this:
ALTER AUTHORIZATION ON db.table TO dbo;
GO
And get incorrect syntax near the keyword 'authorization'
I am supposed to run it as a query right?
That's the correct syntax, yes. Does the following script run without error
for you:
use tempdb
go
create user auser without login
go
create table xyz (xxyyzz int)
go
alter authorization on xyz to auser
go
drop table xyz
go
drop user auser
go
--
Adam Machanic
SQL Server MVP
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
<glayla@.gmail.com> wrote in message
news:1182458122.375047.227480@.k79g2000hse.googlegr oups.com...
>I have never been able to get this to work for 2005. Can anyone help
> me troubleshoot my problem? I run this:
> ALTER AUTHORIZATION ON db.table TO dbo;
> GO
> And get incorrect syntax near the keyword 'authorization'
> I am supposed to run it as a query right?
>

change table ownership 2005

I have never been able to get this to work for 2005. Can anyone help
me troubleshoot my problem? I run this:
ALTER AUTHORIZATION ON db.table TO dbo;
GO
And get incorrect syntax near the keyword 'authorization'
I am supposed to run it as a query right?That's the correct syntax, yes. Does the following script run without error
for you:
--
use tempdb
go
create user auser without login
go
create table xyz (xxyyzz int)
go
alter authorization on xyz to auser
go
drop table xyz
go
drop user auser
go
--
--
Adam Machanic
SQL Server MVP
Author, "Expert SQL Server 2005 Development"
http://www.apress.com/book/bookDisplay.html?bID=10220
<glayla@.gmail.com> wrote in message
news:1182458122.375047.227480@.k79g2000hse.googlegroups.com...
>I have never been able to get this to work for 2005. Can anyone help
> me troubleshoot my problem? I run this:
> ALTER AUTHORIZATION ON db.table TO dbo;
> GO
> And get incorrect syntax near the keyword 'authorization'
> I am supposed to run it as a query right?
>

Change table owner to dbo

How do I change the table owner back to dbo?
Never mind. I got it. I did not query MSDN correctly to find the answer.
sp_changeobjectowner
"sxa222" wrote:

> How do I change the table owner back to dbo?
|||sp_changeobjectowner [ @.objname = ] 'object' , [ @.newowner = ] 'owner'
MG
"sxa222" wrote:

> How do I change the table owner back to dbo?
|||Note that in 2005, this proc change both owner and schema, and also that the proc is deprecated. As
of 2005, use ALTER AUTHORIZATION to change owner of an object.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"sxa222" <sxa222@.discussions.microsoft.com> wrote in message
news:06384594-B178-42B8-B705-33E60E1F8B40@.microsoft.com...[vbcol=seagreen]
> Never mind. I got it. I did not query MSDN correctly to find the answer.
> sp_changeobjectowner
> "sxa222" wrote:

Change table owner to dbo

How do I change the table owner back to dbo?Never mind. I got it. I did not query MSDN correctly to find the answer.
sp_changeobjectowner
"sxa222" wrote:
> How do I change the table owner back to dbo?|||sp_changeobjectowner [ @.objname = ] 'object' , [ @.newowner = ] 'owner'
--
MG
"sxa222" wrote:
> How do I change the table owner back to dbo?|||Note that in 2005, this proc change both owner and schema, and also that the proc is deprecated. As
of 2005, use ALTER AUTHORIZATION to change owner of an object.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"sxa222" <sxa222@.discussions.microsoft.com> wrote in message
news:06384594-B178-42B8-B705-33E60E1F8B40@.microsoft.com...
> Never mind. I got it. I did not query MSDN correctly to find the answer.
> sp_changeobjectowner
> "sxa222" wrote:
>> How do I change the table owner back to dbo?

Change table owner to dbo

How do I change the table owner back to dbo?Never mind. I got it. I did not query MSDN correctly to find the answer.
sp_changeobjectowner
"sxa222" wrote:

> How do I change the table owner back to dbo?|||sp_changeobjectowner [ @.objname = ] 'object' , [ @.newowner = ] 'owne
r'
MG
"sxa222" wrote:

> How do I change the table owner back to dbo?|||Note that in 2005, this proc change both owner and schema, and also that the
proc is deprecated. As
of 2005, use ALTER AUTHORIZATION to change owner of an object.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"sxa222" <sxa222@.discussions.microsoft.com> wrote in message
news:06384594-B178-42B8-B705-33E60E1F8B40@.microsoft.com...[vbcol=seagreen]
> Never mind. I got it. I did not query MSDN correctly to find the answer.
> sp_changeobjectowner
> "sxa222" wrote:
>

Change table owner

Hi,

I imagine losts of people already asked the question but i can't find out the answer on this forum or on the web

I want to change the owner of some tables in one database.

How do i do ?

I think sp_changedbowner is not help cause i want the table, not the database owner to be changed.

Do i have to change sysobjects ? If so, what is the way to do ?YOU CAN USE THIS.
HOPE THIS HELPS ...

EXEC SP_CHANGEOBJECTOWNER 'TABLE_NAME', 'OWNER_NAME'

BUT THE NEW OWNER MUST HAVE ACCESS TO THE DATABASE WHERE THE TABLE IS RESIDING.

NIVAS.|||As i needed fast answer i used the following command wich produces the same thing i think :

update sysobjects set sysobjects.uid=9 where sysobjects.xtype in ('D','U') and sysobjects.uid=99;

Thanks for the info anyway :)

Change Table Owner

Is there an easy way to change myself as a specific table owner to dbo?Look up sp_changeobjectowner in Books Online.|||Perfect! Thank you.

change table orientation

I'm looking for a stored procedure what will change the orientation of a
table, so the columns will become the rows and the rows will become the
columns, for example:
Original Table:
StateName StateLongNames StateNumber
========= ============== ===========
CA California 10
FL Florida 20
TX Texas 30
The resulting table should be:
Col1 Col2 Col3 Col4
============== ========== =========== ==========
StateName CA FL TX
StateLongNames California Florida Texas
StateNumber 10 20 30
Note 1: This is not the same as pivot or crosstab tables.
Note 2: No agregated functions are necessary.
Note 3: It has to work on SQL Server 2000.
Thank you,Check this link
http://www.sqlteam.com/item.asp?ItemID=2955
Hope this helps.
--
"wheresaldo" wrote:

> I'm looking for a stored procedure what will change the orientation of a
> table, so the columns will become the rows and the rows will become the
> columns, for example:
> Original Table:
> StateName StateLongNames StateNumber
> ========= ============== ===========
> CA California 10
> FL Florida 20
> TX Texas 30
> The resulting table should be:
> Col1 Col2 Col3 Col4
> ============== ========== =========== ==========
> StateName CA FL TX
> StateLongNames California Florida Texas
> StateNumber 10 20 30
> Note 1: This is not the same as pivot or crosstab tables.
> Note 2: No agregated functions are necessary.
> Note 3: It has to work on SQL Server 2000.
> Thank you,
>|||hi... I saw this article a couple of days ago, it does not what at need, as
it creates a pivot table. what I need is much more simpler, just flit the
orientation of the table and all the data. This is NOT the same as Pivot,
Crosstab, or Transpond procedures, but easily .
Thank you
"Omnibuzz" wrote:
> Check this link
> http://www.sqlteam.com/item.asp?ItemID=2955
> Hope this helps.
> --
>
>
> "wheresaldo" wrote:
>|||A friend told me to do this, but it's outside my SQL knowledge:
1. Select count(*) for old_table. This will tell you how many columns to
create. Put this count into a variable (or user a cursor)
2. Build the string: "Create table new_table (col" + i + " varchar(50),
col" + ..... And execute it to create your table
3. Select the table structure to get the column names, use a cursor
3.a for each $col_name, Select $col_name, key from old_table order by key,
use cursor2
3.b build the string: "Insert into new_table values (" + $col_name + ", "
+ cursor2_value + ", " + cursor2_value, .... and execute.
3.c repeat loops
Does this make any sense to anyone?
"Omnibuzz" wrote:
> Check this link
> http://www.sqlteam.com/item.asp?ItemID=2955
> Hope this helps.
> --
>
>
> "wheresaldo" wrote:
>|||You can do this with CASE expressions. See the following article for an
example. A query always returns a fixed number of columns so you will
always need to construct a query to match the appropriate number of
rows, either by hand or using dynamic SQL.
http://support.microsoft.com/defaul...b;EN-US;q175574
Hopefully you realize that this is generally a very silly to even
attempt in SQL.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||I tried to apply the code you mentioned for the table below and it does not
seem to give the right result. Here is an example table:
CREATE TABLE #States
(
StateCode char(2),
StateName char(10),
StateNumber int,
StateCost decimal(18, 2)
)
INSERT INTO #States VALUES ('WI','Wisconsin',1, 45.11)
INSERT INTO #States VALUES ('OH','Ohio',2, 2.25)
INSERT INTO #States VALUES ('CA','California',3, 4.5)
INSERT INTO #States VALUES ('FL','Florida',1, 13.40)
INSERT INTO #States VALUES ('FL','Florida',3, 4.50)
As you can see, there is no unique id to use.
Here is how the table looks like:
StateCode StateName StateNumber StateCost
WI Wisconsin 1 45.11
OH Ohio 2 2.25
CA California 3 4.50
FL Florida 1 13.40
FL Florida 3 4.50
and I need it to look rotated or flipped:
Col1 Col2 Col3 Col3 Col4
WI OH CA FL FL
Wisconsin Ohio California Florida Florida
1 2 3 1 3
45.11 2.25 4.50 13.40 4.50
as you can see, the columns of the resulting table will have to receive
different data types, so I was thinking they can be all vchar(50). Also, as
the number of rows from the original table might vary, the resulting table
might have different amount of columns.
I could do the rotation or flip on the UI or front-end, but the reporting
tool I'm using expects a table... this is why I'm trying to do this on a
Stored Procedure.
I'm surpriced that I have not been able to find this on the web, I think
many people might have the same need.
"David Portas" wrote:

> You can do this with CASE expressions. See the following article for an
> example. A query always returns a fixed number of columns so you will
> always need to construct a query to match the appropriate number of
> rows, either by hand or using dynamic SQL.
> http://support.microsoft.com/defaul...b;EN-US;q175574
> Hopefully you realize that this is generally a very silly to even
> attempt in SQL.
> --
> David Portas, SQL Server MVP
> Whenever possible please post enough code to reproduce your problem.
> Including CREATE TABLE and INSERT statements usually helps.
> State what version of SQL Server you are using and specify the content
> of any error messages.
> SQL Server Books Online:
> http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
> --
>|||wheresaldo wrote:
> I tried to apply the code you mentioned for the table below and it does no
t
> seem to give the right result. Here is an example table:
>
I suspect that the reason you find this difficult is that your existing
data doesn't have enough information to solvet he problem. What is the
key of your table? Every table needs a key but you haven't specified
one.
Now, in your rotated output you have put "WI" in column 1 and "OH" in
column 2. But where did you get the idea that "WI" came first and "OH"
came second? That information (1st, 2nd, etc) isn't in your table at
all! So you can't possibly write a generic query to return that result.
Lastly, what is the key in the result you want to ouput? You originally
asked for the column names in col1 but those don't exist in the data
either so you'll have to supply them in your query. Without a key you
may have a hard time constructing any useful information from the
output.
The first example in the link I posted shows how you can do it with
subqueries. By implication you need to supply the missing information
as part of those subqueries.

> I could do the rotation or flip on the UI or front-end, but the reporting
> tool I'm using expects a table... this is why I'm trying to do this on a
> Stored Procedure.
For sure you'll need to supply a tabular result set to the reporting
tool. But every reporting tool I know of will construct this kind of
pivot table from the base data - provided of course that you supply
enough information to complete the task.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||Thanks for you input. Here is the code to rotate (or change the orientation
)
of a table. I'm not sure if it's the most effective and well-written code,
but it does exactly what I need it to do. Hope it can help someone else.
Feedback is welcome:
-- ########################################
######
-- Drop tables if already created.
-- Cannot use temp tables, becuase cannot
-- read structure.
-- ########################################
######
DROP TABLE source
DROP TABLE result
-- ########################################
######
-- create fake source table
-- ########################################
######
CREATE TABLE source
(
StateCode char(2),
StateName char(10),
StateNumber int,
StateCost decimal(18, 2)
)
INSERT INTO source VALUES ('WI','Wisconsin',1, 45.11)
INSERT INTO source VALUES ('OH','Ohio',2, 2.25)
INSERT INTO source VALUES ('CA','California',3, 4.5)
INSERT INTO source VALUES ('FL','Florida',1, 13.40)
INSERT INTO source VALUES ('FL','Florida',3, 4.50)
-- ########################################
######
-- Create result table.
-- The result table needs to have the same
-- number of columns as the source table
-- has rows, we do this dynamically.
-- Because a columns in the result table might
-- be pf different data types, each
-- column in the result table is a nvarchar(50).
-- ########################################
######
declare @.counter int
declare @.sql_create_table nvarchar(4000)
declare @.source_total_rows int
select @.source_total_rows=count(*) from source
set @.sql_create_table = 'CREATE TABLE result (columnheader varchar(100)'
set @.counter = 0
while @.counter < @.source_total_rows
begin
set @.counter = @.counter + 1
set @.sql_create_table = @.sql_create_table + ',col' + cast(@.counter as
char(1)) + ' varchar(50)'
end
set @.sql_create_table = @.sql_create_table + ')'
exec (@.sql_create_table)
-- ########################################
######
-- First Loop through the number of column from
-- the source table, we need this to get the
-- column names.
-- Second Loop reads each row from the source,
-- for one column, and then create an insert
-- statement to insert in the result table.
-- ########################################
######
declare @.sql_create_inserts nvarchar(4000)
declare @.source_column_name nvarchar(50)
declare @.source_number_of_columns int
declare @.temp_column_hold nvarchar(50)
SELECT @.source_number_of_columns = count(*)
FROM INFORMATION_SCHEMA.columns
WHERE TABLE_NAME = 'source'
set @.counter = 0
while @.counter < @.source_number_of_columns
begin
set @.counter = @.counter + 1
--#####################################
set @.source_column_name = COL_NAME(OBJECT_ID('source'), @.counter)
exec('declare cur cursor for select '+@.source_column_name+' from source')
open cur
fetch next from cur into @.temp_column_hold
set @.sql_create_inserts = 'insert into result values (''' +
@.source_column_name + ''''
while @.@.FETCH_STATUS = 0
begin
set @.sql_create_inserts = @.sql_create_inserts + ',''' +
cast(@.temp_column_hold As varchar(50)) + ''''
fetch next from cur into @.temp_column_hold
end
set @.sql_create_inserts = @.sql_create_inserts + ')'
exec(@.sql_create_inserts)
close cur
deallocate cur
--#####################################
end
select * from result
"David Portas" wrote:

> wheresaldo wrote:
> I suspect that the reason you find this difficult is that your existing
> data doesn't have enough information to solvet he problem. What is the
> key of your table? Every table needs a key but you haven't specified
> one.
> Now, in your rotated output you have put "WI" in column 1 and "OH" in
> column 2. But where did you get the idea that "WI" came first and "OH"
> came second? That information (1st, 2nd, etc) isn't in your table at
> all! So you can't possibly write a generic query to return that result.
> Lastly, what is the key in the result you want to ouput? You originally
> asked for the column names in col1 but those don't exist in the data
> either so you'll have to supply them in your query. Without a key you
> may have a hard time constructing any useful information from the
> output.
> The first example in the link I posted shows how you can do it with
> subqueries. By implication you need to supply the missing information
> as part of those subqueries.
>
> For sure you'll need to supply a tabular result set to the reporting
> tool. But every reporting tool I know of will construct this kind of
> pivot table from the base data - provided of course that you supply
> enough information to complete the task.
> --
> David Portas, SQL Server MVP
> Whenever possible please post enough code to reproduce your problem.
> Including CREATE TABLE and INSERT statements usually helps.
> State what version of SQL Server you are using and specify the content
> of any error messages.
> SQL Server Books Online:
> http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
> --
>|||I would also take care of the limitations:
- number of columns cannot exceed 1000
- row must fit on a page|||wheresaldo wrote:
> Thanks for you input. Here is the code to rotate (or change the orientati
on)
> of a table. I'm not sure if it's the most effective and well-written code
,
> but it does exactly what I need it to do. Hope it can help someone else.
> Feedback is welcome:
>
This bit is dangerous:

> exec('declare cur cursor for select '+@.source_column_name+' from source')
>
It retrieves the values in an undefined order. In itself that wouldn't
be too bad but because you go on to do the same for each column there
is absolutely no guarantee that the data for columns in the result will
line up with what was in each row in the source. What you should do is
add ORDER BY <some key>... but you still don't have a key in the source
table.
If you did have a key then you wouldn't need nested loops and cursors.
You could use a single query instead, which is generally preferable to
a cursor solution.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

change table name

What is the syntax for changing a table name? Can not find it in my
reference books.
Thanks
Laura KNever mind. By brain is turned off. I did a search. Found it.
Laura K
"Laura K" <klkazanAT@.ATcharter.net> wrote in message
news:uqrkEU$WFHA.3464@.TK2MSFTNGP10.phx.gbl...
> What is the syntax for changing a table name? Can not find it in my
> reference books.
> Thanks
> Laura K
>|||Hi !
Try This
use northwind
EXEC sp_rename 'customers', 'custs'
select * from custs--for cross checking
Regards
Swati Zingade
*** Sent via Developersdex http://www.examnotes.net ***

Change Table from Namespace

I have a table like this : dbo.Table, and I recently create a namespace, and that table belongs there. So I want the table to be created on the new namespace, Namespace.Table, which is not big deal because I can script the table as a Create, and changes the [dbo].[table] to [Namespace].[Table]. But I need to import all the rows already on the old table. How can I achieve that?
Thanks

YOu can simply do a

INSERT INTO SchemaName.NewTable
SELECT * FROM SchemaOld.OldTable

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||Sweet! Thanks a lot for yur help!!

Change table file group filegroup

Hi There

I am running SQL Server 2005 Enterprise Edition, i want to split my data and indexes on different drives.

In 2000 i had to recreate clustered indexes and non clustered indexes on the correct filegroups to accomplish this.

In 2005 i see there is a ALTER TABLE MOVE TO Filegroup option, thats cool.

Does this effectively do the same as rebuilding the clustered index on the new filegroup? Will this leave the other indexes of the table on the primay filegroup or move them as well ?

If i wanted to also move the non clustered indexes is there a better way to move them that drop and re-create on the new filegroup in 2005, i see the ALTER INDEX statement does not support a move to filegroup option.

In a nutshell what is the best/easiest way to move exisitng table data and indexes to new file groups in Sql Server 2005 Enterprise Edition?

Thanx

Hi

ALTER TABLE MOVE TO should only be used when droppin gthe old clustered index.

You cannot move the table and retain the index with above.

I guess the best thing to use is drop and create index. You can use ONLINE option (Enterprise Edition Only) so that there is no downtime.

Jag

|||

Hi Jag

I am not following you, i am using the ALTER table command i am not dropping any clustered index?

I was asking what is happening in the background.

Also you say "You cannot move the table and retain the index with above.", a re you saying you loose your indexes with this command, i find that hard to believe?

Please clarify?

|||

Ok

Sorry about the confusion.

What I meant was that, "MOVE TO clause is only available with ALTER TABLE when you do a DROP CONSTRAINT"

It is not available with ALTER TABLE on its own.

The command will look like this:

Code Snippet

alter table t1 drop constraint PK_t1 with (move to [second]);

You cannot have the following:

Code Snippet

alter table t1 move to [second]);

Jag

|||

Hi Jag

Ok cool i get it now.

That is really strange that you have to drop a constraint, and i would have thought 2005 would have provided an easier way to move filegroups for tables data and indexes?

So you reckon the drop an re-create clustered index is till the way to go ?

|||

Yes I think so.

Drop and create the index to move filegroups.

good luck and let us know how you get on.

Jag

|||

Hi Jag

Ok cool, i just find that weird that there is no better way in 2005, so basically i will do it exactly as i did in 2000.

ALso not so easy to do when you have to move hundreds or thousands of tables and their indexes.

Basically i have to cursor through all the tables drop indexes, dynmically re-create the index defintion from sysindexes and re-create the index, not very clean, please let me know if you can think of a better way.

Thanx

|||Hello,

So isn't there any way to move a table to another filegroup without any lost (PK;FK,RelationShip).

I have more than 100 tables in my database and i created 5 filegroups. I have move them in their filegruop. Is there any shortest way to move?

Thank you very much...|||

Hi

Exactly what i was wondering the whole time, but it seems there still is no better way to move filegroups than to have to drop and rebuild the PK clustered indexes etc, i am in the same situation, database with hundreds of tables and thousands of PK - FK relationships and no easy way to move them to new filegroups.

Thanx

|||

really big problem and you can't create a table on a filegroup (without code) when you using design tools Sad

please solve this problem !!!

Change table file group filegroup

Hi There

I am running SQL Server 2005 Enterprise Edition, i want to split my data and indexes on different drives.

In 2000 i had to recreate clustered indexes and non clustered indexes on the correct filegroups to accomplish this.

In 2005 i see there is a ALTER TABLE MOVE TO Filegroup option, thats cool.

Does this effectively do the same as rebuilding the clustered index on the new filegroup? Will this leave the other indexes of the table on the primay filegroup or move them as well ?

If i wanted to also move the non clustered indexes is there a better way to move them that drop and re-create on the new filegroup in 2005, i see the ALTER INDEX statement does not support a move to filegroup option.

In a nutshell what is the best/easiest way to move exisitng table data and indexes to new file groups in Sql Server 2005 Enterprise Edition?

Thanx

Hi

ALTER TABLE MOVE TO should only be used when droppin gthe old clustered index.

You cannot move the table and retain the index with above.

I guess the best thing to use is drop and create index. You can use ONLINE option (Enterprise Edition Only) so that there is no downtime.

Jag

|||

Hi Jag

I am not following you, i am using the ALTER table command i am not dropping any clustered index?

I was asking what is happening in the background.

Also you say "You cannot move the table and retain the index with above.", a re you saying you loose your indexes with this command, i find that hard to believe?

Please clarify?

|||

Ok

Sorry about the confusion.

What I meant was that, "MOVE TO clause is only available with ALTER TABLE when you do a DROP CONSTRAINT"

It is not available with ALTER TABLE on its own.

The command will look like this:

Code Snippet

alter table t1 drop constraint PK_t1 with (move to [second]);

You cannot have the following:

Code Snippet

alter table t1 move to [second]);

Jag

|||

Hi Jag

Ok cool i get it now.

That is really strange that you have to drop a constraint, and i would have thought 2005 would have provided an easier way to move filegroups for tables data and indexes?

So you reckon the drop an re-create clustered index is till the way to go ?

|||

Yes I think so.

Drop and create the index to move filegroups.

good luck and let us know how you get on.

Jag

|||

Hi Jag

Ok cool, i just find that weird that there is no better way in 2005, so basically i will do it exactly as i did in 2000.

ALso not so easy to do when you have to move hundreds or thousands of tables and their indexes.

Basically i have to cursor through all the tables drop indexes, dynmically re-create the index defintion from sysindexes and re-create the index, not very clean, please let me know if you can think of a better way.

Thanx

|||Hello,

So isn't there any way to move a table to another filegroup without any lost (PK;FK,RelationShip).

I have more than 100 tables in my database and i created 5 filegroups. I have move them in their filegruop. Is there any shortest way to move?

Thank you very much...|||

Hi

Exactly what i was wondering the whole time, but it seems there still is no better way to move filegroups than to have to drop and rebuild the PK clustered indexes etc, i am in the same situation, database with hundreds of tables and thousands of PK - FK relationships and no easy way to move them to new filegroups.

Thanx

|||

really big problem and you can't create a table on a filegroup (without code) when you using design tools Sad

please solve this problem !!!

Change System Date in SQL Server

Hi
How do I change the date forward, say from April 2004 to August 2004,
so the SQL server will pick up the August 2004 date instead.
I try to do it changing the System Date in CMOS & Windows but when SQL
server services starts, SQL change the date back to April 2004 instead
of August 2004. Seems like the SQL server is pretty smart that it
controls the date of the Server.
Anybody have some idea? Thanks a bunch for any input.
SLSL,
To the best of my knowledge, SQL Server gets the date strictly from Windows,
and does not have any automatic mechanism to reset the Windows date.
I'm going to guess that you have Windows configured to automatically
synchronize with an Internet time server, and that is resetting the Windows
(and therefore the SQL Server) clock.
Chief Tenaya
"sl" <slai@.sceptre.com> wrote in message
news:9f6f5fe0.0404081722.5406fb01@.posting.google.com...
> Hi
> How do I change the date forward, say from April 2004 to August 2004,
> so the SQL server will pick up the August 2004 date instead.
> I try to do it changing the System Date in CMOS & Windows but when SQL
> server services starts, SQL change the date back to April 2004 instead
> of August 2004. Seems like the SQL server is pretty smart that it
> controls the date of the Server.
> Anybody have some idea? Thanks a bunch for any input.
> SL|||Hi Chief
Thanks a lot! The time-server ring a bell in me now. I think it is the
PDC server that is resetting the date when the SQL services starts. I
don't have a Time Server.
I'll check it. Thanks so much! Really appreciates your input.
SL
"Tenaya" <ct@.ct.ct> wrote in message news:<OiZfvadHEHA.2836@.TK2MSFTNGP11.phx.gbl>...
> SL,
> To the best of my knowledge, SQL Server gets the date strictly from Windows,
> and does not have any automatic mechanism to reset the Windows date.
> I'm going to guess that you have Windows configured to automatically
> synchronize with an Internet time server, and that is resetting the Windows
> (and therefore the SQL Server) clock.
> Chief Tenaya
>
> "sl" <slai@.sceptre.com> wrote in message
> news:9f6f5fe0.0404081722.5406fb01@.posting.google.com...
> > Hi
> >
> > How do I change the date forward, say from April 2004 to August 2004,
> > so the SQL server will pick up the August 2004 date instead.
> >
> > I try to do it changing the System Date in CMOS & Windows but when SQL
> > server services starts, SQL change the date back to April 2004 instead
> > of August 2004. Seems like the SQL server is pretty smart that it
> > controls the date of the Server.
> >
> > Anybody have some idea? Thanks a bunch for any input.
> >
> > SL

Change System Date in SQL Server

Hi
How do I change the date forward, say from April 2004 to August 2004,
so the SQL server will pick up the August 2004 date instead.
I try to do it changing the System Date in CMOS & Windows but when SQL
server services starts, SQL change the date back to April 2004 instead
of August 2004. Seems like the SQL server is pretty smart that it
controls the date of the Server.
Anybody have some idea? Thanks a bunch for any input.
SL
SL,
To the best of my knowledge, SQL Server gets the date strictly from Windows,
and does not have any automatic mechanism to reset the Windows date.
I'm going to guess that you have Windows configured to automatically
synchronize with an Internet time server, and that is resetting the Windows
(and therefore the SQL Server) clock.
Chief Tenaya
"sl" <slai@.sceptre.com> wrote in message
news:9f6f5fe0.0404081722.5406fb01@.posting.google.c om...
> Hi
> How do I change the date forward, say from April 2004 to August 2004,
> so the SQL server will pick up the August 2004 date instead.
> I try to do it changing the System Date in CMOS & Windows but when SQL
> server services starts, SQL change the date back to April 2004 instead
> of August 2004. Seems like the SQL server is pretty smart that it
> controls the date of the Server.
> Anybody have some idea? Thanks a bunch for any input.
> SL
|||Hi Chief
Thanks a lot! The time-server ring a bell in me now. I think it is the
PDC server that is resetting the date when the SQL services starts. I
don't have a Time Server.
I'll check it. Thanks so much! Really appreciates your input.
SL
"Tenaya" <ct@.ct.ct> wrote in message news:<OiZfvadHEHA.2836@.TK2MSFTNGP11.phx.gbl>...
> SL,
> To the best of my knowledge, SQL Server gets the date strictly from Windows,
> and does not have any automatic mechanism to reset the Windows date.
> I'm going to guess that you have Windows configured to automatically
> synchronize with an Internet time server, and that is resetting the Windows
> (and therefore the SQL Server) clock.
> Chief Tenaya
>
> "sl" <slai@.sceptre.com> wrote in message
> news:9f6f5fe0.0404081722.5406fb01@.posting.google.c om...

Change System Date in SQL Server

Hi
How do I change the date forward, say from April 2004 to August 2004,
so the SQL server will pick up the August 2004 date instead.
I try to do it changing the System Date in CMOS & Windows but when SQL
server services starts, SQL change the date back to April 2004 instead
of August 2004. Seems like the SQL server is pretty smart that it
controls the date of the Server.
Anybody have some idea? Thanks a bunch for any input.
SLSL,
To the best of my knowledge, SQL Server gets the date strictly from Windows,
and does not have any automatic mechanism to reset the Windows date.
I'm going to guess that you have Windows configured to automatically
synchronize with an Internet time server, and that is resetting the Windows
(and therefore the SQL Server) clock.
Chief Tenaya
"sl" <slai@.sceptre.com> wrote in message
news:9f6f5fe0.0404081722.5406fb01@.posting.google.com...
> Hi
> How do I change the date forward, say from April 2004 to August 2004,
> so the SQL server will pick up the August 2004 date instead.
> I try to do it changing the System Date in CMOS & Windows but when SQL
> server services starts, SQL change the date back to April 2004 instead
> of August 2004. Seems like the SQL server is pretty smart that it
> controls the date of the Server.
> Anybody have some idea? Thanks a bunch for any input.
> SL|||Hi Chief
Thanks a lot! The time-server ring a bell in me now. I think it is the
PDC server that is resetting the date when the SQL services starts. I
don't have a Time Server.
I'll check it. Thanks so much! Really appreciates your input.
SL
"Tenaya" <ct@.ct.ct> wrote in message news:<OiZfvadHEHA.2836@.TK2MSFTNGP11.phx.gbl>...[color=
darkred]
> SL,
> To the best of my knowledge, SQL Server gets the date strictly from Window
s,
> and does not have any automatic mechanism to reset the Windows date.
> I'm going to guess that you have Windows configured to automatically
> synchronize with an Internet time server, and that is resetting the Window
s
> (and therefore the SQL Server) clock.
> Chief Tenaya
>
> "sl" <slai@.sceptre.com> wrote in message
> news:9f6f5fe0.0404081722.5406fb01@.posting.google.com...

Change Subtotal background color.

I created a Matrix report with subtotals.
It would be easier to read if the subtotals were shaded.
How do I shade the subtotal box. Not the lable box.
I can see the box labled totals and it is shaded it is the real total box
that I need to shade.
Thank you
Scott BurkeScott,
Using the inscope() function with the names of the matrix rows you are able
to tell when the row is a subtotal or not, then place the iif function in the
background color and sometimes the font color.
If you need more help I can find my code example. Last contract have to dig
it up.
Reeves
"Scott Burke" wrote:
> I created a Matrix report with subtotals.
> It would be easier to read if the subtotals were shaded.
> How do I shade the subtotal box. Not the lable box.
> I can see the box labled totals and it is shaded it is the real total box
> that I need to shade.
> Thank you
> Scott Burke|||Thanks for your time. However, Visual Sudioes has an error and shut down.
now the report I was working on is gone........
I will try your suggestion when I rebuild the report
Thanks again.
Scott Burke
"Reeves Smith" wrote:
> Scott,
> Using the inscope() function with the names of the matrix rows you are able
> to tell when the row is a subtotal or not, then place the iif function in the
> background color and sometimes the font color.
> If you need more help I can find my code example. Last contract have to dig
> it up.
> Reeves
>
> "Scott Burke" wrote:
> > I created a Matrix report with subtotals.
> >
> > It would be easier to read if the subtotals were shaded.
> >
> > How do I shade the subtotal box. Not the lable box.
> >
> > I can see the box labled totals and it is shaded it is the real total box
> > that I need to shade.
> >
> > Thank you
> > Scott Burke|||On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
wrote:
> Thanks for your time. However, Visual Sudioes has an error and shut down.
> now the report I was working on is gone........
> I will try your suggestion when I rebuild the report
> Thanks again.
> Scott Burke
> "Reeves Smith" wrote:
> > Scott,
> > Using the inscope() function with the names of the matrix rows you are able
> > to tell when the row is a subtotal or not, then place the iif function in the
> > background color and sometimes the font color.
> > If you need more help I can find my code example. Last contract have to dig
> > it up.
> > Reeves
> > "Scott Burke" wrote:
> > > I created a Matrix report with subtotals.
> > > It would be easier to read if the subtotals were shaded.
> > > How do I shade the subtotal box. Not the lable box.
> > > I can see the box labled totals and it is shaded it is the real total box
> > > that I need to shade.
> > > Thank you
> > > Scott Burke
Also, you could try an expression similar to this in the background
color property:
=iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
Where FieldName can be from an adjacent cell.
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Hi EMartinez,
I tried that but it did not work.
I tried the expression : =iif(Fields!textbox6.Value ='Total','lightgrey','transparent')
The box next to it is named "textbox6" with a value of
"Fields!magazinename.value"
The errror is "out of scope".
I am trying to referance the box name or the contents in the box?
Scott Burke
"EMartinez" wrote:
> On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
> wrote:
> > Thanks for your time. However, Visual Sudioes has an error and shut down.
> > now the report I was working on is gone........
> >
> > I will try your suggestion when I rebuild the report
> > Thanks again.
> > Scott Burke
> >
> > "Reeves Smith" wrote:
> > > Scott,
> >
> > > Using the inscope() function with the names of the matrix rows you are able
> > > to tell when the row is a subtotal or not, then place the iif function in the
> > > background color and sometimes the font color.
> >
> > > If you need more help I can find my code example. Last contract have to dig
> > > it up.
> >
> > > Reeves
> >
> > > "Scott Burke" wrote:
> >
> > > > I created a Matrix report with subtotals.
> >
> > > > It would be easier to read if the subtotals were shaded.
> >
> > > > How do I shade the subtotal box. Not the lable box.
> >
> > > > I can see the box labled totals and it is shaded it is the real total box
> > > > that I need to shade.
> >
> > > > Thank you
> > > > Scott Burke
>
> Also, you could try an expression similar to this in the background
> color property:
> =iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
> Where FieldName can be from an adjacent cell.
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||OK. I found the answear. Please try NOT to laught too loud. It will hurt
my feelings.
On the totals box there is an arrow in the upper right corner. If you click
on the arrow you will get the properties of the total box itself. Click
anywhere else in the box adn you get the properties of the subtotal label box.
Have fun over the weekend.
Scott Burke
"EMartinez" wrote:
> On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
> wrote:
> > Thanks for your time. However, Visual Sudioes has an error and shut down.
> > now the report I was working on is gone........
> >
> > I will try your suggestion when I rebuild the report
> > Thanks again.
> > Scott Burke
> >
> > "Reeves Smith" wrote:
> > > Scott,
> >
> > > Using the inscope() function with the names of the matrix rows you are able
> > > to tell when the row is a subtotal or not, then place the iif function in the
> > > background color and sometimes the font color.
> >
> > > If you need more help I can find my code example. Last contract have to dig
> > > it up.
> >
> > > Reeves
> >
> > > "Scott Burke" wrote:
> >
> > > > I created a Matrix report with subtotals.
> >
> > > > It would be easier to read if the subtotals were shaded.
> >
> > > > How do I shade the subtotal box. Not the lable box.
> >
> > > > I can see the box labled totals and it is shaded it is the real total box
> > > > that I need to shade.
> >
> > > > Thank you
> > > > Scott Burke
>
> Also, you could try an expression similar to this in the background
> color property:
> =iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
> Where FieldName can be from an adjacent cell.
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||Scott,
I'm not laughing as I did not even know that existed, thanks for the find.
Reeves
"Scott Burke" wrote:
> OK. I found the answear. Please try NOT to laught too loud. It will hurt
> my feelings.
> On the totals box there is an arrow in the upper right corner. If you click
> on the arrow you will get the properties of the total box itself. Click
> anywhere else in the box adn you get the properties of the subtotal label box.
> Have fun over the weekend.
> Scott Burke
> "EMartinez" wrote:
> > On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
> > wrote:
> > > Thanks for your time. However, Visual Sudioes has an error and shut down.
> > > now the report I was working on is gone........
> > >
> > > I will try your suggestion when I rebuild the report
> > > Thanks again.
> > > Scott Burke
> > >
> > > "Reeves Smith" wrote:
> > > > Scott,
> > >
> > > > Using the inscope() function with the names of the matrix rows you are able
> > > > to tell when the row is a subtotal or not, then place the iif function in the
> > > > background color and sometimes the font color.
> > >
> > > > If you need more help I can find my code example. Last contract have to dig
> > > > it up.
> > >
> > > > Reeves
> > >
> > > > "Scott Burke" wrote:
> > >
> > > > > I created a Matrix report with subtotals.
> > >
> > > > > It would be easier to read if the subtotals were shaded.
> > >
> > > > > How do I shade the subtotal box. Not the lable box.
> > >
> > > > > I can see the box labled totals and it is shaded it is the real total box
> > > > > that I need to shade.
> > >
> > > > > Thank you
> > > > > Scott Burke
> >
> >
> > Also, you could try an expression similar to this in the background
> > color property:
> > =iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
> > Where FieldName can be from an adjacent cell.
> > Hope this helps.
> >
> > Regards,
> >
> > Enrique Martinez
> > Sr. Software Consultant
> >
> >|||On Jun 1, 1:59 pm, Scott Burke <ScottBu...@.discussions.microsoft.com>
wrote:
> OK. I found the answear. Please try NOT to laught too loud. It will hurt
> my feelings.
> On the totals box there is an arrow in the upper right corner. If you click
> on the arrow you will get the properties of the total box itself. Click
> anywhere else in the box adn you get the properties of the subtotal label box.
> Have fun over the weekend.
> Scott Burke
> "EMartinez" wrote:
> > On May 31, 8:38 am, Scott Burke <ScottBu...@.discussions.microsoft.com>
> > wrote:
> > > Thanks for your time. However, Visual Sudioes has an error and shut down.
> > > now the report I was working on is gone........
> > > I will try your suggestion when I rebuild the report
> > > Thanks again.
> > > Scott Burke
> > > "Reeves Smith" wrote:
> > > > Scott,
> > > > Using the inscope() function with the names of the matrix rows you are able
> > > > to tell when the row is a subtotal or not, then place the iif function in the
> > > > background color and sometimes the font color.
> > > > If you need more help I can find my code example. Last contract have to dig
> > > > it up.
> > > > Reeves
> > > > "Scott Burke" wrote:
> > > > > I created a Matrix report with subtotals.
> > > > > It would be easier to read if the subtotals were shaded.
> > > > > How do I shade the subtotal box. Not the lable box.
> > > > > I can see the box labled totals and it is shaded it is the real total box
> > > > > that I need to shade.
> > > > > Thank you
> > > > > Scott Burke
> > Also, you could try an expression similar to this in the background
> > color property:
> > =iif(Fields!FieldName.Value Like "subtotal*", "Yellow", "White")
> > Where FieldName can be from an adjacent cell.
> > Hope this helps.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
Glad you solved the problem. Let me know if I can be of greater
assistance.
Regards,
Enrique Martinez
Sr. Software Consultant

Change Subreport Name while running

Is there a way to change the subreport name while running a report.
Depending on the user that runs the main report i would like to present
another subreport.
The subreportname can't be changed by an expression.
I could place all subreports on it and then hide the ones that arn't needed
but i don't know if a subreport that has a visibility on 'hide' still runs.
That would slow down the main report if all the subreports are running.
Kind RegardsHello Harry,
There is no way to change the subreport on demand.
But, there is a way to work around it.
You could pass a parameter to the sub report and you could use this
parameter to decide whether to generate the data source or not.
If you did not generate the data, the render time for the sub report will
reduced.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Honestly yes,
I cant' find the place where i can bock datasets of being generated in the
report parameters ...
"Wei Lu [MSFT]" <weilu@.online.microsoft.com> wrote in message
news:ju8%237sSHIHA.4200@.TK2MSFTNGHUB02.phx.gbl...
> Hi ,
> How is everything going? Please feel free to let me know if you need any
> assistance.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>|||Hello Harry,
You may use a stored procedure which could accept the parameter.
You could use the IF clause in the stored procedure to check the parameter
and dicide to return the empty dataset or not.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Change subreport colors

I have a report in which I alternate colors between white and whitesmoke.
Simple report that contains a table with a header and a body. The body is
set to =iif(RowNumber(Nothing) Mod 2, "WhiteSmoke", "White") I then add
another row to my table, merge all cells into one and add a sub report to it.
Here I display more data by setting the parameter of the current customerID
that I am on. Is there a way to pull the current row color from by non
subreport row and apply it to the entire sub report? This way the main row
and sub report (no matter how may row of data it contains) will have the same
color.Hi,
Welcome to use MSDN Managed Newsgroup!
From your descriptions, I understood you would like to set colors according
to per row's settings (For example, if the current row background color is
whitesmoke, the want the whole subreport background to be whitesmoke also).
If I have misunderstood your concern, please feel free to point it out.
Yes, we could add another parameter in the subreport and then set this
parameter value to be iif(RowNumber(Nothing) Mod 2, "WhiteSmoke", "White")
in main report. This parameter will pass the value to subReport,
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Just what I was looking for...Thanks!!!
"Michael Cheng [MSFT]" wrote:
> Hi,
> Welcome to use MSDN Managed Newsgroup!
> From your descriptions, I understood you would like to set colors according
> to per row's settings (For example, if the current row background color is
> whitesmoke, the want the whole subreport background to be whitesmoke also).
> If I have misunderstood your concern, please feel free to point it out.
> Yes, we could add another parameter in the subreport and then set this
> parameter value to be iif(RowNumber(Nothing) Mod 2, "WhiteSmoke", "White")
> in main report. This parameter will pass the value to subReport,
> Thank you for your patience and cooperation. If you have any questions or
> concerns, don't hesitate to let me know. We are always here to be of
> assistance!
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> =====================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Hi,
You are welcome! If you have any questions or concerns next time, don't
hesitate to let me know. We are always here to be of assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Change style for HTML Viewer - toolbar

Hi,
Is it possible to change properties such background colour for HTML viewer â'
toolbar?
I just want co customise report â's look to match our applicationâ's style
where report is displayed (we use frames).
ThanksHi
you can customise it by changing the properties in the file:
"Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportManager\Styles\ReportingServices.css"
Soan
"Pendula" wrote:
> Hi,
> Is it possible to change properties such background colour for HTML viewer â'
> toolbar?
> I just want co customise report â's look to match our applicationâ's style
> where report is displayed (we use frames).
> Thanks
>|||"Pendula" <Pendula@.discussions.microsoft.com> wrote in message news:<29B698BD-3E9B-4117-A2DD-06C14F3BD296@.microsoft.com>...
> Hi,
> Is it possible to change properties such background colour for HTML viewer â'
> toolbar?
> I just want co customise report â's look to match our applicationâ's style
> where report is displayed (we use frames).
> Thanks
You can modify the stylesheet located:
\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\styles\htmlviewer.css
Andy Potter
Intellinet|||The htmlviewer.css file is not in the directory you specified.
Any reason why this file would not be created on install?
I did a search on the server and could not find the file.
Thanks
"Andrew Potter" wrote:
> "Pendula" <Pendula@.discussions.microsoft.com> wrote in message news:<29B698BD-3E9B-4117-A2DD-06C14F3BD296@.microsoft.com>...
> > Hi,
> >
> > Is it possible to change properties such background colour for HTML viewer â'
> > toolbar?
> > I just want co customise report â's look to match our applicationâ's style
> > where report is displayed (we use frames).
> >
> > Thanks
>
> You can modify the stylesheet located:
> \Program Files\Microsoft SQL Server\MSSQL\Reporting
> Services\ReportServer\styles\htmlviewer.css
> Andy Potter
> Intellinet
>|||Are you logged on as a member of the administrator group? I just double
checked on my server and I see it exactly as specified here.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Don H" <Don H@.discussions.microsoft.com> wrote in message
news:6D2088A1-2C43-4A6A-9D1B-0DDD5CB49C84@.microsoft.com...
> The htmlviewer.css file is not in the directory you specified.
> Any reason why this file would not be created on install?
> I did a search on the server and could not find the file.
> Thanks
> "Andrew Potter" wrote:
> > "Pendula" <Pendula@.discussions.microsoft.com> wrote in message
news:<29B698BD-3E9B-4117-A2DD-06C14F3BD296@.microsoft.com>...
> > > Hi,
> > >
> > > Is it possible to change properties such background colour for HTML
viewer -
> > > toolbar?
> > > I just want co customise report 's look to match our application's
style
> > > where report is displayed (we use frames).
> > >
> > > Thanks
> >
> >
> > You can modify the stylesheet located:
> >
> > \Program Files\Microsoft SQL Server\MSSQL\Reporting
> > Services\ReportServer\styles\htmlviewer.css
> >
> > Andy Potter
> > Intellinet
> >|||I am logged on as member of the admin group.
I did find in the RS SP1 readme that the new URL Access Parameters
can be used to add a custom stylesheet.
The property is: rc:Stylesheet
Do you have any idea how this gets set in the development environment?
Thanks,
Don
"Bruce L-C [MVP]" wrote:
> Are you logged on as a member of the administrator group? I just double
> checked on my server and I see it exactly as specified here.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Don H" <Don H@.discussions.microsoft.com> wrote in message
> news:6D2088A1-2C43-4A6A-9D1B-0DDD5CB49C84@.microsoft.com...
> > The htmlviewer.css file is not in the directory you specified.
> > Any reason why this file would not be created on install?
> > I did a search on the server and could not find the file.
> >
> > Thanks
> >
> > "Andrew Potter" wrote:
> >
> > > "Pendula" <Pendula@.discussions.microsoft.com> wrote in message
> news:<29B698BD-3E9B-4117-A2DD-06C14F3BD296@.microsoft.com>...
> > > > Hi,
> > > >
> > > > Is it possible to change properties such background colour for HTML
> viewer -
> > > > toolbar?
> > > > I just want co customise report 's look to match our application's
> style
> > > > where report is displayed (we use frames).
> > > >
> > > > Thanks
> > >
> > >
> > > You can modify the stylesheet located:
> > >
> > > \Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > Services\ReportServer\styles\htmlviewer.css
> > >
> > > Andy Potter
> > > Intellinet
> > >
>
>|||Unless I am mistaken, the presence of that file is moot.
The style sheet that controls the look of the html viewer toolbar
has been compiled into the ReportingServicesWebServer.dll
I don't believe that the htmlviewer.css file is used at all.
Please confirm.
Thanks,
Rob
"Bruce L-C [MVP]"
> Are you logged on as a member of the administrator group? I just double
> checked on my server and I see it exactly as specified here.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Don H"
> > The htmlviewer.css file is not in the directory you specified.
> > Any reason why this file would not be created on install?
> > I did a search on the server and could not find the file.
> >
> > Thanks
> >
> > "Andrew Potter" wrote:
> >
> > > "Pendula"
> > > > Hi,
> > > >
> > > > Is it possible to change properties such background colour for HTML
> viewer - toolbar? I just want co customise report 's look to match our
application's
> style where report is displayed (we use frames).
> > > >
> > > > Thanks
> > >
> > >
> > > You can modify the stylesheet located:
> > >
> > > \Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > Services\ReportServer\styles\htmlviewer.css
> > >
> > > Andy Potter
> > > Intellinet|||hi goinoutwest,
it looks to me that you are right. no meter what properties i am changing
in any of the ".css" files on reporting server / designer there is no changes
at all. Actually some properties can be changed on report manager but that is
not what I am after.
Regards
"goinoutwest" wrote:
> Unless I am mistaken, the presence of that file is moot.
> The style sheet that controls the look of the html viewer toolbar
> has been compiled into the ReportingServicesWebServer.dll
> I don't believe that the htmlviewer.css file is used at all.
> Please confirm.
> Thanks,
> Rob
>
> "Bruce L-C [MVP]"
> > Are you logged on as a member of the administrator group? I just double
> > checked on my server and I see it exactly as specified here.
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "Don H"
> > > The htmlviewer.css file is not in the directory you specified.
> > > Any reason why this file would not be created on install?
> > > I did a search on the server and could not find the file.
> > >
> > > Thanks
> > >
> > > "Andrew Potter" wrote:
> > >
> > > > "Pendula"
> > > > > Hi,
> > > > >
> > > > > Is it possible to change properties such background colour for HTML
> > viewer - toolbar? I just want co customise report 's look to match our
> application's
> > style where report is displayed (we use frames).
> > > > >
> > > > > Thanks
> > > >
> > > >
> > > > You can modify the stylesheet located:
> > > >
> > > > \Program Files\Microsoft SQL Server\MSSQL\Reporting
> > > > Services\ReportServer\styles\htmlviewer.css
> > > >
> > > > Andy Potter
> > > > Intellinet
>
>