Sunday, March 25, 2012
Does Shrinkfile Emptyfile block users?
Is it done in small transactions?
Thanks
Paul
Can you point us to exactly where it stats that? A shrinkfile with or
without Emptyfile will lock the page or extent as it moves it from the back
of the file to the front or from file to file in the case of the empty file.
It should not hold that lock unless you wrapped it in your own transaction.
Andrew J. Kelly SQL MVP
"Paul Cahill" <xyzpaul.xyzcahill@.dsl.pipex.com> wrote in message
news:eLgLMZXiFHA.2644@.TK2MSFTNGP09.phx.gbl...
>I read BOL says this can be done online but will it generate blocks.
> Is it done in small transactions?
> Thanks
> Paul
>
|||Hi Andrew
As follows. If it does it page at a time I should be OK.
Thanks
Paul
DBCC SHRINKFILE
Shrinks the size of the specified data file or log file for the related
database
........
To remove any data that may be in a file, execute DBCC
SHRINKFILE('file_name', EMPTYFILE) before executing ALTER DATABASE.
The database being shrunk does not have to be in single-user mode; other
users can be working in the database when the file is shrunk. You do not
have to run SQL Server in single-user mode to shrink the system databases.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OeBukJYiFHA.500@.TK2MSFTNGP09.phx.gbl...
> Can you point us to exactly where it stats that? A shrinkfile with or
> without Emptyfile will lock the page or extent as it moves it from the
> back of the file to the front or from file to file in the case of the
> empty file. It should not hold that lock unless you wrapped it in your own
> transaction.
> --
> Andrew J. Kelly SQL MVP
>
> "Paul Cahill" <xyzpaul.xyzcahill@.dsl.pipex.com> wrote in message
> news:eLgLMZXiFHA.2644@.TK2MSFTNGP09.phx.gbl...
>
Does Shrinkfile Emptyfile block users?
Is it done in small transactions?
Thanks
PaulCan you point us to exactly where it stats that? A shrinkfile with or
without Emptyfile will lock the page or extent as it moves it from the back
of the file to the front or from file to file in the case of the empty file.
It should not hold that lock unless you wrapped it in your own transaction.
Andrew J. Kelly SQL MVP
"Paul Cahill" <xyzpaul.xyzcahill@.dsl.pipex.com> wrote in message
news:eLgLMZXiFHA.2644@.TK2MSFTNGP09.phx.gbl...
>I read BOL says this can be done online but will it generate blocks.
> Is it done in small transactions?
> Thanks
> Paul
>|||Hi Andrew
As follows. If it does it page at a time I should be OK.
Thanks
Paul
DBCC SHRINKFILE
Shrinks the size of the specified data file or log file for the related
database
.......
To remove any data that may be in a file, execute DBCC
SHRINKFILE('file_name', EMPTYFILE) before executing ALTER DATABASE.
The database being shrunk does not have to be in single-user mode; other
users can be working in the database when the file is shrunk. You do not
have to run SQL Server in single-user mode to shrink the system databases.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OeBukJYiFHA.500@.TK2MSFTNGP09.phx.gbl...
> Can you point us to exactly where it stats that? A shrinkfile with or
> without Emptyfile will lock the page or extent as it moves it from the
> back of the file to the front or from file to file in the case of the
> empty file. It should not hold that lock unless you wrapped it in your own
> transaction.
> --
> Andrew J. Kelly SQL MVP
>
> "Paul Cahill" <xyzpaul.xyzcahill@.dsl.pipex.com> wrote in message
> news:eLgLMZXiFHA.2644@.TK2MSFTNGP09.phx.gbl...
>
Thursday, March 22, 2012
Does Shrinkfile Emptyfile block users?
Is it done in small transactions?
Thanks
PaulCan you point us to exactly where it stats that? A shrinkfile with or
without Emptyfile will lock the page or extent as it moves it from the back
of the file to the front or from file to file in the case of the empty file.
It should not hold that lock unless you wrapped it in your own transaction.
--
Andrew J. Kelly SQL MVP
"Paul Cahill" <xyzpaul.xyzcahill@.dsl.pipex.com> wrote in message
news:eLgLMZXiFHA.2644@.TK2MSFTNGP09.phx.gbl...
>I read BOL says this can be done online but will it generate blocks.
> Is it done in small transactions?
> Thanks
> Paul
>|||Hi Andrew
As follows. If it does it page at a time I should be OK.
Thanks
Paul
DBCC SHRINKFILE
Shrinks the size of the specified data file or log file for the related
database
.......
To remove any data that may be in a file, execute DBCC
SHRINKFILE('file_name', EMPTYFILE) before executing ALTER DATABASE.
The database being shrunk does not have to be in single-user mode; other
users can be working in the database when the file is shrunk. You do not
have to run SQL Server in single-user mode to shrink the system databases.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OeBukJYiFHA.500@.TK2MSFTNGP09.phx.gbl...
> Can you point us to exactly where it stats that? A shrinkfile with or
> without Emptyfile will lock the page or extent as it moves it from the
> back of the file to the front or from file to file in the case of the
> empty file. It should not hold that lock unless you wrapped it in your own
> transaction.
> --
> Andrew J. Kelly SQL MVP
>
> "Paul Cahill" <xyzpaul.xyzcahill@.dsl.pipex.com> wrote in message
> news:eLgLMZXiFHA.2644@.TK2MSFTNGP09.phx.gbl...
>>I read BOL says this can be done online but will it generate blocks.
>> Is it done in small transactions?
>> Thanks
>> Paul
>>
>sql
Monday, March 19, 2012
Does MS have a glossary of terms?
There are several terms using ms Server that I don't know and cannot find in my books. Does MS provide that, besides BOL where it is difficult to find good explanations or even find definitions?
thx,
Kat
ps. would be a nice feature if they don't have it currently.
I don't know of any off the top of my head. Are there any particular ones that you are hitting? We could start the list if one doesn't already exist. :)
Thanks,
Sam Lester (MSFT)
Hi Sam,
I marked your answer as not helpful in case anyone else has another answer. I use Wikopedia right now but it isn't specific to MS Products. I'll start keeping a list. Some may be silly to others but I've been out for a couple years and am playing catchup. One that I posted already and believe I understand is:
Federated Servers vs
Horizontal Partitioning
Scan: this means reading the entire table? Row by row?
As I said, some of these are just easy but I will continue my list. When I look something up in a book's index, I expect a reference and they aren't always there...
thx,
Kat
|||
Hi Sam,
I will start my list. This may be something that could be posted in the beginner's forum. I'm playing catchup after 2 yrs off. Wikopedia helps but isn't specific to Microsoft products. Most books don't have glossaries with terms which would be so great to have. Makes reading a lot easier!
Federated Sever vs. Horizontal Partitioning
Scan: does this always mean reading a table row by row?
Sunday, February 19, 2012
Documented object name
I have been trying to gather information on the task log and have noted an inconsistency with the naming of an object within BOL 2005. Please have a look at the original post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=277667&SiteID=1
Forgot to mention, but I did have a look at the handels to find out which file was being access so that I could provide the filename and version but I couldn't find out exactely which one: (if you want, let me know which file it is so that I can send you the version)
C: File C:\Program Files\Common Files\Microsoft Shared\Help 8
10: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
A4: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
B0: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
B4: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.ATL_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_6e805841
C0: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
C4: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
CC: File C:\Program Files\Common Files\Microsoft Shared\Help 8\msenv.dll
EC: File C:\WINDOWS\SYSTEM32\STDOLE2.TLB
F4: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
178: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
27C: File C:\Program Files\Common Files\Microsoft Shared\MSEnv\dte80a.olb
4F0: File C:\Documents and Settings\All Users\Application Data\Microsoft Help\MS.SQLCC.v9_2057_MValidator.HxD
504: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.ATL_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_6e805841\ATL80.dll
50C: File C:\Documents and Settings\All Users\Application Data\Microsoft Help\MS.SQLCC.v9_2057_MKWD_K.HxW
520: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
584: File C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\security.config.cch
588: File C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\enterprisesec.config.cch
5D0: File C:\WINDOWS\ASSEMBLY\NativeImages_v2.0.50727_32\index108.dat
5EC: File C:\WINDOWS\ASSEMBLY\pubpol1.dat
5F8: File C:\Program Files\Common Files\Microsoft Shared\Help 8\Microsoft.WizardFrameworkVS.dll
604: File C:\Program Files\Common Files\Microsoft Shared\Help 8\Microsoft.WizardFramework.dll
614: File C:\WINDOWS\ASSEMBLY\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\sorttbls.nlp
61C: File C:\WINDOWS\ASSEMBLY\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\sortkey.nlp
624: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.2600.2180_x-ww_522f9f82
694: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
6AC: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
6B4: File C:\WINDOWS\ASSEMBLY\GAC_MSIL\Microsoft.VisualStudio.CommonIDE\8.0.0.0__b03f5f7f11d50a3a\microsoft.visualstudio.commonide.dll
6C8: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
6D0: File C:\WINDOWS\ASSEMBLY\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\ksc.nlp
6D4: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
6D8: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
6E4: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
6E8: File C:\WINDOWS\ASSEMBLY\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\xjis.nlp
6F8: File C:\WINDOWS\ASSEMBLY\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\big5.nlp
704: File C:\WINDOWS\ASSEMBLY\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\prcp.nlp
714: File C:\Documents and Settings\All Users\Application Data\Microsoft Help\MS.SQLCC.v9_2057_MKWD_F.HxW
72C: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\sqlcc9.HxS
730: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\colsql9.HxS
74C: File C:\Documents and Settings\All Users\Application Data\Microsoft Help\MS.SQLCC.v9_2057_MTOC_SQLCC.HxH
760: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\sqltut9.HxS
764: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\ssmport3.HxS
768: File C:\Program Files\Common Files\Microsoft Shared\Help 8\1033\dv_dexplore.hxs
770: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
7B0: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
818: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
820: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
850: File C:\WINDOWS\SYSTEM32\MSHTML.TLB
858: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
8BC: File C:\WINDOWS\SYSTEM32\DXTMSFT.DLL
8C4: File C:\WINDOWS\SYSTEM32\dxtrans.dll
940: File C:\WINDOWS\SYSTEM32\iepeers.dll
9F4: File C:\Documents and Settings\All Users\Application Data\Microsoft Help\MS.SQLCC.v9_2057_MValidator.HxD
A14: File C:\Program Files\Common Files\Microsoft Shared\Help 8\1033\dexplore.hxq
A24: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\sql90.hxq
A54: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\ssm3.hxq
B00: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
C60: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\udb9.HxS
Hello - I think there is a doc bug opened on this, so you should see a correction in either the next release of BOL or the refresh after that. The delay has to do with the time it takes for technical review and translations into the 9 or so languages for BOL.
Thanks for the catch!
Buck Woody
|||Thanks Buck, I don't envy the task of translating and verifying everything in BOL .
Many thanks
Max
Documented object name
I have been trying to gather information on the task log and have noted an inconsistency with the naming of an object within BOL 2005. Please have a look at the original post: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=277667&SiteID=1
Forgot to mention, but I did have a look at the handels to find out which file was being access so that I could provide the filename and version but I couldn't find out exactely which one: (if you want, let me know which file it is so that I can send you the version)
C: File C:\Program Files\Common Files\Microsoft Shared\Help 8
10: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
A4: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
B0: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
B4: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.ATL_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_6e805841
C0: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
C4: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
CC: File C:\Program Files\Common Files\Microsoft Shared\Help 8\msenv.dll
EC: File C:\WINDOWS\SYSTEM32\STDOLE2.TLB
F4: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
178: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
27C: File C:\Program Files\Common Files\Microsoft Shared\MSEnv\dte80a.olb
4F0: File C:\Documents and Settings\All Users\Application Data\Microsoft Help\MS.SQLCC.v9_2057_MValidator.HxD
504: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.ATL_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_6e805841\ATL80.dll
50C: File C:\Documents and Settings\All Users\Application Data\Microsoft Help\MS.SQLCC.v9_2057_MKWD_K.HxW
520: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
584: File C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\security.config.cch
588: File C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\enterprisesec.config.cch
5D0: File C:\WINDOWS\ASSEMBLY\NativeImages_v2.0.50727_32\index108.dat
5EC: File C:\WINDOWS\ASSEMBLY\pubpol1.dat
5F8: File C:\Program Files\Common Files\Microsoft Shared\Help 8\Microsoft.WizardFrameworkVS.dll
604: File C:\Program Files\Common Files\Microsoft Shared\Help 8\Microsoft.WizardFramework.dll
614: File C:\WINDOWS\ASSEMBLY\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\sorttbls.nlp
61C: File C:\WINDOWS\ASSEMBLY\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\sortkey.nlp
624: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.2600.2180_x-ww_522f9f82
694: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
6AC: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
6B4: File C:\WINDOWS\ASSEMBLY\GAC_MSIL\Microsoft.VisualStudio.CommonIDE\8.0.0.0__b03f5f7f11d50a3a\microsoft.visualstudio.commonide.dll
6C8: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
6D0: File C:\WINDOWS\ASSEMBLY\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\ksc.nlp
6D4: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
6D8: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
6E4: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
6E8: File C:\WINDOWS\ASSEMBLY\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\xjis.nlp
6F8: File C:\WINDOWS\ASSEMBLY\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\big5.nlp
704: File C:\WINDOWS\ASSEMBLY\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\prcp.nlp
714: File C:\Documents and Settings\All Users\Application Data\Microsoft Help\MS.SQLCC.v9_2057_MKWD_F.HxW
72C: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\sqlcc9.HxS
730: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\colsql9.HxS
74C: File C:\Documents and Settings\All Users\Application Data\Microsoft Help\MS.SQLCC.v9_2057_MTOC_SQLCC.HxH
760: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\sqltut9.HxS
764: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\ssmport3.HxS
768: File C:\Program Files\Common Files\Microsoft Shared\Help 8\1033\dv_dexplore.hxs
770: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
7B0: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
818: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
820: File C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd
850: File C:\WINDOWS\SYSTEM32\MSHTML.TLB
858: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
8BC: File C:\WINDOWS\SYSTEM32\DXTMSFT.DLL
8C4: File C:\WINDOWS\SYSTEM32\dxtrans.dll
940: File C:\WINDOWS\SYSTEM32\iepeers.dll
9F4: File C:\Documents and Settings\All Users\Application Data\Microsoft Help\MS.SQLCC.v9_2057_MValidator.HxD
A14: File C:\Program Files\Common Files\Microsoft Shared\Help 8\1033\dexplore.hxq
A24: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\sql90.hxq
A54: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\ssm3.hxq
B00: File C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9
C60: File C:\Program Files\Microsoft SQL Server\90\Tools\Books\1033\udb9.HxS
Hello - I think there is a doc bug opened on this, so you should see a correction in either the next release of BOL or the refresh after that. The delay has to do with the time it takes for technical review and translations into the 9 or so languages for BOL.
Thanks for the catch!
Buck Woody
|||Thanks Buck, I don't envy the task of translating and verifying everything in BOL .
Many thanks
Max
documentation on SQL OLE methods...Where to find?
used to generates scripts, return rows, etc. For example:
SET @.exec_str = 'Databases("'+@.dbname+'").Tables("'+RTRIM(UPPER(@.tbname))+'").Script(74077,"
'+ @.filename +'")'
EXEC @.hr = sp_OAMethod @.object, @.exec_str, @.return OUT
I can't seem to find any documentation that explains the possible methods
(like databases().Tables().Script).
Can someone point me to where I could find a list of these methods?
Thanks in advancesp_OACreate invokes an extermal program that has a COM OO interface.
The documentation you're looking for will reside with whichever external COM
application you're referring to.
You haevn't given us the name of the particular application you're looking
for in your post, so it's a bit hard to answer this. Your post only gives us
information on a method - perhaps if you go back to whever you got that code
snippet from & give us the part that has "sp_OACreate" in it, we may be able
to help you further.
Regards,
Greg Linwood
SQL Server MVP
"TJTODD" <Thxomasx.Toddy@.Siemensx.com> wrote in message
news:#$OwJjrsDHA.1680@.TK2MSFTNGP12.phx.gbl...
> I've seen a few examples in BOL and various websites where sp_OAMethod is
> used to generates scripts, return rows, etc. For example:
> SET @.exec_str =>
'Databases("'+@.dbname+'").Tables("'+RTRIM(UPPER(@.tbname))+'").Script(74077,"
> '+ @.filename +'")'
> EXEC @.hr = sp_OAMethod @.object, @.exec_str, @.return OUT
> I can't seem to find any documentation that explains the possible methods
> (like databases().Tables().Script).
> Can someone point me to where I could find a list of these methods?
> Thanks in advance
>|||Hi Greg,
Thanks for the reply. Here's the sp_OACreate statement:
EXEC @.hr = sp_OACreate 'SQLDMO.SQLServer', @.object OUT
Thanks,
Tom
"Greg Linwood" <g_linwoodremovethisbeforeemailingme@.hotmail.com> wrote in
message news:uIDLvwrsDHA.2416@.TK2MSFTNGP10.phx.gbl...
> sp_OACreate invokes an extermal program that has a COM OO interface.
> The documentation you're looking for will reside with whichever external
COM
> application you're referring to.
> You haevn't given us the name of the particular application you're looking
> for in your post, so it's a bit hard to answer this. Your post only gives
us
> information on a method - perhaps if you go back to whever you got that
code
> snippet from & give us the part that has "sp_OACreate" in it, we may be
able
> to help you further.
> Regards,
> Greg Linwood
> SQL Server MVP
> "TJTODD" <Thxomasx.Toddy@.Siemensx.com> wrote in message
> news:#$OwJjrsDHA.1680@.TK2MSFTNGP12.phx.gbl...
> > I've seen a few examples in BOL and various websites where sp_OAMethod
is
> > used to generates scripts, return rows, etc. For example:
> > SET @.exec_str => >
>
'Databases("'+@.dbname+'").Tables("'+RTRIM(UPPER(@.tbname))+'").Script(74077,"
> > '+ @.filename +'")'
> > EXEC @.hr = sp_OAMethod @.object, @.exec_str, @.return OUT
> >
> > I can't seem to find any documentation that explains the possible
methods
> > (like databases().Tables().Script).
> >
> > Can someone point me to where I could find a list of these methods?
> >
> > Thanks in advance
> >
> >
>|||Most COM (or Automation) objects come with their own
documentation. For instance, the object hierarchy of SQL-
DMO can be found in SQL Server Books Online. If you need
to interact with an object hierarchy that doesn't seem to
have online/printed documentation, you can try tools such
as OLE-COM Object Viewer that comes with NT Resource kit.
The object viewer allows you browse the object hierarchy
and see all the objects, methods, and proerties.
By the way, if you can stay away from sp_OAxxx stuff, stay
away from it. It's pretty ugly and you can't import the
symbolic constants.
Linchi
>--Original Message--
>I've seen a few examples in BOL and various websites
where sp_OAMethod is
>used to generates scripts, return rows, etc. For example:
>SET @.exec_str =>'Databases("'+@.dbname+'").Tables("'+RTRIM(UPPER(@.tbname))
+'").Script(74077,"
>'+ @.filename +'")'
>EXEC @.hr = sp_OAMethod @.object, @.exec_str, @.return OUT
>I can't seem to find any documentation that explains the
possible methods
>(like databases().Tables().Script).
>Can someone point me to where I could find a list of
these methods?
>Thanks in advance
>
>.
>
Tuesday, February 14, 2012
Do While Loop in T-SQL?
syntax in BOL for doing this. Essentially, I want to always run the the =
loop once, then check the loop expression to see if I can exit. In VB =
it would look something like this
Do
..
Loop While(something < 5)
Thanks,
--MichaelWhile (something < 5)
Begin
..do stuff
End
HTH
Thomas
"Raterus" <raterus@.hotmail.com> wrote in message
news:uf9oXJSRFHA.2932@.TK2MSFTNGP09.phx.gbl...
Is there a way to construct a Do While Loop in T-SQL. I didn't see any synt
ax
in BOL for doing this. Essentially, I want to always run the the loop once,
then check the loop expression to see if I can exit. In VB it would look
something like this
Do
..
Loop While(something < 5)
Thanks,
--Michael|||Let me be a bit more descriptive, "something" is set from within the =
loop. What I'm trying to avoid is having to set "Something" before the =
loop, and also in the loop, repeating the exact same syntax. A normal =
While loop won't work without duplicating the code from within the loop.
Do
Something =3D GetSomething()
DoSomething(Something)
Loop While (Something < 5)
"Thomas" <replyingroup@.anywhere.com> wrote in message =
news:OWtdcLSRFHA.2356@.TK2MSFTNGP14.phx.gbl...
> While (something < 5)
> Begin
> ...do stuff
> End
>=20
>=20
> HTH
>=20
>=20
> Thomas
>=20
>=20
> "Raterus" <raterus@.hotmail.com> wrote in message=20
> news:uf9oXJSRFHA.2932@.TK2MSFTNGP09.phx.gbl...
> Is there a way to construct a Do While Loop in T-SQL. I didn't see =
any syntax=20
> in BOL for doing this. Essentially, I want to always run the the loop =
once,=20
> then check the loop expression to see if I can exit. In VB it would =
look=20
> something like this
>=20
> Do
> ...
> Loop While(something < 5)
>=20
> Thanks,
> --Michael=20
>=20
>|||That's not the same as a do/while loop - with a do/while loop (as shown, or
in the C languages) the code in the loop runs at least once. A couple option
s:
1. Change your condition so it will always be true the first time; to
continue your example:
WHILE (something < 6) BEGIN ... END
2. Move the condition to an IF statement at the end of the loop:
WHILE (1=1)
BEGIN
-- code...
IF (something = 5) BREAK
END
3. Use a GOTO statement:
_LOOP:
-- ... CODE
IF (something < 5) GOTO _LOOP
"Thomas" wrote:
> While (something < 5)
> Begin
> ...do stuff
> End
>
> HTH
>
> Thomas
>
> "Raterus" <raterus@.hotmail.com> wrote in message
> news:uf9oXJSRFHA.2932@.TK2MSFTNGP09.phx.gbl...
> Is there a way to construct a Do While Loop in T-SQL. I didn't see any sy
ntax
> in BOL for doing this. Essentially, I want to always run the the loop onc
e,
> then check the loop expression to see if I can exit. In VB it would look
> something like this
> Do
> ...
> Loop While(something < 5)
> Thanks,
> --Michael
>
>|||That's an odd design pattern - declaring the variable for the exit condition
within the loop. If both GetSomething() and DoSomething(Something) are
deterministic then the condition will either always be false in which case
there's no reason to have it, or always be true in which case the loop will
never exit.
"Raterus" wrote:
> Let me be a bit more descriptive, "something" is set from within the loop. What I
'm trying to avoid is having to set "Something" before the loop, and also in the loo
p, repeating the exact same syntax. A normal While loop won't work without duplicat
ing
the code from within the loop.
> Do
> Something = GetSomething()
> DoSomething(Something)
> Loop While (Something < 5)
> "Thomas" <replyingroup@.anywhere.com> wrote in message news:OWtdcLSRFHA.235
6@.TK2MSFTNGP14.phx.gbl...
>|||Just an example off the top of my head, can't say it makes any sense to =
me either, the main thing I wanted was a loop that runs at least once.
"KH" <KH@.discussions.microsoft.com> wrote in message =
news:0DF4A1CF-94E9-4839-8624-DE769BCAE747@.microsoft.com...
> That's an odd design pattern - declaring the variable for the exit =
condition=20
> within the loop. If both GetSomething() and DoSomething(Something) are =
> deterministic then the condition will either always be false in which =
case=20
> there's no reason to have it, or always be true in which case the loop =
will=20
> never exit.=20
>=20
>=20
> "Raterus" wrote:
>=20
loop. What I'm trying to avoid is having to set "Something" before the =
loop, and also in the loop, repeating the exact same syntax. A normal =
While loop won't work without duplicating the code from within the loop.
news:OWtdcLSRFHA.2356@.TK2MSFTNGP14.phx.gbl...
any syntax=20
loop once,=20
would look=20|||Thanks, I had always "hacked" around it using methods like this. Just =
wanted to make sure I wasn't missing anything syntactically.
"KH" <KH@.discussions.microsoft.com> wrote in message =
news:0C77E8A0-3E6D-4C1D-A339-2040364DE56B@.microsoft.com...
> That's not the same as a do/while loop - with a do/while loop (as =
shown, or=20
> in the C languages) the code in the loop runs at least once. A couple =
options:
>=20
> 1. Change your condition so it will always be true the first time; to=20
> continue your example:
> WHILE (something < 6) BEGIN ... END
>=20
> 2. Move the condition to an IF statement at the end of the loop:
> WHILE (1=3D1)
> BEGIN
> -- code...
> IF (something =3D 5) BREAK
> END
>=20
> 3. Use a GOTO statement:
>=20
> _LOOP:
> -- ... CODE
> IF (something < 5) GOTO _LOOP
>=20
>=20
>=20
> "Thomas" wrote:
>=20
any syntax=20
loop once,=20
look=20|||Declare @.Done TinyInt Set @.Done = 0
While @.Done = 0 Begin
-- Do some work here
If GetSomething() = 'done' Set @.Done =1
End
"Raterus" wrote:
> Just an example off the top of my head, can't say it makes any sense to me
either, the main thing I wanted was a loop that runs at least once.
> "KH" <KH@.discussions.microsoft.com> wrote in message news:0DF4A1CF-94E9-48
39-8624-DE769BCAE747@.microsoft.com...
ing the code from within the loop.
>