Showing posts with label master. Show all posts
Showing posts with label master. Show all posts

Thursday, March 29, 2012

Extract Database from Master

I've a database (Citrix Data Store) that's stored in the master database (but shouldn't be). I need to extract the "Data Store" from the master
Citrix have some documentation on this:
http://support.citrix.com/article/CTX104452&searchID=10596990
The article states:
"Remove all the master database references from the new database (Please consult SQL documentation)"
My question: how do I do the above? Pointers welcome.
- Seán
Belatedly moving this thread to the database engine forum...

Extract Database from Master

I've a database (Citrix Data Store) that's stored in the master database (but shouldn't be). I need to extract the "Data Store" from the master
Citrix have some documentation on this:
http://support.citrix.com/article/CTX104452&searchID=10596990
The article states:
"Remove all the master database references from the new database (Please consult SQL documentation)"
My question: how do I do the above? Pointers welcome.
- Seán
Belatedly moving this thread to the database engine forum...

Wednesday, March 21, 2012

Extended stored procedure?

I noticed that there is something in master database called
Extended stored procedure which can be dlls? what's this? How can we make
our own sps a dll and put it somewhere like this?
Thankshttp://www.codeproject.com/database/extended_sp.asp
"Ray5531" <RayAll@.microsft.com> wrote in message
news:%23984aPOTFHA.612@.TK2MSFTNGP12.phx.gbl...
>I noticed that there is something in master database called
> Extended stored procedure which can be dlls? what's this? How can we make
> our own sps a dll and put it somewhere like this?
>
> Thanks
>|||Whoa, you really don't want to venture there. Xp runs as in-proc thus a
simple mistake in your custom xp can take the entire sqlserver down.
Anyway, here is some read.
http://msdn.microsoft.com/library/e...des_07_9rxv.asp
http://msdn.microsoft.com/library/e...con_01_22sz.asp
-oj
"Ray5531" <RayAll@.microsft.com> wrote in message
news:%23984aPOTFHA.612@.TK2MSFTNGP12.phx.gbl...
>I noticed that there is something in master database called
> Extended stored procedure which can be dlls? what's this? How can we make
> our own sps a dll and put it somewhere like this?
>
> Thanks
>|||Do they really have to be in Master Database only?
I don't know C++,is there another way of making an extended sp? like using
C#?
Thanks
"Michael C#" <howsa@.boutdat.com> wrote in message
news:%23Oc2HSOTFHA.2304@.tk2msftngp13.phx.gbl...
> http://www.codeproject.com/database/extended_sp.asp
>
> "Ray5531" <RayAll@.microsft.com> wrote in message
> news:%23984aPOTFHA.612@.TK2MSFTNGP12.phx.gbl...
>|||Not in managed code, no. AFAIK, SQL 2K5 will allow hosting of managed code.
I would either: 1) Write whatever you're trying to do as an external app and
run it separately from SQL Server, or 2) Wait for SQL 2K5.
"Ray5531" <RayAll@.microsft.com> wrote in message
news:%23ECPaUOTFHA.584@.TK2MSFTNGP15.phx.gbl...
> Do they really have to be in Master Database only?
> I don't know C++,is there another way of making an extended sp? like using
> C#?
> Thanks
> "Michael C#" <howsa@.boutdat.com> wrote in message
> news:%23Oc2HSOTFHA.2304@.tk2msftngp13.phx.gbl...
>|||Can I write my own sps as dlls in 2005 with managed code ?
Thanks
"Michael C#" <howsa@.boutdat.com> wrote in message
news:u1iDgeOTFHA.3216@.TK2MSFTNGP10.phx.gbl...
> Not in managed code, no. AFAIK, SQL 2K5 will allow hosting of managed
> code. I would either: 1) Write whatever you're trying to do as an external
> app and run it separately from SQL Server, or 2) Wait for SQL 2K5.
> "Ray5531" <RayAll@.microsft.com> wrote in message
> news:%23ECPaUOTFHA.584@.TK2MSFTNGP15.phx.gbl...
>|||> Do they really have to be in Master Database only?
Yes.

