Showing posts with label similar. Show all posts
Showing posts with label similar. Show all posts

Thursday, March 29, 2012

granting privilages similar to existing user

I need to grant privilages to a user that are like the privilages of an
existing user. How can I do this?
chuck t.The easiest way would be to write a little SQL-DMO script. Create a user
object and then execute the ListObjectPermissions method. Alternatively,
you can use the Script method and replace the old user with the new user.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada tom@.cips.ca
www.pinpub.com
"Chuck" <Chuck@.discussions.microsoft.com> wrote in message
news:335EB4BA-1BCF-4151-9446-5D4BCA569657@.microsoft.com...
>I need to grant privilages to a user that are like the privilages of an
> existing user. How can I do this?
> --
> chuck t.|||Hi,
please check this if it help you to get list :
http://www.sql-server-performance.c...?TOPIC_ID=10504
:-)
Regards
--
Andy Davis
Activecrypt Team
---
SQL Server Encryption Software
http://www.activecrypt.com
"Chuck" wrote:

> I need to grant privilages to a user that are like the privilages of an
> existing user. How can I do this?
> --
> chuck t.

Monday, March 19, 2012

Got my SQLIO Results... Now what?

I posted a similar message to SQL Tools group, apologize for the
double-post, but this is urgent...
I ran SQLIO against my SAN and got back some encouraging results. It
basically seemns to point to optimal performance settings of 64KB I/O's,
4096KB "stripes", with the Buffering option to "All". How can I make sure
Windows, SQL, et al. are using the same options that SQLIO used? Is there
something that needs to be set in the registry to ensure 64KB I/O's/4096KB
"stripes"/Buffering=All, or somewhere else in Windows (2003 Server), or do I
need to modify settings in SQL (2000), or what?
Thanks
In SQL 2000 you do not have to set any knobs.
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://blogs.msdn.com/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"Michael C#" <xyz@.yomomma.com> wrote in message
news:%239MLdDNKFHA.904@.tk2msftngp13.phx.gbl...
>I posted a similar message to SQL Tools group, apologize for the
>double-post, but this is urgent...
> I ran SQLIO against my SAN and got back some encouraging results. It
> basically seemns to point to optimal performance settings of 64KB I/O's,
> 4096KB "stripes", with the Buffering option to "All". How can I make sure
> Windows, SQL, et al. are using the same options that SQLIO used? Is there
> something that needs to be set in the registry to ensure 64KB I/O's/4096KB
> "stripes"/Buffering=All, or somewhere else in Windows (2003 Server), or do
> I need to modify settings in SQL (2000), or what?
> Thanks
>
|||That's good to know. Now I need to know I *can* do with the SQLIO results.
So far the only use I've found is to print out hard copies so I'll always
have something handy to wrap raw fish with.
"wei xiao [MSFT]" <weix@.online.microsoft.com> wrote in message
news:eteDqvTKFHA.3336@.TK2MSFTNGP09.phx.gbl...
> In SQL 2000 you do not have to set any knobs.
> --
> Wei Xiao [MSFT]
> SQL Server Storage Engine Development
> http://blogs.msdn.com/weix
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Michael C#" <xyz@.yomomma.com> wrote in message
> news:%239MLdDNKFHA.904@.tk2msftngp13.phx.gbl...
>
|||SQLIO results can be useful if you experience IO bottleneck in SQL Server.
You should collect windows and SQL server performance counters as well if
you suspect such a problem.
The primary solution to IO problems are: 1)configure files and filegroups in
your database so that you can use your existing disk volumes better; 2) get
better hardware. SQL Server automatically issues the optimal IO size depends
on your file/filegroup configuration.
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://blogs.msdn.com/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"Michael C#" <xyz@.abcdef.com> wrote in message
news:E3BZd.4121$So4.369@.fe10.lga...
> That's good to know. Now I need to know I *can* do with the SQLIO
results.[vbcol=seagreen]
> So far the only use I've found is to print out hard copies so I'll always
> have something handy to wrap raw fish with.
> "wei xiao [MSFT]" <weix@.online.microsoft.com> wrote in message
> news:eteDqvTKFHA.3336@.TK2MSFTNGP09.phx.gbl...
I/O's,[vbcol=seagreen]
sure[vbcol=seagreen]
(2003
>
|||Thanks for the feedback Wei. Unfortunately we've got top of the line
hardware and have configured the heck out of files and filegroups in the
database. In fact, SQL Server isn't the issue at all. We eliminated SQL
Server completely as a bottleneck. But my understanding was that SQLIO
measures the speed of the Disk I/O subsystem, not SQL Server, anyway.
Perhaps I read the documentation wrong. Anyways, I've decided that using
SQLIO is a dead end, so I'm on to other tools. Thanks.
"Wei Xiao [MSFT]" <weix@.online.microsoft.com> wrote in message
news:423cb5b4$1@.news.microsoft.com...
> SQLIO results can be useful if you experience IO bottleneck in SQL Server.
> You should collect windows and SQL server performance counters as well if
> you suspect such a problem.
> The primary solution to IO problems are: 1)configure files and filegroups
> in
> your database so that you can use your existing disk volumes better; 2)
> get
> better hardware. SQL Server automatically issues the optimal IO size
> depends
> on your file/filegroup configuration.
> --
> --
> Wei Xiao [MSFT]
> SQL Server Storage Engine Development
> http://blogs.msdn.com/weix
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Michael C#" <xyz@.abcdef.com> wrote in message
> news:E3BZd.4121$So4.369@.fe10.lga...
> results.
> I/O's,
> sure
> (2003
>

Got my SQLIO Results... Now what?

I posted a similar message to SQL Tools group, apologize for the
double-post, but this is urgent...
I ran SQLIO against my SAN and got back some encouraging results. It
basically seemns to point to optimal performance settings of 64KB I/O's,
4096KB "stripes", with the Buffering option to "All". How can I make sure
Windows, SQL, et al. are using the same options that SQLIO used? Is there
something that needs to be set in the registry to ensure 64KB I/O's/4096KB
"stripes"/Buffering=All, or somewhere else in Windows (2003 Server), or do I
need to modify settings in SQL (2000), or what?
ThanksIn SQL 2000 you do not have to set any knobs.
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://blogs.msdn.com/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"Michael C#" <xyz@.yomomma.com> wrote in message
news:%239MLdDNKFHA.904@.tk2msftngp13.phx.gbl...
>I posted a similar message to SQL Tools group, apologize for the
>double-post, but this is urgent...
> I ran SQLIO against my SAN and got back some encouraging results. It
> basically seemns to point to optimal performance settings of 64KB I/O's,
> 4096KB "stripes", with the Buffering option to "All". How can I make sure
> Windows, SQL, et al. are using the same options that SQLIO used? Is there
> something that needs to be set in the registry to ensure 64KB I/O's/4096KB
> "stripes"/Buffering=All, or somewhere else in Windows (2003 Server), or do
> I need to modify settings in SQL (2000), or what?
> Thanks
>|||That's good to know. Now I need to know I *can* do with the SQLIO results.
So far the only use I've found is to print out hard copies so I'll always
have something handy to wrap raw fish with.
"wei xiao [MSFT]" <weix@.online.microsoft.com> wrote in message
news:eteDqvTKFHA.3336@.TK2MSFTNGP09.phx.gbl...
> In SQL 2000 you do not have to set any knobs.
> --
> Wei Xiao [MSFT]
> SQL Server Storage Engine Development
> http://blogs.msdn.com/weix
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Michael C#" <xyz@.yomomma.com> wrote in message
> news:%239MLdDNKFHA.904@.tk2msftngp13.phx.gbl...
>>I posted a similar message to SQL Tools group, apologize for the
>>double-post, but this is urgent...
>> I ran SQLIO against my SAN and got back some encouraging results. It
>> basically seemns to point to optimal performance settings of 64KB I/O's,
>> 4096KB "stripes", with the Buffering option to "All". How can I make sure
>> Windows, SQL, et al. are using the same options that SQLIO used? Is
>> there something that needs to be set in the registry to ensure 64KB
>> I/O's/4096KB "stripes"/Buffering=All, or somewhere else in Windows (2003
>> Server), or do I need to modify settings in SQL (2000), or what?
>> Thanks
>|||SQLIO results can be useful if you experience IO bottleneck in SQL Server.
You should collect windows and SQL server performance counters as well if
you suspect such a problem.
The primary solution to IO problems are: 1)configure files and filegroups in
your database so that you can use your existing disk volumes better; 2) get
better hardware. SQL Server automatically issues the optimal IO size depends
on your file/filegroup configuration.
--
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://blogs.msdn.com/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"Michael C#" <xyz@.abcdef.com> wrote in message
news:E3BZd.4121$So4.369@.fe10.lga...
> That's good to know. Now I need to know I *can* do with the SQLIO
results.
> So far the only use I've found is to print out hard copies so I'll always
> have something handy to wrap raw fish with.
> "wei xiao [MSFT]" <weix@.online.microsoft.com> wrote in message
> news:eteDqvTKFHA.3336@.TK2MSFTNGP09.phx.gbl...
> > In SQL 2000 you do not have to set any knobs.
> >
> > --
> > Wei Xiao [MSFT]
> > SQL Server Storage Engine Development
> > http://blogs.msdn.com/weix
> >
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> >
> > "Michael C#" <xyz@.yomomma.com> wrote in message
> > news:%239MLdDNKFHA.904@.tk2msftngp13.phx.gbl...
> >>I posted a similar message to SQL Tools group, apologize for the
> >>double-post, but this is urgent...
> >>
> >> I ran SQLIO against my SAN and got back some encouraging results. It
> >> basically seemns to point to optimal performance settings of 64KB
I/O's,
> >> 4096KB "stripes", with the Buffering option to "All". How can I make
sure
> >> Windows, SQL, et al. are using the same options that SQLIO used? Is
> >> there something that needs to be set in the registry to ensure 64KB
> >> I/O's/4096KB "stripes"/Buffering=All, or somewhere else in Windows
(2003
> >> Server), or do I need to modify settings in SQL (2000), or what?
> >>
> >> Thanks
> >>
> >
> >
>|||Thanks for the feedback Wei. Unfortunately we've got top of the line
hardware and have configured the heck out of files and filegroups in the
database. In fact, SQL Server isn't the issue at all. We eliminated SQL
Server completely as a bottleneck. But my understanding was that SQLIO
measures the speed of the Disk I/O subsystem, not SQL Server, anyway.
Perhaps I read the documentation wrong. Anyways, I've decided that using
SQLIO is a dead end, so I'm on to other tools. Thanks.
"Wei Xiao [MSFT]" <weix@.online.microsoft.com> wrote in message
news:423cb5b4$1@.news.microsoft.com...
> SQLIO results can be useful if you experience IO bottleneck in SQL Server.
> You should collect windows and SQL server performance counters as well if
> you suspect such a problem.
> The primary solution to IO problems are: 1)configure files and filegroups
> in
> your database so that you can use your existing disk volumes better; 2)
> get
> better hardware. SQL Server automatically issues the optimal IO size
> depends
> on your file/filegroup configuration.
> --
> --
> Wei Xiao [MSFT]
> SQL Server Storage Engine Development
> http://blogs.msdn.com/weix
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Michael C#" <xyz@.abcdef.com> wrote in message
> news:E3BZd.4121$So4.369@.fe10.lga...
>> That's good to know. Now I need to know I *can* do with the SQLIO
> results.
>> So far the only use I've found is to print out hard copies so I'll always
>> have something handy to wrap raw fish with.
>> "wei xiao [MSFT]" <weix@.online.microsoft.com> wrote in message
>> news:eteDqvTKFHA.3336@.TK2MSFTNGP09.phx.gbl...
>> > In SQL 2000 you do not have to set any knobs.
>> >
>> > --
>> > Wei Xiao [MSFT]
>> > SQL Server Storage Engine Development
>> > http://blogs.msdn.com/weix
>> >
>> >
>> > This posting is provided "AS IS" with no warranties, and confers no
>> > rights.
>> >
>> > "Michael C#" <xyz@.yomomma.com> wrote in message
>> > news:%239MLdDNKFHA.904@.tk2msftngp13.phx.gbl...
>> >>I posted a similar message to SQL Tools group, apologize for the
>> >>double-post, but this is urgent...
>> >>
>> >> I ran SQLIO against my SAN and got back some encouraging results. It
>> >> basically seemns to point to optimal performance settings of 64KB
> I/O's,
>> >> 4096KB "stripes", with the Buffering option to "All". How can I make
> sure
>> >> Windows, SQL, et al. are using the same options that SQLIO used? Is
>> >> there something that needs to be set in the registry to ensure 64KB
>> >> I/O's/4096KB "stripes"/Buffering=All, or somewhere else in Windows
> (2003
>> >> Server), or do I need to modify settings in SQL (2000), or what?
>> >>
>> >> Thanks
>> >>
>> >
>> >
>>
>

