2010
SQL Server 2005 | Add days, months and years to GetDate()
Fatal Error:get('adsPerSlot') in Admin Options don't exist (not an array)!
To get the current date in Sql Server queries and stored procedures, you use the GetDate() method. But what about to add a day or two to the current date, or add a month or years? To do it, you use the following query:
Add One Day
SELECT DateAdd(dd, 1, GetDate())
Add One Month Continue reading »
2010
SQL Server | Convert Varchar to UniqueIdentifier
Fatal Error:get('adsPerSlot') in Admin Options don't exist (not an array)!
There are 2 ways to Convert a string to a UniqueIdentifier (GUID) in SQL Server:
SELECT CAST(’449141d9-86c9-449d-be2c-1f171b4f4567′ as UNIQUEIDENTIFIER)
SELECT CONVERT(UNIQUEIDENTIFIER, ’449141d9-86c9-449d-be2c-1f171b4f4567′)
2010
SQL Server | Remove Special Characters
Fatal Error:get('adsPerSlot') in Admin Options don't exist (not an array)!
I needed to remove all the special characters from a field in a particular table in SQL Server to be used for searching purposes. After searching (binging
)… I found the next SQL Server Function which did the trick.
This Function Removes any special character from the string value passed. All characters except 0-9, a-z and A-Z are all removed, whilst the remaining characters are returned back.
ALTER FUNCTION dbo.RemoveSpecialCharacters
(
@s VARCHAR(256)
)
RETURNS VARCHAR(256) WITH SCHEMABINDING
BEGIN
IF (@s is null)
RETURN null Continue reading »
2010
SQL Server 2005 | Copy Database Diagrams
Fatal Error:get('adsPerSlot') in Admin Options don't exist (not an array)!
Next is the code to copy database diagrams from one database to another (tested on SQL Server 2005 and 2008)
use [DB_SOURCE_NAME]
DROP TABLE dbo.#tempsysdiagrams
–this will copy your database diagrams into a temporary table
select * into dbo.#tempsysdiagrams from sysdiagrams Continue reading »
Recent Posts
Favourite Links
Tags
Archives
- May 2012
- February 2012
- December 2011
- October 2011
- September 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- June 2010
- May 2010
- April 2010
- March 2010
- July 2009
- June 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- September 2008
- August 2008
- June 2008
- May 2008
- March 2008
- February 2008
- November 2007
- September 2007
- July 2007
- June 2007
- May 2007
- February 2007
- January 2007
- November 2006
- October 2006
Categories
- Android
- Apple
- ASP.Net
- Blackberry OS
- CMS
- Creative Computing
- Crystal Reports
- Day to Day
- Deep Design Malta
- Design and Development
- Development Tools
- Games
- Google Analytics
- Google Gmail
- Internet Explorer
- iPhone/3G
- iPod Touch
- JavaScript
- JQuery
- Microsoft
- Microsoft SQL Server
- Microsoft Visual Studio
- MS Office
- My Blog
- NetBeans
- Off Topic
- Online Services
- Permissions
- Phones and Tablets Platforms
- Project NINE
- PSP NGP
- Quickie
- SEO
- Silverlight For WP7
- Sitefinity
- Sony
- Uncategorized
- Utilities
- VB .Net
- Windows 7
- Windows 8
- Windows Live
- Windows Mobile
- Windows Phone 7
- Windows Vista
- Wordpress
- WP Apps
- Yellow Pages