> I don't know C++,is there another way of making an extended sp? like using C#?[/co
lor]
Not managed code. Not classic VB (as it creates COM DLLs, not classic DLLs).
Only C, C++ or Delphi.
Another option is to write a COM object and use SP_OACreate etc. to use that
COM object.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Ray5531" <RayAll@.microsft.com> wrote in message news:%23ECPaUOTFHA.584@.TK2MSFTNGP15.phx.gb
l...
> Do they really have to be in Master Database only?
> I don't know C++,is there another way of making an extended sp? like using
C#?
> Thanks
> "Michael C#" <howsa@.boutdat.com> wrote in message news:%23Oc2HSOTFHA.2304@.
tk2msftngp13.phx.gbl...
>|||I can't speak to extended sp's on 2K5, but my understanding is that you'll
be able to create SP's, functions, triggers and data types in managed code
that runs on SQL 2K5.
Here's a link to some MS Marketing stuff:
http://msdn.microsoft.com/msdntv/ep...>
manifest.xml
"Ray5531" <RayAll@.microsft.com> wrote in message
news:uIQ%23wxOTFHA.2096@.TK2MSFTNGP14.phx.gbl...
> Can I write my own sps as dlls in 2005 with managed code ?
> Thanks
> "Michael C#" <howsa@.boutdat.com> wrote in message
> news:u1iDgeOTFHA.3216@.TK2MSFTNGP10.phx.gbl...
>|||The official word regarding calling a .NET component with sp_OA* is "not
supported".
http://support.microsoft.com/kb/322884
However, David Browne has some work around...
http://tinyurl.com/4ur72
-oj
"Ray5531" <RayAll@.microsft.com> wrote in message
news:uIQ%23wxOTFHA.2096@.TK2MSFTNGP14.phx.gbl...
> Can I write my own sps as dlls in 2005 with managed code ?
> Thanks
> "Michael C#" <howsa@.boutdat.com> wrote in message
> news:u1iDgeOTFHA.3216@.TK2MSFTNGP10.phx.gbl...
>

extended stored procedure sp_sdidebug is missing

Hello,
I like to debug stored procedures, but the sp_sdidebug extended stored
procedure is missing on my server (master database). How can I recreate
this procedure?You wont be able to find this SP in master. It is used to turn on or off TSQ
L
debugging. There is no user interface for it and no documentation.
Just try to execute it as,
Exec sp_sdidebug 'LEGACY_ON'
And again if you are not able to run try to grant permissions to that stored
procedure for the calling user.
In the SQL Analyzer type: GRANT EXECUTE ON sp_sdidebug TO <user here>
Ref : http://www.mcse.ms/archive109-2004-9-1116387.html
Thanks,
Sree
"Jack" wrote:

> Hello,
> I like to debug stored procedures, but the sp_sdidebug extended stored
> procedure is missing on my server (master database). How can I recreate
> this procedure?
>|||Jack,
One more thing to add,
If it is not in the Extended Stored Procedures object you are out of luck
and you will have to reinstall SQL Server.
Thanks,
Sree
"Jack" wrote:

> Hello,
> I like to debug stored procedures, but the sp_sdidebug extended stored
> procedure is missing on my server (master database). How can I recreate
> this procedure?
>|||> If it is not in the Extended Stored Procedures object you are out of luck
> and you will have to reinstall SQL Server.
I don't think reinstall would be necessary. Search for the script files in t
he install folder to see
how the call to sp_addextendedproc should look like.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Sreejith G" <SreejithG@.discussions.microsoft.com> wrote in message
news:AF10B4D8-2F7E-4F52-96C9-973E69A7186F@.microsoft.com...[vbcol=seagreen]
> Jack,
> One more thing to add,
> If it is not in the Extended Stored Procedures object you are out of luck
> and you will have to reinstall SQL Server.
> Thanks,
> Sree
> "Jack" wrote:
>

extended stored procedure sp_sdidebug is missing