Got my SQLIO Results... Now what?

I posted a similar message to SQL Tools group, apologize for the
double-post, but this is urgent...
I ran SQLIO against my SAN and got back some encouraging results. It
basically seemns to point to optimal performance settings of 64KB I/O's,
4096KB "stripes", with the Buffering option to "All". How can I make sure
Windows, SQL, et al. are using the same options that SQLIO used? Is there
something that needs to be set in the registry to ensure 64KB I/O's/4096KB
"stripes"/Buffering=All, or somewhere else in Windows (2003 Server), or do I
need to modify settings in SQL (2000), or what?
ThanksIn SQL 2000 you do not have to set any knobs.
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://blogs.msdn.com/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"Michael C#" <xyz@.yomomma.com> wrote in message
news:%239MLdDNKFHA.904@.tk2msftngp13.phx.gbl...
>I posted a similar message to SQL Tools group, apologize for the
>double-post, but this is urgent...
> I ran SQLIO against my SAN and got back some encouraging results. It
> basically seemns to point to optimal performance settings of 64KB I/O's,
> 4096KB "stripes", with the Buffering option to "All". How can I make sure
> Windows, SQL, et al. are using the same options that SQLIO used? Is there
> something that needs to be set in the registry to ensure 64KB I/O's/4096KB
> "stripes"/Buffering=All, or somewhere else in Windows (2003 Server), or do
> I need to modify settings in SQL (2000), or what?
> Thanks
>|||That's good to know. Now I need to know I *can* do with the SQLIO results.
So far the only use I've found is to print out hard copies so I'll always
have something handy to wrap raw fish with.
"wei xiao [MSFT]" <weix@.online.microsoft.com> wrote in message
news:eteDqvTKFHA.3336@.TK2MSFTNGP09.phx.gbl...
> In SQL 2000 you do not have to set any knobs.
> --
> Wei Xiao [MSFT]
> SQL Server Storage Engine Development
> http://blogs.msdn.com/weix
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Michael C#" <xyz@.yomomma.com> wrote in message
> news:%239MLdDNKFHA.904@.tk2msftngp13.phx.gbl...
>|||SQLIO results can be useful if you experience IO bottleneck in SQL Server.
You should collect windows and SQL server performance counters as well if
you suspect such a problem.
The primary solution to IO problems are: 1)configure files and filegroups in
your database so that you can use your existing disk volumes better; 2) get
better hardware. SQL Server automatically issues the optimal IO size depends
on your file/filegroup configuration.
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://blogs.msdn.com/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"Michael C#" <xyz@.abcdef.com> wrote in message
news:E3BZd.4121$So4.369@.fe10.lga...
> That's good to know. Now I need to know I *can* do with the SQLIO
results.
> So far the only use I've found is to print out hard copies so I'll always
> have something handy to wrap raw fish with.
> "wei xiao [MSFT]" <weix@.online.microsoft.com> wrote in message
> news:eteDqvTKFHA.3336@.TK2MSFTNGP09.phx.gbl...
I/O's,[vbcol=seagreen]
sure[vbcol=seagreen]
(2003[vbcol=seagreen]
>|||Thanks for the feedback Wei. Unfortunately we've got top of the line
hardware and have configured the heck out of files and filegroups in the
database. In fact, SQL Server isn't the issue at all. We eliminated SQL
Server completely as a bottleneck. But my understanding was that SQLIO
measures the speed of the Disk I/O subsystem, not SQL Server, anyway.
Perhaps I read the documentation wrong. Anyways, I've decided that using
SQLIO is a dead end, so I'm on to other tools. Thanks.
"Wei Xiao [MSFT]" <weix@.online.microsoft.com> wrote in message
news:423cb5b4$1@.news.microsoft.com...
> SQLIO results can be useful if you experience IO bottleneck in SQL Server.
> You should collect windows and SQL server performance counters as well if
> you suspect such a problem.
> The primary solution to IO problems are: 1)configure files and filegroups
> in
> your database so that you can use your existing disk volumes better; 2)
> get
> better hardware. SQL Server automatically issues the optimal IO size
> depends
> on your file/filegroup configuration.
> --
> --
> Wei Xiao [MSFT]
> SQL Server Storage Engine Development
> http://blogs.msdn.com/weix
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Michael C#" <xyz@.abcdef.com> wrote in message
> news:E3BZd.4121$So4.369@.fe10.lga...
> results.
> I/O's,
> sure
> (2003
>

Wednesday, March 7, 2012

GoalSeek in SQL Server?

Has anyone create a GoalS function similar to that of Excel? I've
been researching this and trying to script one out myself without much
sucess. If someone could tell me that its impossible, that would be
helpful too. TIA.This is not really what SQL is used for.|||You may be able to do it in MDX using multiple-pass calculations to iterate
to the required result:
http://msdn.microsoft.com/library/d...
anced_6jn7.asp
In pure SQL you could perhaps do it without iteration if the range of
possible values is small enough:
SELECT TOP 1 N1.num, N2.num
FROM some_numbers AS N1, some_numbers AS N2
WHERE (N1.num + (N2.num/2) - 123) = 12345
ORDER BY N1.num, N2.num
David Portas
SQL Server MVP
--|||I have used SQL to solve number puzzles, just for fun (eh!?). Try the
following script.
-- Easy example, all combinations of the numbers 1-9 which add up to 11
DECLARE @.control TABLE ( control_no TINYINT PRIMARY KEY, control_str AS CAST
(control_no AS CHAR(1) ) )
DECLARE @.i INT
SET NOCOUNT ON
SET @.i = 0
-- Add control numbers to temp table
WHILE @.i Between 0 And 9
BEGIN
INSERT @.control VALUES( @.i )
SET @.i = @.i + 1
END
SET NOCOUNT OFF
-- List all combinations which add up to 11
SELECT a.control_no, b.control_no, a.control_no + b.control_no
FROM @.control a, @.control b
WHERE a.control_no + b.control_no = 11
-- Harder example; MENSA-type substitution puzzle
-- Mensa's Number Puzzles for Math Geniuses by Harold Gale has this puzzle:
--
-- Number Puzzle 58
-- Place six three digit numbers of 100 plus at the end of 685
-- so that six numbers of six digits are produced [like 685123].
-- When each number is divided by 111 six whole numbers can be found.
SELECT
a.control_str,
b.control_str,
c.control_str,
a.control_str + b.control_str + c.control_str AS result,
'685' + a.control_str + b.control_str + c.control_str AS result2,
CAST( '685' + a.control_str + b.control_str + c.control_str AS DECIMAL ) /
111 AS result2
FROM @.control a, @.control b, @.control c
WHERE a.control_str + b.control_str + c.control_str > 100
AND ( CAST( '685' + a.control_str + b.control_str + c.control_str AS
DECIMAL ) / 111 ) =
CAST ( CAST( '685' + a.control_str + b.control_str + c.control_str AS
DECIMAL ) / 111 AS INT )
ORDER BY 1
-- This puzzle is similar to ones like this:
-- How many three digit numbers are divisible by 17?
-- Well, the first one is greater than 100. 100/17=5.88235. . . So the first
is 6x17=102. We don't need to list these three digit numbers. The last one i
s
less than 1000. 1000/17=58.8235. . . So our three digit numbers are 6x17,
7x17, 8x17, . . ., 58x17. There are 53 such numbers.
SELECT
a.control_str,
b.control_str,
c.control_str,
a.control_str + b.control_str + c.control_str AS result,
CAST( a.control_str + b.control_str + c.control_str AS DECIMAL ) / 17 AS
result2
FROM @.control a, @.control b, @.control c
WHERE a.control_str + b.control_str + c.control_str > 100
AND ( CAST( a.control_str + b.control_str + c.control_str AS DECIMAL ) /
17 ) =
CAST ( CAST( a.control_str + b.control_str + c.control_str AS DECIMAL ) /
17 AS INT )
ORDER BY 1
-- etc
Obviously the code above is quick and dirty, but you see where I'm going.
If not, look up 'Cartesian products'. Don't go using it in production
environment!
Let me know hot you get on.
Damien
"carmaboy@.gmail.com" wrote:

> Has anyone create a GoalS function similar to that of Excel? I've
> been researching this and trying to script one out myself without much
> sucess. If someone could tell me that its impossible, that would be
> helpful too. TIA.
>|||Did you notice that you wind up generating all possible combinations|||Yes, I'm using the cartesian product to get the answers to the puzzles. Is
that what you mean? Presumably there are other ways to do this, but this wa
s
just a demo, and hey it works!
Damien
"--CELKO--" wrote:

> Did you notice that you wind up generating all possible combinations
>|||Perhaps Joe's point was that declarative SQL solutions generally will
produce the total set of results, effort that is highly redundant if
all solutions are equal. What you probably wanted was just the fastest
single solution. That's why SQL is likely a heavily inefficient
solution - ok for solving recreational problems but in a commercial
environment you'll probably be better off with a procedural language or
a math/stats package.
David Portas
SQL Server MVP
--|||>> Perhaps Joe's point was that declarative SQL solutions generally will pro
duce the total set of results, <<
In fact, I just a did a short piece for DBAzine with a simple bin
packing problem (one bin, n-items) to demonstrate how the answer space
keeps doubling.

Friday, February 24, 2012

Global Function in 2005

Hi,
I'm trying to create a global function in SQL Server 2005. I mean, a
function similar to GETDATE(), that is public for all databases.
This is possible in SQL Server 2000, but I don't find any similar in
2005
Thanks in advance
--
--
--
Un saludo
--
---
"Slo s que no s nada. " (Scrates)Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> I'm trying to create a global function in SQL Server 2005. I mean, a
> function similar to GETDATE(), that is public for all databases.
> This is possible in SQL Server 2000, but I don't find any similar in
> 2005
I guess this was possible in SQL 2000 by creating functions in master and
make them look like system functions as fn_get_trace_status(). However,
that was entirely unsupported.
In SQL 2005, system procedures and system functions are stored in the
invisible resource database.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thanks Edgar,
I know this was unsupported, but the applications that actually run
against SQL Server 2000 use this feature, so I trying to do the same in
2005. Do you know any way to get something similar?
I try with synonyms, but it's no possible
--
--
--
Un saludo
--
---
"Slo s que no s nada. " (Scrates)
"Erland Sommarskog" <esquel@.sommarskog.se> escribi en el mensaje
news:Xns97D38A59F23A4Yazorman@.127.0.0.1...
> Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> I guess this was possible in SQL 2000 by creating functions in master and
> make them look like system functions as fn_get_trace_status(). However,
> that was entirely unsupported.
> In SQL 2005, system procedures and system functions are stored in the
> invisible resource database.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx|||Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> I know this was unsupported, but the applications that actually run
> against SQL Server 2000 use this feature, so I trying to do the same in
> 2005. Do you know any way to get something similar?
Moral: don't rely on unsupported and undocumented behaviour.

> I try with synonyms, but it's no possible
Synonyms sounds as the best bet, but you would have to install them in
every database. And the functions can not operate on tables in the local
database.
You will have to back to the drawing-board, I guess.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Bad news, really...
In my case, I don't need the functions to operate with tables. There are
scalar function, for example, something like
CREATE FUNCTION dbo.fn_Trim (@.par VARCHAR(8000))
RETURNS VARCHAR(8000)
AS
BEGIN
RETURN RTRIM(LTRIM(@.par))
END
I think that the possibility to create this type of scalar-functions
(globals for all databases) could be an interesting feature.
Anyway, thanks for your help Erland
--
--
--
Un saludo
--
---
"Slo s que no s nada. " (Scrates)
"Erland Sommarskog" <esquel@.sommarskog.se> escribi en el mensaje
news:Xns97D39FFD079A1Yazorman@.127.0.0.1...
> Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> Moral: don't rely on unsupported and undocumented behaviour.
>
> Synonyms sounds as the best bet, but you would have to install them in
> every database. And the functions can not operate on tables in the local
> database.
> You will have to back to the drawing-board, I guess.
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx|||Carlos Sacristn (csacristanARROBAmvpsPUNTOorg) writes:
> In my case, I don't need the functions to operate with tables. There
> are scalar function, for example, something like
> CREATE FUNCTION dbo.fn_Trim (@.par VARCHAR(8000))
> RETURNS VARCHAR(8000)
> AS
> BEGIN
> RETURN RTRIM(LTRIM(@.par))
> END
> I think that the possibility to create this type of scalar-functions
> (globals for all databases) could be an interesting feature.
On http://lab.msdn.microsoft.com/ProductFeedback/ you can submit a
suggestion for this to be added ot a future release of SQL Server.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx