I'm not an every day SQL Server user but I use SQL Server regularly since 7.0 version until the 2005 version (not yet tried 2008 in a serious way) and from time to time I still find some nice hidden gems. A few days ago I needed to created a cleanup script for an application and one of the tasks was to drop all tables that match a specific name pattern. My first thought was to use a cursor to loop or a dynamic SQL statement ... ... but this time I decided to google for some other approach, and I found the amazing undocumented sp_MSforeachtable stored procedure from the master database. It does the same but it requires considerably less code and improves the script readability. Below is the syntax for calling the sp_MSforeachtable SP: [more...(read more) I'm not an every day SQL Server user but I use SQL Server regularly since 7.0 version until the 2005 version (not yet tried 2008 in a serious way) and from time to time I still find some nice hidden gems. A few days ago I needed to created a cleanup script for an application and one of the tasks was to drop all tables that match a specific name pattern. My first thought was to use a cursor to loop or a dynamic SQL statement ... ... but this time I decided to google for some other approach, and I found the amazing undocumented sp_MSforeachtable stored procedure from the master database. It does the same but it requires considerably less code and improves the script readability. Below is the syntax for calling the sp_MSforeachtable SP: [more...(read more) Joshua Stengel (800) 877-1461 x4432(303) 365-4432From: "Corrections Community: LJN" [mailto:forum-ljn@nicic.gov] Sent: Tuesday, August 19, 2008 10:25 AMTo: Joshua StengelSubject: RE: New Forum TestClick here if this message is not displaying properly.National Institute of CorrectionsCorrections Community Email Alert Sent To: LJN TestPosted By: Joshua StengelSubject:RE: New Forum TestI'm not anevery day SQL Server user but I use SQL Server regularly since 7.0 versionuntil the 2005 version (not yet tried 2008 in a serious way) and from time totime I still find some nice hidden gems. A few days ago I needed to created acleanup script for an application and one of the tasks was to drop all tablesthat match a specific name pattern. My first thought was to use a cursor toloop or a dynamic SQL statement ... ... but this time I decided to google forsome other approach, and I found the amazing undocumented sp_MSforeachtablestored procedure from the master database. It does the same but it requiresconsiderably less code and improves the script readability. Below is the syntaxfor calling the sp_MSforeachtable SP: [more...(readmore)Error! Filename not specified. I'm not anevery day SQL Server user but I use SQL Server regularly since 7.0 versionuntil the 2005 version (not yet tried 2008 in a serious way) and from time totime I still find some nice hidden gems. A few days ago I needed to created acleanup script for an application and one of the tasks was to drop all tablesthat match a specific name pattern. My first thought was to use a cursor toloop or a dynamic SQL statement ... ... but this time I decided to google forsome other approach, and I found the amazing undocumented sp_MSforeachtablestored procedure from the master database. It does the same but it requiresconsiderably less code and improves the script readability. Below is the syntaxfor calling the sp_MSforeachtable SP: [more...(readmore)Error! Filename not specified. JoshuaStengel (800) 877-1461 x4432(303) 365-4432 From: "CorrectionsCommunity: LJN" [mailto:forum-ljn@nicic.gov] Sent: Tuesday, August 19, 2008 10:23 AMTo: Joshua StengelSubject: New Forum Test Click here if this message is notdisplaying properly.National Institute of CorrectionsCorrections Community Email Alert Sent To: LJN TestPosted By: Joshua StengelSubject:New Forum Testtest Joshua Stengel, Web Services ManagerNIC, Information Center(800) 877-1461 x4432(303) 365-4432Error! Filename not specified. View Discussion OnlineHavingtrouble signing in, replying to this message, or accessing your account? Hereare some helpful tips:• Are you using the correct sign in name and password? Click here reset your password or look up your account. If you get an "Access Denied" message, make sure you are signed in. • Still having trouble? Email CommunitySupport@nicic.org.________________________________________Youwere sent this email because you opted to receive email notifications whensomeone responded to this thread. To unsubscribe: • Go here and disable your email subscription for this thread. Manage your forum subscriptions here. • Configure your email settings for your account here. View Discussion OnlineHaving trouble signing in, replying to this message, or accessing your account? Here are some helpful tips:• Are you using the correct sign in name and password? Click here reset your password or look up your account. If you get an "Access Denied" message, make sure you are signed in. • Still having trouble? Email CommunitySupport@nicic.org.________________________________________You were sent this email because you opted to receive email notifications when someone responded to this thread. To unsubscribe: • Go here and disable your email subscription for this thread. Manage your forum subscriptions here. • Configure your email settings for your account here.
Community Administrator
National Institute of Corrections
(303) 365-4432 - Office