Hello,
I like to debug stored procedures, but the sp_sdidebug extended stored
procedure is missing on my server (master database). How can I recreate
this procedure?You wont be able to find this SP in master. It is used to turn on or off TSQL
debugging. There is no user interface for it and no documentation.
Just try to execute it as,
Exec sp_sdidebug 'LEGACY_ON'
And again if you are not able to run try to grant permissions to that stored
procedure for the calling user.
In the SQL Analyzer type: GRANT EXECUTE ON sp_sdidebug TO <user here>
Ref : http://www.mcse.ms/archive109-2004-9-1116387.html
Thanks,
Sree
"Jack" wrote:
> Hello,
> I like to debug stored procedures, but the sp_sdidebug extended stored
> procedure is missing on my server (master database). How can I recreate
> this procedure?
>|||Jack,
One more thing to add,
If it is not in the Extended Stored Procedures object you are out of luck
and you will have to reinstall SQL Server.
Thanks,
Sree
"Jack" wrote:
> Hello,
> I like to debug stored procedures, but the sp_sdidebug extended stored
> procedure is missing on my server (master database). How can I recreate
> this procedure?
>|||> If it is not in the Extended Stored Procedures object you are out of luck
> and you will have to reinstall SQL Server.
I don't think reinstall would be necessary. Search for the script files in the install folder to see
how the call to sp_addextendedproc should look like.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Sreejith G" <SreejithG@.discussions.microsoft.com> wrote in message
news:AF10B4D8-2F7E-4F52-96C9-973E69A7186F@.microsoft.com...
> Jack,
> One more thing to add,
> If it is not in the Extended Stored Procedures object you are out of luck
> and you will have to reinstall SQL Server.
> Thanks,
> Sree
> "Jack" wrote:
>> Hello,
>> I like to debug stored procedures, but the sp_sdidebug extended stored
>> procedure is missing on my server (master database). How can I recreate
>> this procedure?
>>

extended stored procedure sp_sdidebug is missing

Hello,
I like to debug stored procedures, but the sp_sdidebug extended stored
procedure is missing on my server (master database). How can I recreate
this procedure?
You wont be able to find this SP in master. It is used to turn on or off TSQL
debugging. There is no user interface for it and no documentation.
Just try to execute it as,
Exec sp_sdidebug 'LEGACY_ON'
And again if you are not able to run try to grant permissions to that stored
procedure for the calling user.
In the SQL Analyzer type: GRANT EXECUTE ON sp_sdidebug TO <user here>
Ref : http://www.mcse.ms/archive109-2004-9-1116387.html
Thanks,
Sree
"Jack" wrote:

> Hello,
> I like to debug stored procedures, but the sp_sdidebug extended stored
> procedure is missing on my server (master database). How can I recreate
> this procedure?
>
|||Jack,
One more thing to add,
If it is not in the Extended Stored Procedures object you are out of luck
and you will have to reinstall SQL Server.
Thanks,
Sree
"Jack" wrote:

> Hello,
> I like to debug stored procedures, but the sp_sdidebug extended stored
> procedure is missing on my server (master database). How can I recreate
> this procedure?
>
|||> If it is not in the Extended Stored Procedures object you are out of luck
> and you will have to reinstall SQL Server.
I don't think reinstall would be necessary. Search for the script files in the install folder to see
how the call to sp_addextendedproc should look like.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Sreejith G" <SreejithG@.discussions.microsoft.com> wrote in message
news:AF10B4D8-2F7E-4F52-96C9-973E69A7186F@.microsoft.com...[vbcol=seagreen]
> Jack,
> One more thing to add,
> If it is not in the Extended Stored Procedures object you are out of luck
> and you will have to reinstall SQL Server.
> Thanks,
> Sree
> "Jack" wrote:

Monday, March 19, 2012

extended stored procedure catch 22

