Sunday, March 25, 2012
changing the internet port number of MS RS Server
going back to MS RS home page I have an error page from MS RS with the
following message :
"The underlying connection was closed: Unable to connect to the remote
server."
I can't solve this
Could anybody help me.
Regards,
PS: OS is Win2K all Windows Updates, and IIS5Make sure to update the url in RSWebapplication.config to use the new port.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"jcredk" <jcredk@.discussions.microsoft.com> wrote in message
news:2F53430B-20F3-4BB4-A51F-2E60F5074592@.microsoft.com...
> I tried to change the MS RS Server port from 80 to let's say 8080. But
when
> going back to MS RS home page I have an error page from MS RS with the
> following message :
> "The underlying connection was closed: Unable to connect to the remote
> server."
> I can't solve this
> Could anybody help me.
> Regards,
> PS: OS is Win2K all Windows Updates, and IIS5
>|||Hi,
Thanks a lot that was the key I was searching.
Quick test has worked. I was accessing the homepage for reports ..!
"Daniel Reib [MSFT]" wrote:
> Make sure to update the url in RSWebapplication.config to use the new port.
> --
> -Daniel
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "jcredk" <jcredk@.discussions.microsoft.com> wrote in message
> news:2F53430B-20F3-4BB4-A51F-2E60F5074592@.microsoft.com...
> > I tried to change the MS RS Server port from 80 to let's say 8080. But
> when
> > going back to MS RS home page I have an error page from MS RS with the
> > following message :
> > "The underlying connection was closed: Unable to connect to the remote
> > server."
> >
> > I can't solve this
> >
> > Could anybody help me.
> >
> > Regards,
> >
> > PS: OS is Win2K all Windows Updates, and IIS5
> >
>
>|||I try this,
but now i have a blank default page, with no poosibility ton configure
anything,
i have just Home, My subscription, help menu
no menu to add directory or ton configure security.
I have forgotten something ?
Thanks.
Bruno
"jcredk" wrote:
> Hi,
> Thanks a lot that was the key I was searching.
> Quick test has worked. I was accessing the homepage for reports ..!
> "Daniel Reib [MSFT]" wrote:
> > Make sure to update the url in RSWebapplication.config to use the new port.
> >
> > --
> > -Daniel
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> >
> > "jcredk" <jcredk@.discussions.microsoft.com> wrote in message
> > news:2F53430B-20F3-4BB4-A51F-2E60F5074592@.microsoft.com...
> > > I tried to change the MS RS Server port from 80 to let's say 8080. But
> > when
> > > going back to MS RS home page I have an error page from MS RS with the
> > > following message :
> > > "The underlying connection was closed: Unable to connect to the remote
> > > server."
> > >
> > > I can't solve this
> > >
> > > Could anybody help me.
> > >
> > > Regards,
> > >
> > > PS: OS is Win2K all Windows Updates, and IIS5
> > >
> >
> >
> >|||Did you try to reset iis using command IISReset ?
Most of the times simply restarting IIS does not force IIS to read/reflect
registry or config changes.
I had same problem on CRM server using SRS after changing some of IIS
configuration, this trick resolved it.
"jcredk" wrote:
> I tried to change the MS RS Server port from 80 to let's say 8080. But when
> going back to MS RS home page I have an error page from MS RS with the
> following message :
> "The underlying connection was closed: Unable to connect to the remote
> server."
> I can't solve this
> Could anybody help me.
> Regards,
> PS: OS is Win2K all Windows Updates, and IIS5
>sql
Changing the default port number and still connecting
I have SQL Server 2000 Enterprise Edition, and I'd like to change the
default port to something else (we'll use 2033 for this example). I've
tried to connect from another computer on the same subnet using
"ServerName:2033" as the server, but it doesn't connect. It will connect if
I change the Server to use the default port and change the server to connect
to on the client to "ServerName", but either I"m not referencing the new
port number properly or ?
Any help you could provide would be great.
Thanks In Advance!
Rick
Hi,
Stop all applications and Third party software services in the server.
After the applications and services are stopped, change the port and start
SQL Server
service. This should enable SQL Server to take control of new port. Open the
sql server error log and see if the new port is used.
See additional details from old post.
http://groups.google.co.in/groups?q=...ft.com&rnum=10
Thanks
Hari
SQL Server MVP
"RWC" <rcollens_SPAMONATOR_@.hemmingway.com> wrote in message
news:kUAde.1198452$8l.948157@.pd7tw1no...
> Hello,
> I have SQL Server 2000 Enterprise Edition, and I'd like to change the
> default port to something else (we'll use 2033 for this example). I've
> tried to connect from another computer on the same subnet using
> "ServerName:2033" as the server, but it doesn't connect. It will connect
if
> I change the Server to use the default port and change the server to
connect
> to on the client to "ServerName", but either I"m not referencing the new
> port number properly or ?
> Any help you could provide would be great.
> Thanks In Advance!
> Rick
>
|||Hi
"ServerName, 2033" is the correct format.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"RWC" wrote:
> Hello,
> I have SQL Server 2000 Enterprise Edition, and I'd like to change the
> default port to something else (we'll use 2033 for this example). I've
> tried to connect from another computer on the same subnet using
> "ServerName:2033" as the server, but it doesn't connect. It will connect if
> I change the Server to use the default port and change the server to connect
> to on the client to "ServerName", but either I"m not referencing the new
> port number properly or ?
> Any help you could provide would be great.
> Thanks In Advance!
> Rick
>
>
|||You're a GENIUS man! ;)
Thanks Mike, that worked like a charm. (I figured it would be the
connection syntax).
Thanks again!
Rick
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:C7FAFA8A-7B27-4E48-88CB-90E00FF63573@.microsoft.com...[vbcol=seagreen]
> Hi
> "ServerName, 2033" is the correct format.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
>
> "RWC" wrote:
Changing the default port number and still connecting
I have SQL Server 2000 Enterprise Edition, and I'd like to change the
default port to something else (we'll use 2033 for this example). I've
tried to connect from another computer on the same subnet using
"ServerName:2033" as the server, but it doesn't connect. It will connect if
I change the Server to use the default port and change the server to connect
to on the client to "ServerName", but either I"m not referencing the new
port number properly or '
Any help you could provide would be great.
Thanks In Advance!
RickHi,
Stop all applications and Third party software services in the server.
After the applications and services are stopped, change the port and start
SQL Server
service. This should enable SQL Server to take control of new port. Open the
sql server error log and see if the new port is used.
See additional details from old post.
gVBHA.237%40cppssbbsa01.microsoft.com&rnum=10" target="_blank">http://groups.google.co.in/groups?q...oft.com&rnum=10
Thanks
Hari
SQL Server MVP
"RWC" <rcollens_SPAMONATOR_@.hemmingway.com> wrote in message
news:kUAde.1198452$8l.948157@.pd7tw1no...
> Hello,
> I have SQL Server 2000 Enterprise Edition, and I'd like to change the
> default port to something else (we'll use 2033 for this example). I've
> tried to connect from another computer on the same subnet using
> "ServerName:2033" as the server, but it doesn't connect. It will connect
if
> I change the Server to use the default port and change the server to
connect
> to on the client to "ServerName", but either I"m not referencing the new
> port number properly or '
> Any help you could provide would be great.
> Thanks In Advance!
> Rick
>|||Hi
"ServerName, 2033" is the correct format.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"RWC" wrote:
> Hello,
> I have SQL Server 2000 Enterprise Edition, and I'd like to change the
> default port to something else (we'll use 2033 for this example). I've
> tried to connect from another computer on the same subnet using
> "ServerName:2033" as the server, but it doesn't connect. It will connect
if
> I change the Server to use the default port and change the server to conne
ct
> to on the client to "ServerName", but either I"m not referencing the new
> port number properly or '
> Any help you could provide would be great.
> Thanks In Advance!
> Rick
>
>|||You're a GENIUS man! ;)
Thanks Mike, that worked like a charm. (I figured it would be the
connection syntax).
Thanks again!
Rick
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:C7FAFA8A-7B27-4E48-88CB-90E00FF63573@.microsoft.com...[vbcol=seagreen]
> Hi
> "ServerName, 2033" is the correct format.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
>
> "RWC" wrote:
>
Changing the default port number and still connecting
I have SQL Server 2000 Enterprise Edition, and I'd like to change the
default port to something else (we'll use 2033 for this example). I've
tried to connect from another computer on the same subnet using
"ServerName:2033" as the server, but it doesn't connect. It will connect if
I change the Server to use the default port and change the server to connect
to on the client to "ServerName", but either I"m not referencing the new
port number properly or ??
Any help you could provide would be great.
Thanks In Advance!
RickHi,
Stop all applications and Third party software services in the server.
After the applications and services are stopped, change the port and start
SQL Server
service. This should enable SQL Server to take control of new port. Open the
sql server error log and see if the new port is used.
See additional details from old post.
http://groups.google.co.in/groups?q...oft.com&rnum=10
Thanks
Hari
SQL Server MVP
"RWC" <rcollens_SPAMONATOR_@.hemmingway.com> wrote in message
news:kUAde.1198452$8l.948157@.pd7tw1no...
> Hello,
> I have SQL Server 2000 Enterprise Edition, and I'd like to change the
> default port to something else (we'll use 2033 for this example). I've
> tried to connect from another computer on the same subnet using
> "ServerName:2033" as the server, but it doesn't connect. It will connect
if
> I change the Server to use the default port and change the server to
connect
> to on the client to "ServerName", but either I"m not referencing the new
> port number properly or ??
> Any help you could provide would be great.
> Thanks In Advance!
> Ricksql
Changing the default database
Management Studio, there is one database that is selected by default
(under Available Databases). But this is not the database that I use
regularly. Everytime I run a query, I have to make sure that the
database is changed.
Is there a way to change the default database selected in the
Available Databases drop down?
Thanks
How do you open the query window? The exact steps for opening the query window determines what steps
you need to take to make this your default database.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"spdude" <sandeshmeda@.gmail.com> wrote in message
news:1178132157.841268.133800@.y80g2000hsf.googlegr oups.com...
>I have a large number of databases on my localhost. Whenever I open up
> Management Studio, there is one database that is selected by default
> (under Available Databases). But this is not the database that I use
> regularly. Everytime I run a query, I have to make sure that the
> database is changed.
> Is there a way to change the default database selected in the
> Available Databases drop down?
> Thanks
>
Changing the default database
Management Studio, there is one database that is selected by default
(under Available Databases). But this is not the database that I use
regularly. Everytime I run a query, I have to make sure that the
database is changed.
Is there a way to change the default database selected in the
Available Databases drop down?
ThanksHow do you open the query window? The exact steps for opening the query window determines what steps
you need to take to make this your default database.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"spdude" <sandeshmeda@.gmail.com> wrote in message
news:1178132157.841268.133800@.y80g2000hsf.googlegroups.com...
>I have a large number of databases on my localhost. Whenever I open up
> Management Studio, there is one database that is selected by default
> (under Available Databases). But this is not the database that I use
> regularly. Everytime I run a query, I have to make sure that the
> database is changed.
> Is there a way to change the default database selected in the
> Available Databases drop down?
> Thanks
>|||On May 2, 2:55 pm, spdude <sandeshm...@.gmail.com> wrote:
> I have a large number of databases on my localhost. Whenever I open up
> Management Studio, there is one database that is selected by default
> (under Available Databases). But this is not the database that I use
> regularly. Everytime I run a query, I have to make sure that the
> database is changed.
> Is there a way to change the default database selected in the
> Available Databases drop down?
> Thanks
Have you tried setting the default database for the login you use?|||Thanks for the replies.
How do I set the default database for the login?
I open the query window by clicking on the "New Query" button. I like
this method because its just one click away.
On May 2, 2:49 pm, tcappelle...@.gmail.com wrote:
> On May 2, 2:55 pm,spdude<sandeshm...@.gmail.com> wrote:
> > I have a large number of databases on my localhost. Whenever I open up
> > Management Studio, there is one database that is selected by default
> > (under Available Databases). But this is not the database that I use
> > regularly. Everytime I run a query, I have to make sure that the
> > database is changed.
> > Is there a way to change the default database selected in the
> > Available Databases drop down?
> > Thanks
> Have you tried setting the default database for the login you use?|||Look at sp_defaultdb in Books Online. You can also use:
ALTER LOGIN sa WITH DEFAULT_DATABASE = [master];
--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"spdude" <sandeshmeda@.gmail.com> wrote in message
news:1178286625.150157.211740@.h2g2000hsg.googlegroups.com...
> Thanks for the replies.
> How do I set the default database for the login?
> I open the query window by clicking on the "New Query" button. I like
> this method because its just one click away.
> On May 2, 2:49 pm, tcappelle...@.gmail.com wrote:
>> On May 2, 2:55 pm,spdude<sandeshm...@.gmail.com> wrote:
>> > I have a large number of databases on my localhost. Whenever I open up
>> > Management Studio, there is one database that is selected by default
>> > (under Available Databases). But this is not the database that I use
>> > regularly. Everytime I run a query, I have to make sure that the
>> > database is changed.
>> > Is there a way to change the default database selected in the
>> > Available Databases drop down?
>> > Thanks
>> Have you tried setting the default database for the login you use?
>
Changing the default database
Management Studio, there is one database that is selected by default
(under Available Databases). But this is not the database that I use
regularly. Everytime I run a query, I have to make sure that the
database is changed.
Is there a way to change the default database selected in the
Available Databases drop down?
ThanksHow do you open the query window? The exact steps for opening the query wind
ow determines what steps
you need to take to make this your default database.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"spdude" <sandeshmeda@.gmail.com> wrote in message
news:1178132157.841268.133800@.y80g2000hsf.googlegroups.com...
>I have a large number of databases on my localhost. Whenever I open up
> Management Studio, there is one database that is selected by default
> (under Available Databases). But this is not the database that I use
> regularly. Everytime I run a query, I have to make sure that the
> database is changed.
> Is there a way to change the default database selected in the
> Available Databases drop down?
> Thanks
>|||On May 2, 2:55 pm, spdude <sandeshm...@.gmail.com> wrote:
> I have a large number of databases on my localhost. Whenever I open up
> Management Studio, there is one database that is selected by default
> (under Available Databases). But this is not the database that I use
> regularly. Everytime I run a query, I have to make sure that the
> database is changed.
> Is there a way to change the default database selected in the
> Available Databases drop down?
> Thanks
Have you tried setting the default database for the login you use?|||Thanks for the replies.
How do I set the default database for the login?
I open the query window by clicking on the "New Query" button. I like
this method because its just one click away.
On May 2, 2:49 pm, tcappelle...@.gmail.com wrote:
> On May 2, 2:55 pm,spdude<sandeshm...@.gmail.com> wrote:
>
>
>
> Have you tried setting the default database for the login you use?|||Look at sp_defaultdb in Books Online. You can also use:
ALTER LOGIN sa WITH DEFAULT_DATABASE = [master];
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006
"spdude" <sandeshmeda@.gmail.com> wrote in message
news:1178286625.150157.211740@.h2g2000hsg.googlegroups.com...
> Thanks for the replies.
> How do I set the default database for the login?
> I open the query window by clicking on the "New Query" button. I like
> this method because its just one click away.
> On May 2, 2:49 pm, tcappelle...@.gmail.com wrote:
>sql
Tuesday, March 20, 2012
Changing SQL2K port no. on Windows 2003
I installed SQL2K SP3a on Windows 2003 server. During the install I changed
the SQL port number 1433 to 14330. Everything finished successfully.
But when the clients are trying to build the ODBC to connect to SQL server,
they cann't connect if they leave the Dynamically determine port check box
checked under the client configuration, but once we unchecked it and put the
port no. 14330 it will connect.
Shouldn't the Dynamically determine port no. option let the client get the
port no from the server? Or is there any security lockdown on Win2003
preventing the server to publish the port no.?
Thanks
AyadThey dynamically determine port only works for named instances. A default
instance will always default to 1433. You can change this but then the
client will always attempt to use port 1433o for every SQL Server it tries
to connect to.
If you choose to use a non-standard port for the default instance, you will
have to have each client change to connect using that port.
Rand
This posting is provided "as is" with no warranties and confers no rights.
Changing SQL2K port no. on Windows 2003
I installed SQL2K SP3a on Windows 2003 server. During the install I changed
the SQL port number 1433 to 14330. Everything finished successfully.
But when the clients are trying to build the ODBC to connect to SQL server,
they cann't connect if they leave the Dynamically determine port check box
checked under the client configuration, but once we unchecked it and put the
port no. 14330 it will connect.
Shouldn't the Dynamically determine port no. option let the client get the
port no from the server? Or is there any security lockdown on Win2003
preventing the server to publish the port no.?
Thanks
Ayad
They dynamically determine port only works for named instances. A default
instance will always default to 1433. You can change this but then the
client will always attempt to use port 1433o for every SQL Server it tries
to connect to.
If you choose to use a non-standard port for the default instance, you will
have to have each client change to connect using that port.
Rand
This posting is provided "as is" with no warranties and confers no rights.
Thursday, March 8, 2012
Changing record number
I have cancelled some records due to null fields,then the record number is not coming in order.how to code it to get it in orderwow, that's a short description.........
So I'm gonna have to guess the detail. You are probably, from the brief description, experiencing a problem because your report is having trouble with the nulls. More information, including database type, OS, CR version always helps us better assess the problem.
I think you need a formula to convert fields likely to be nulls, eg:
@.AccountBalance
if IsNull({tablename.AccountBalance}) then
formula = 0
else
formula = {tablename.AccountBalance}
end if
I've deliberatley kept this simple to demonstrate the principles.
Dave
Wednesday, March 7, 2012
Changing Permissions for all Stored Procs in a SQL2005 DB
give a Database Role in that Database Execute permissions for all of the
Stored Procedures I had created (but not the System Stored Procedures). Doin
g
this through the SQL Management Tool UI will take FOREVER. Is there another
way? If it's a script of some kind, can someone give me a hint or a sample?
This may be a bit beyond me.
AlexHi,
In SQL Server 2005 it is very easy to set the execute rights to all
procedures. See the script
USE DBNAME
GO
/* CREATE A NEW ROLE */
CREATE ROLE db_executor
/* GRANT EXECUTE TO THE ROLE */
GRANT EXECUTE TO db_executor
Assign this role to the database user and he will be able to execute all
procedures inside the databse
THanks
Hari
SQL Server MVP
"Alex Maghen" <AlexMaghen@.newsgroup.nospam> wrote in message
news:1BCFF9ED-12DC-4FD3-921F-3A1E185DB18E@.microsoft.com...
>I have a massive number of Stored Procedures in a SQL Database. I need to
> give a Database Role in that Database Execute permissions for all of the
> Stored Procedures I had created (but not the System Stored Procedures).
> Doing
> this through the SQL Management Tool UI will take FOREVER. Is there
> another
> way? If it's a script of some kind, can someone give me a hint or a
> sample?
> This may be a bit beyond me.
> Alex|||Hi Alex,
Thanks for posting.
To execute a stored procedure, you have to be granted execute permission on
this stored procedure. As we know, stored procedure referenced as object in
SQL 2005. To grant permission on a object, we have a T-SQL command: Grant.
You can Grants permissions on a table, view, table-valued function, stored
procedure, extended stored procedure, scalar function, aggregate function,
service queue, or synonym.
For more information about Grant command, please refer to following link:
http://msdn2.microsoft.com/en-us/library/ms188371.aspx
Hope this information helps.
Best regards,
Vincent Xu
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
--[vbcol=seagreen]
Doing[vbcol=seagreen]
another[vbcol=seagreen]
sample?[vbcol=seagreen]|||Hari -
Hi. This is very helpful. Can I ask one more detail? Assuming that I've
already created the database role, if I do "GRANT EXECUTE TO MyNewRole", wil
l
this grant execute permissions to ALL of the stored procedures in the
database (including system stored procedures)? I don't really want to do
that. Is there a way that I can have it grant execute only to stored procs
that I created (dbo.<procname> )? Or can I do it by matching a pattern in the
SP name? All of my stored procedures start with a special 3 character prefix
.
Can I use a "where" clause or something? And if I can, how?
Let me know?
Thanks!
Alex
"Hari Prasad" wrote:
> Hi,
> In SQL Server 2005 it is very easy to set the execute rights to all
> procedures. See the script
> USE DBNAME
> GO
> /* CREATE A NEW ROLE */
> CREATE ROLE db_executor
> /* GRANT EXECUTE TO THE ROLE */
> GRANT EXECUTE TO db_executor
> Assign this role to the database user and he will be able to execute all
> procedures inside the databse
> THanks
> Hari
> SQL Server MVP
>
> "Alex Maghen" <AlexMaghen@.newsgroup.nospam> wrote in message
> news:1BCFF9ED-12DC-4FD3-921F-3A1E185DB18E@.microsoft.com...
>
>|||Hi,
As far as I know you need to give EXEC privilages to indvidual stored
procedures.
sample script:-
Run this in the database, then copy the results to the query window
and execute.
select 'Grant EXEC on ' + name + ' to WhomEver'
from sysobjects
where type = 'P'
Thanks
Hari
SQL Server MVP
"Alex Maghen" <AlexMaghen@.newsgroup.nospam> wrote in message
news:E57C2633-AE66-4837-8769-A33CB3C36CE1@.microsoft.com...[vbcol=seagreen]
> Hari -
> Hi. This is very helpful. Can I ask one more detail? Assuming that I've
> already created the database role, if I do "GRANT EXECUTE TO MyNewRole",
> will
> this grant execute permissions to ALL of the stored procedures in the
> database (including system stored procedures)? I don't really want to do
> that. Is there a way that I can have it grant execute only to stored procs
> that I created (dbo.<procname> )? Or can I do it by matching a pattern in
> the
> SP name? All of my stored procedures start with a special 3 character
> prefix.
> Can I use a "where" clause or something? And if I can, how?
> Let me know?
> Thanks!
> Alex
>
> "Hari Prasad" wrote:
>|||> Is there a way that I can have it grant execute only to stored procs
> that I created (dbo.<procname> )? Or can I do it by matching a pattern in
> the
> SP name? All of my stored procedures start with a special 3 character
> prefix.
> Can I use a "where" clause or something? And if I can, how?
One method is to generate a script to do this. The example below was
developed for SQL 2000 but works with SQL 2005 too.
SET NOCOUNT ON
DECLARE @.GrantStatement nvarchar(4000)
DECLARE GrantStatements CURSOR
LOCAL FAST_FORWARD READ_ONLY FOR
SELECT
N'GRANT EXECUTE ON ' +
QUOTENAME(ROUTINE_SCHEMA) +
N'.' +
QUOTENAME(ROUTINE_NAME) +
N' TO MyNewRole'
FROM INFORMATION_SCHEMA.ROUTINES
WHERE
OBJECTPROPERTY(
OBJECT_ID(QUOTENAME(ROUTINE_SCHEMA) +
N'.' +
QUOTENAME(ROUTINE_NAME)),
'IsMSShipped') = 0 AND
OBJECTPROPERTY(
OBJECT_ID(QUOTENAME(ROUTINE_SCHEMA) +
N'.' +
QUOTENAME(ROUTINE_NAME)),
'IsProcedure') = 1 AND
ROUTINE_SCHEMA = N'dbo' AND
ROUTINE_NAME LIKE N'usp%'
OPEN GrantStatements
WHILE 1 = 1
BEGIN
FETCH NEXT FROM GrantStatements
INTO @.GrantStatement
IF @.@.FETCH_STATUS = -1 BREAK
BEGIN
RAISERROR (@.GrantStatement, 0, 1) WITH NOWAIT
EXECUTE sp_ExecuteSQL @.GrantStatement
END
END
CLOSE GrantStatements
DEALLOCATE GrantStatements
Hope this helps.
Dan Guzman
SQL Server MVP
"Alex Maghen" <AlexMaghen@.newsgroup.nospam> wrote in message
news:E57C2633-AE66-4837-8769-A33CB3C36CE1@.microsoft.com...[vbcol=seagreen]
> Hari -
> Hi. This is very helpful. Can I ask one more detail? Assuming that I've
> already created the database role, if I do "GRANT EXECUTE TO MyNewRole",
> will
> this grant execute permissions to ALL of the stored procedures in the
> database (including system stored procedures)? I don't really want to do
> that. Is there a way that I can have it grant execute only to stored procs
> that I created (dbo.<procname> )? Or can I do it by matching a pattern in
> the
> SP name? All of my stored procedures start with a special 3 character
> prefix.
> Can I use a "where" clause or something? And if I can, how?
> Let me know?
> Thanks!
> Alex
>
> "Hari Prasad" wrote:
>
Saturday, February 25, 2012
Changing nVarChar lengths
records have a set number of characters, however the
table design specifies more characters than is really
necessary. I'd like to reclaim as much space as
possible. Am I safe to change the field lengths for the
Char fields to the maximum number of characters I know
they will ever contain, without losing any data? Will I
have to change to nVarChar? If so, any data loss?If your sure the new size is larger than the largest piece of data for any
row you should not have a problem in changing it from a database standpoint.
But you may break existing code or apps if you do. That depends on how they
use it etc.
--
Andrew J. Kelly
SQL Server MVP
"Mike" <tatemike44@.hotmail.com> wrote in message
news:033201c36e6e$8574ad20$a401280a@.phx.gbl...
> I have a db with about 6.5 million records. A few
> records have a set number of characters, however the
> table design specifies more characters than is really
> necessary. I'd like to reclaim as much space as
> possible. Am I safe to change the field lengths for the
> Char fields to the maximum number of characters I know
> they will ever contain, without losing any data? Will I
> have to change to nVarChar? If so, any data loss?
Changing Number to Text in Query
bring the data back, I would like to change the 0 to an "N" and a 1 to a
"Y".
I read up on the CASE statement and had something like but kept getting
syntax errors.
Select Name, Address, City,
CASE field_in_question
WHEN 0 THEN 'N'
WHEN 1 THEN 'Y'
END,
State, Zip from Notes
Can someone help a feebled old brain figure this one out?
Thanks,
Gary>> I read up on the CASE statement and had something like but kept getting
Can you post the error messages here?
Anith|||The error message says "Syntax error (missing operator) in query expression.
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:OCdGspmAFHA.3236@.TK2MSFTNGP15.phx.gbl...
> Can you post the error messages here?
> --
> Anith
>|||Since your original post has no attributions, let us start from simple
issues. Are you use SQL Server or Access? CASE is not supported in Access.
If you are using SQL Server, are you using Query Analyzer? Some other
interfaces have limitations on certain constructs they allow
If you are using Query Analyzer, can you post your CREATE TABLE statement
for the table Notes? For details refer to www.aspfaq.com/5006
Anith|||That's the problem. I am using Access with a Visual Basic front end.
Is there a way to do what I need to do in Access SQL?
Thanks,
Gary
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:eS5ywFnAFHA.3416@.TK2MSFTNGP09.phx.gbl...
> Since your original post has no attributions, let us start from simple
> issues. Are you use SQL Server or Access? CASE is not supported in Access.
> If you are using SQL Server, are you using Query Analyzer? Some other
> interfaces have limitations on certain constructs they allow
> If you are using Query Analyzer, can you post your CREATE TABLE statement
> for the table Notes? For details refer to www.aspfaq.com/5006
> --
> Anith
>|||Create a stored procedure or a view, and select from that within Access
instead of accessing the table directly.
http://www.aspfaq.com/
(Reverse address to reply.)
"Gary Paris" <garyparis@.yada.com> wrote in message
news:ePQKtTnAFHA.2712@.TK2MSFTNGP15.phx.gbl...
> That's the problem. I am using Access with a Visual Basic front end.
> Is there a way to do what I need to do in Access SQL?
> Thanks,
> Gary
> "Anith Sen" <anith@.bizdatasolutions.com> wrote in message
> news:eS5ywFnAFHA.3416@.TK2MSFTNGP09.phx.gbl...
Access.
statement
>|||Oh, and don't use the view designer, because it doesn't support case! Use
Query Analyzer...
http://www.aspfaq.com/
(Reverse address to reply.)
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uNFbUYnAFHA.2196@.TK2MSFTNGP14.phx.gbl...
> Create a stored procedure or a view, and select from that within Access
> instead of accessing the table directly.
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Gary Paris" <garyparis@.yada.com> wrote in message
> news:ePQKtTnAFHA.2712@.TK2MSFTNGP15.phx.gbl...
> Access.
> statement
>|||I am using Access as the back end and not using SQL server. I don't believe
Query Analyzer comes with Access (although I could be wrong). Would it be
better to post my question in the Access group or is there a way to do what
I want with Access SQL?
Thanks,
Gary
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:e4cZzanAFHA.3264@.TK2MSFTNGP12.phx.gbl...
> Oh, and don't use the view designer, because it doesn't support case! Use
> Query Analyzer...
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:uNFbUYnAFHA.2196@.TK2MSFTNGP14.phx.gbl...
>|||Sorry, I thought you were using Access to connect to SQL Server. Yes, you
can do this in Access using the IIF function. See the Access documentation
or post to an Access newsgroup. This group is dedicated to programming
in/for SQL Server.
"Gary Paris" <garyparis@.yada.com> wrote in message
news:O3$5VinAFHA.3988@.TK2MSFTNGP11.phx.gbl...
> I am using Access as the back end and not using SQL server. I don't
believe
> Query Analyzer comes with Access (although I could be wrong). Would it
be
> better to post my question in the Access group or is there a way to do
what
> I want with Access SQL?
> Thanks,
> Gary
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:e4cZzanAFHA.3264@.TK2MSFTNGP12.phx.gbl...
Use
other
>
Changing number to date
set @.d = 20031105
select cast(substring(cast(@.d as varchar(8)),5,2)+ '/' +
substring(cast(@.d as varchar(8)),7,2)+ '/' +
left(cast(@.d as varchar(8)),4)as smalldatetime)|||I need to update a whole column in an Oracle table. Thanks.
Changing number of per processor licenses
on another machine. To accomplish this, do I need to physically remove the
CPU or I can unselect 1 processor from the Processor Tab of properties sheet
.You would violate license agreement by only unselecting one processor from E
M's config dialog. The
license terms states you need one proc license per processor that the OS can
use. So either disable
one processor in BIOS (if possible) or remove it.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"SB138" <SB138@.discussions.microsoft.com> wrote in message
news:0768CDED-D7D6-4E3F-8450-25B56D297A64@.microsoft.com...[vbcol=seagreen]
>I want to change the number of licenses from 2 to 1 so I can use one licens
e
> on another machine. To accomplish this, do I need to physically remove the
> CPU or I can unselect 1 processor from the Processor Tab of properties sheet.[/vbc
ol]
Changing number of per processor licenses
on another machine. To accomplish this, do I need to physically remove the
CPU or I can unselect 1 processor from the Processor Tab of properties sheet.
You would violate license agreement by only unselecting one processor from EM's config dialog. The
license terms states you need one proc license per processor that the OS can use. So either disable
one processor in BIOS (if possible) or remove it.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"SB138" <SB138@.discussions.microsoft.com> wrote in message
news:0768CDED-D7D6-4E3F-8450-25B56D297A64@.microsoft.com...
>I want to change the number of licenses from 2 to 1 so I can use one license
> on another machine. To accomplish this, do I need to physically remove the
> CPU or I can unselect 1 processor from the Processor Tab of properties sheet.
Changing number of per processor licenses
on another machine. To accomplish this, do I need to physically remove the
CPU or I can unselect 1 processor from the Processor Tab of properties sheet.You would violate license agreement by only unselecting one processor from EM's config dialog. The
license terms states you need one proc license per processor that the OS can use. So either disable
one processor in BIOS (if possible) or remove it.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"SB138" <SB138@.discussions.microsoft.com> wrote in message
news:0768CDED-D7D6-4E3F-8450-25B56D297A64@.microsoft.com...
>I want to change the number of licenses from 2 to 1 so I can use one license
> on another machine. To accomplish this, do I need to physically remove the
> CPU or I can unselect 1 processor from the Processor Tab of properties sheet.
Changing number of data files
would like to split it into several files smaller files. What is the best
way of doing this?
thanks
GavGav
CREATE DATABASE mywind
GO
ALTER DATABASE mywind ADD FILEGROUP new_customers
ALTER DATABASE mywind ADD FILEGROUP sales
GO
ALTER DATABASE mywind ADD FILE
(NAME='mywind_data_1',
FILENAME='d:\mw.dat1')
TO FILEGROUP new_customers
ALTER DATABASE mywind
ADD FILE
(NAME='mywind_data_2',
FILENAME='d:\mw.dat2')
TO FILEGROUP sales
"Gav" <gavin.metcalfe@.portakabinnospam.com> wrote in message
news:bu3072$ltb$1@.titan.btinternet.com...
> I have a 225Gb database on a test server. It is currently in one file and
I
> would like to split it into several files smaller files. What is the best
> way of doing this?
> thanks
> Gav
>|||Hello,
Uri's solution will work, however you will have to drop
and re-create tables to add data to the filegroups.
This is because when you create a table (or index) you
also state which filegroup you will be saving your data to.
J
>--Original Message--
>I have a 225Gb database on a test server. It is currently
in one file and I
>would like to split it into several files smaller files.
What is the best
>way of doing this?
>thanks
>Gav
>
>.
>|||If I create another data file is it possible to move data from one file to
the other? I currently have a 220Gb and a 50Gb file I would like to fill up
the 50Gb file so I can resize the 220Gb file. Unfortunately I don't have
much spare storage space so I'm not sure how else I would do it. Only other
thing I can think of doing is dropping the entire database and recreating it
with more files, then I could restore a backup version.
Gav
"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:09fc01c3da8a$b5e91800$a301280a@.phx.gbl...
> Hello,
> Uri's solution will work, however you will have to drop
> and re-create tables to add data to the filegroups.
> This is because when you create a table (or index) you
> also state which filegroup you will be saving your data to.
> J
> >--Original Message--
> >I have a 225Gb database on a test server. It is currently
> in one file and I
> >would like to split it into several files smaller files.
> What is the best
> >way of doing this?
> >
> >thanks
> >
> >Gav
> >
> >
> >.
> >|||Yes, but that sort of depends where your data file is. for
instance you can create a data file on a different drive /
server than the one your using now, but if you create it
on a different server you will need to watch your network
speed.
The problem is not going to be your data files as such,
but filling them.
When you create a table/index you explicitly say
in T-SQL which data file any data the table is going to
store saves to.
Creating extra data files does will not move the data.
I don't think (and please someone tell me if I'm wrong)
whether a backup will work as a backup has in it the
database stucture so if you restore it you also restore
the number of datafiles you had before i.e 1.
There is a way of saving some time, and that it to do with
indexes.
About 1 third of all storeage space is used by indexes
(both clustered and non clusted) so hat you could do is
BACKUP YOUR DATABASE
(Sorry bit paraniod about data)
1. Create a new datafile called indexes.
2. Under EM Database - all tasks - generate SQL
Create 2 scripts one to remove all indexes and primary keys
one to re create them.
3. Drop all you indexes
4. In the script that has the create for the indexes
perform a search and replace for all the old data file
name to the new one.
5. Execute the script.
This should move about 70+ gb to your new file.
J
>--Original Message--
>If I create another data file is it possible to move data
from one file to
>the other? I currently have a 220Gb and a 50Gb file I
would like to fill up
>the 50Gb file so I can resize the 220Gb file.
Unfortunately I don't have
>much spare storage space so I'm not sure how else I would
do it. Only other
>thing I can think of doing is dropping the entire
database and recreating it
>with more files, then I could restore a backup version.
>Gav
>"Julie" <anonymous@.discussions.microsoft.com> wrote in
message
>news:09fc01c3da8a$b5e91800$a301280a@.phx.gbl...
>> Hello,
>> Uri's solution will work, however you will have to drop
>> and re-create tables to add data to the filegroups.
>> This is because when you create a table (or index) you
>> also state which filegroup you will be saving your data
to.
>> J
>> >--Original Message--
>> >I have a 225Gb database on a test server. It is
currently
>> in one file and I
>> >would like to split it into several files smaller
files.
>> What is the best
>> >way of doing this?
>> >
>> >thanks
>> >
>> >Gav
>> >
>> >
>> >.
>> >
>
>.
>|||Gav
As Julie says, if you change the database and then restore
an old backup you will end up with the structure of the
old database.
If you want to create a second data file (or more) and
populate it you have serveral options.
If you want them poulated evenly, rebuild all your
clustered indexes(or in the case where you don't have any
build a clustered index and the drop it). SQL Server will
spread your tables evenly for you and you should end up
with two near equal data files.
If you want to control size/placement create a second file
group. Make the second data file part of the second file
group. You can then move tables to the new file group from
the design table pane in Enterprise manager.
You could also create a new database and use dts to
transfer the data. You would need more space though to do
that.
Hope this helps
John
>--Original Message--
>Yes, but that sort of depends where your data file is.
for
>instance you can create a data file on a different
drive /
>server than the one your using now, but if you create it
>on a different server you will need to watch your network
>speed.
>The problem is not going to be your data files as such,
>but filling them.
>When you create a table/index you explicitly say
>in T-SQL which data file any data the table is going to
>store saves to.
>Creating extra data files does will not move the data.
>I don't think (and please someone tell me if I'm wrong)
>whether a backup will work as a backup has in it the
>database stucture so if you restore it you also restore
>the number of datafiles you had before i.e 1.
>There is a way of saving some time, and that it to do
with
>indexes.
>About 1 third of all storeage space is used by indexes
>(both clustered and non clusted) so hat you could do is
>BACKUP YOUR DATABASE
>(Sorry bit paraniod about data)
>1. Create a new datafile called indexes.
>2. Under EM Database - all tasks - generate SQL
>Create 2 scripts one to remove all indexes and primary
keys
>one to re create them.
>3. Drop all you indexes
>4. In the script that has the create for the indexes
>perform a search and replace for all the old data file
>name to the new one.
>5. Execute the script.
>This should move about 70+ gb to your new file.
>J
>
>
>>--Original Message--
>>If I create another data file is it possible to move
data
>from one file to
>>the other? I currently have a 220Gb and a 50Gb file I
>would like to fill up
>>the 50Gb file so I can resize the 220Gb file.
>Unfortunately I don't have
>>much spare storage space so I'm not sure how else I
would
>do it. Only other
>>thing I can think of doing is dropping the entire
>database and recreating it
>>with more files, then I could restore a backup version.
>>Gav
>>"Julie" <anonymous@.discussions.microsoft.com> wrote in
>message
>>news:09fc01c3da8a$b5e91800$a301280a@.phx.gbl...
>> Hello,
>> Uri's solution will work, however you will have to drop
>> and re-create tables to add data to the filegroups.
>> This is because when you create a table (or index) you
>> also state which filegroup you will be saving your
data
>to.
>> J
>> >--Original Message--
>> >I have a 225Gb database on a test server. It is
>currently
>> in one file and I
>> >would like to split it into several files smaller
>files.
>> What is the best
>> >way of doing this?
>> >
>> >thanks
>> >
>> >Gav
>> >
>> >
>> >.
>> >
>>
>>.
>.
>
Changing number of data files
Uri's solution will work, however you will have to drop
and re-create tables to add data to the filegroups.
This is because when you create a table (or index) you
also state which filegroup you will be saving your data to.
J
quote:
>--Original Message--
>I have a 225Gb database on a test server. It is currently
in one file and I
quote:
>would like to split it into several files smaller files.
What is the best
quote:If I create another data file is it possible to move data from one file to
>way of doing this?
>thanks
>Gav
>
>.
>
the other? I currently have a 220Gb and a 50Gb file I would like to fill up
the 50Gb file so I can resize the 220Gb file. Unfortunately I don't have
much spare storage space so I'm not sure how else I would do it. Only other
thing I can think of doing is dropping the entire database and recreating it
with more files, then I could restore a backup version.
Gav
"Julie" <anonymous@.discussions.microsoft.com> wrote in message
news:09fc01c3da8a$b5e91800$a301280a@.phx.gbl...[QUOTE]
> Hello,
> Uri's solution will work, however you will have to drop
> and re-create tables to add data to the filegroups.
> This is because when you create a table (or index) you
> also state which filegroup you will be saving your data to.
> J
>
> in one file and I
> What is the best|||Yes, but that sort of depends where your data file is. for
instance you can create a data file on a different drive /
server than the one your using now, but if you create it
on a different server you will need to watch your network
speed.
The problem is not going to be your data files as such,
but filling them.
When you create a table/index you explicitly say
in T-SQL which data file any data the table is going to
store saves to.
Creating extra data files does will not move the data.
I don't think (and please someone tell me if I'm wrong)
whether a backup will work as a backup has in it the
database stucture so if you restore it you also restore
the number of datafiles you had before i.e 1.
There is a way of saving some time, and that it to do with
indexes.
About 1 third of all storeage space is used by indexes
(both clustered and non clusted) so hat you could do is
BACKUP YOUR DATABASE
(Sorry bit paraniod about data)
1. Create a new datafile called indexes.
2. Under EM Database - all tasks - generate SQL
Create 2 scripts one to remove all indexes and primary keys
one to re create them.
3. Drop all you indexes
4. In the script that has the create for the indexes
perform a search and replace for all the old data file
name to the new one.
5. Execute the script.
This should move about 70+ gb to your new file.
J
quote:
>--Original Message--
>If I create another data file is it possible to move data
from one file to
quote:
>the other? I currently have a 220Gb and a 50Gb file I
would like to fill up
quote:
>the 50Gb file so I can resize the 220Gb file.
Unfortunately I don't have
quote:
>much spare storage space so I'm not sure how else I would
do it. Only other
quote:
>thing I can think of doing is dropping the entire
database and recreating it
quote:
>with more files, then I could restore a backup version.
>Gav
>"Julie" <anonymous@.discussions.microsoft.com> wrote in
message
quote:|||Gav
>news:09fc01c3da8a$b5e91800$a301280a@.phx.gbl...
to.[QUOTE]
currently[QUOTE]
files.[QUOTE]
>
>.
>
As Julie says, if you change the database and then restore
an old backup you will end up with the structure of the
old database.
If you want to create a second data file (or more) and
populate it you have serveral options.
If you want them poulated evenly, rebuild all your
clustered indexes(or in the case where you don't have any
build a clustered index and the drop it). SQL Server will
spread your tables evenly for you and you should end up
with two near equal data files.
If you want to control size/placement create a second file
group. Make the second data file part of the second file
group. You can then move tables to the new file group from
the design table pane in Enterprise manager.
You could also create a new database and use dts to
transfer the data. You would need more space though to do
that.
Hope this helps
John
quote:
>--Original Message--
>Yes, but that sort of depends where your data file is.
for
quote:
>instance you can create a data file on a different
drive /
quote:
>server than the one your using now, but if you create it
>on a different server you will need to watch your network
>speed.
>The problem is not going to be your data files as such,
>but filling them.
>When you create a table/index you explicitly say
>in T-SQL which data file any data the table is going to
>store saves to.
>Creating extra data files does will not move the data.
>I don't think (and please someone tell me if I'm wrong)
>whether a backup will work as a backup has in it the
>database stucture so if you restore it you also restore
>the number of datafiles you had before i.e 1.
>There is a way of saving some time, and that it to do
with
quote:
>indexes.
>About 1 third of all storeage space is used by indexes
>(both clustered and non clusted) so hat you could do is
>BACKUP YOUR DATABASE
>(Sorry bit paraniod about data)
>1. Create a new datafile called indexes.
>2. Under EM Database - all tasks - generate SQL
>Create 2 scripts one to remove all indexes and primary
keys
quote:
>one to re create them.
>3. Drop all you indexes
>4. In the script that has the create for the indexes
>perform a search and replace for all the old data file
>name to the new one.
>5. Execute the script.
>This should move about 70+ gb to your new file.
>J
>
>
data[QUOTE]
>from one file to
>would like to fill up
>Unfortunately I don't have
would[QUOTE]
>do it. Only other
>database and recreating it
>message
data[QUOTE]
>to.
>currently
>files.
>.
>
Changing number of data files
would like to split it into several files smaller files. What is the best
way of doing this?
thanks
GavGav
CREATE DATABASE mywind
GO
ALTER DATABASE mywind ADD FILEGROUP new_customers
ALTER DATABASE mywind ADD FILEGROUP sales
GO
ALTER DATABASE mywind ADD FILE
(NAME='mywind_data_1',
FILENAME='d:\mw.dat1')
TO FILEGROUP new_customers
ALTER DATABASE mywind
ADD FILE
(NAME='mywind_data_2',
FILENAME='d:\mw.dat2')
TO FILEGROUP sales
"Gav" <gavin.metcalfe@.portakabinnospam.com> wrote in message
news:bu3072$ltb$1@.titan.btinternet.com...
quote:
> I have a 225Gb database on a test server. It is currently in one file and
I
quote:
> would like to split it into several files smaller files. What is the best
> way of doing this?
> thanks
> Gav
>