How does a stored procedure call an extended stored procedure, when the
stored procedure is not in master? (I dont want to give direct permission
to the underlying extended stored procedure).
It seems you have to turn on database chaining, yet there are articles all
over the place saying database chaining is a security risk. "That's quite a
catch, our Catch-22".
Any suggestions for the best approach?
Thanks.Cross-database chaining is off by default in SQL 2000 SP3+ so that you don't
inadvertently open a security hole. You should enable 'db chaining' in your
user database only if you fully understand the security implications.
The main cross-database chaining consideration with an sa-owned user
database is that only sysadmin role members should have permissions to
create dbo-owned objects in that database. The DBA should scrutinize
database objects to ensure that only the intended commands can be executed.
As long as you've locked-down the user database, you can leverage
cross-database chaining to provide needed application functionality while
preventing direct ad-hoc extended stored procedure execution.
Hope this helps.
Dan Guzman
SQL Server MVP
"Neil W." <neilw@.netlib.com> wrote in message
news:e%23oF3H7EFHA.392@.TK2MSFTNGP14.phx.gbl...
> How does a stored procedure call an extended stored procedure, when the
> stored procedure is not in master? (I dont want to give direct permission
> to the underlying extended stored procedure).
> It seems you have to turn on database chaining, yet there are articles all
> over the place saying database chaining is a security risk. "That's quite
> a
> catch, our Catch-22".
> Any suggestions for the best approach?
> Thanks.
>
>|||Hello Neil,
You can refer to the "Backward Compatibility for Cross-Database Ownership
Chaining" topic and "Using Ownership Chains" topic in SQL Books
Online(BOL).
Sophie Guo
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
========================================
=============
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.|||Thanks for the reply, Dan. Am I correct in saying that the only way to
enable extended stored procedures from a UDF/Stored-Procedure is to enable
chaining?
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> Cross-database chaining is off by default in SQL 2000 SP3+ so that you
don't
> inadvertently open a security hole. You should enable 'db chaining' in
your
> user database only if you fully understand the security implications.
> The main cross-database chaining consideration with an sa-owned user
> database is that only sysadmin role members should have permissions to
> create dbo-owned objects in that database. The DBA should scrutinize
> database objects to ensure that only the intended commands can be
executed.
> As long as you've locked-down the user database, you can leverage
> cross-database chaining to provide needed application functionality while
> preventing direct ad-hoc extended stored procedure execution.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Neil W." <neilw@.netlib.com> wrote in message
> news:e%23oF3H7EFHA.392@.TK2MSFTNGP14.phx.gbl...
permission[vbcol=seagreen]
all[vbcol=seagreen]
quite[vbcol=seagreen]
>|||> Am I correct in saying that the only way to
> enable extended stored procedures from a UDF/Stored-Procedure is to enable
> chaining?
Yes, assuming that you don't grant execute permissions on the extended
stored procedure.
Hope this helps.
Dan Guzman
SQL Server MVP
"Neil W." <neilw@.netlib.com> wrote in message
news:lrSQd.5118$SP4.4094@.fe11.lga...
> Thanks for the reply, Dan. Am I correct in saying that the only way to
> enable extended stored procedures from a UDF/Stored-Procedure is to enable
> chaining?
> --
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> don't
> your
> executed.
> permission
> all
> quite
>
>|||And the downside of granting execute permissions on the extended procedures
is that would enable users to execute them directly, correct?
Thanks. I wanted to make sure I understand/
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
enable[vbcol=seagreen]
> Yes, assuming that you don't grant execute permissions on the extended
> stored procedure.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Neil W." <neilw@.netlib.com> wrote in message
> news:lrSQd.5118$SP4.4094@.fe11.lga...
enable[vbcol=seagreen]
while[vbcol=seagreen]
the[vbcol=seagreen]
articles[vbcol=seagreen]
>|||Your understanding is correct.
Hope this helps.
Dan Guzman
SQL Server MVP
"Neil W." <neilw@.netlib.com> wrote in message
news:cxbRd.399$9K6.271@.fe08.lga...
> And the downside of granting execute permissions on the extended
> procedures
> is that would enable users to execute them directly, correct?
> Thanks. I wanted to make sure I understand/
> --
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> enable
> enable
> while
> the
> articles
>