SQL SERVER - Get Date Time in Any Format - UDF - User Defined Functions
One of the reader Nanda of SQLAuthority.com has posted very detailed script of converting any date time in desired format. I suggest every reader of this blog to save this script in your permanent code bookmark and use it when you need it.Refer the function and get familiar yourself with different ......
New SQL Server User Group in Orange County - First Meeting on 8/14/2008
For all my Orange County readers you might be excited to know that you now have another great option for getting your SQL content. Reza Madani is starting a new Orange County SQL Server Users Group and their first meeting is this Thursday, August 14th. Plus, they are bringing in a heav......
SQL Injection Attacks on the Rise
According to security researcher MessageLabs, the number of SQL injection attacks spiked sharply last month, helping account for a near doubling of the number of malicious Web sites it identified and blocked each day....Did you know that DotNetSlackers also publishes .net articles written by top kn......
Visual Studio 2008 Service Pack 1 and .NET Framework 3.5 Service Pack 1 Released!
Finally Visual Studio 2008 Service Pack 1 is out! What does it fix? From Microsoft: Improved WPF designers SQL Server 2008 support ADO.NET Entity Designer Visual Basic and Visual C++ components and tools (including an MFC-based Office 2007 style Ribbon) Visual Studio Team System......
SQL Injection in Classic ASP and Possible Solutions
Nowadays, SQL injection is a big threat for websites. It is a technique by which hackers can execute dangerous SQL commands by taking advantage of un-sanitized input opportunities in web application. While there is a good amount of best practices to prevent SQL injection in ASP.NET, ASP has very l......
SQLAuthority News - Microsoft SQL Server 2008 Books Online - BOL - English
SQL Server 2008, the latest release of Microsoft SQL Server, provides a comprehensive data platform. Books Online is the primary documentation for SQL Server 2008. The Help viewer used by Books Online requires the Microsoft .NET Framework version 2.0.Books Online includes the following types of inf......
SQLAuthority News - SQL Server 2008 Pricing and Licensing
SQL Server licensing and pricing are to intervined subjects and very important. I strongly suggest to use properly licensed SQL Server in any production environment. The concept of licensing can be confusing sometime to new administrators. If there is any confusion one should read following documen......
SQLAuthority News - SQL Server 2008 Downloads Availables
SQL Server Compact 3.5 SP1 for Windows MobileSQL Server Compact 3.5 SP1 for devices Windows Installer (MSI) file contains the CAB files and the DLLs for installing SQL Server Compact 3.5 SP1 on the Windows mobile devices.SQL Server Compact 3.5 SP1 and Synchronization Services for ADO.NET v1.0 SP1 f......
VS2008 SP1 and NetFX3.5 SP1 Released (Adam Braden)
Today we shipped Service Pack 1 (SP1) for both Visual Studio 2008 and the .Net Framework 3.5. This is the first time weve release both a VS SP and a .NetFramework SP at the same time! Additionally, we released ENU, JPN and 8 additional languages that ship with SQL 2008 at the same time!......
End Parentheses Price Quote Stripper
This was made to change non-decimal prices at the end of a huge SQL Insert... To use to replace in DW (without quotes) use sub expression like: $2,$4)Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categori......
SQL SERVER - 2008 - Download and Install Samples Database AdventureWorks 2005 - Detail Tutorial
Just a day ago I received question from reader who just installed SQL Server 2008. After installation user did not find any samples database along with installation. User want to install samples database which he is very much used to.Sample database are now moved to Microsoft’s opensource site of C......
Channel 9 Interview: SQL 2008 & Occasionally Connected Client Support in Visual Studio SP1 (Beth Massi)
I just posted a new Channel 9 interview with Milind Lele, a PM on the VS Pro Tools team. In this interview Milind shows us the improvements made to the tooling in Visual Studio SP1 for occasionally connected clients as well as the new data type support for SQL Server 2008.
Using SQL 2008 built-in ......
SQL SERVER - Fix : Error : 1326 Cannot connect to Database Server Error: 40 - Could not open a connection to SQL Server
If you are receiving following error:TITLE: Connect to Server——————————Cannot connect to Database Server.——————————ADDITIONAL INFORMATION:An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the de......
SQL 2008 Requiring VS 2008 SP1 - KB article explaining the whole thing
Here's a KB article explaining clearly the SQL 2008 won't install unless VS 2008 SP1 situation:
http://support.microsoft.com/kb/956139...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including ......
SQL SERVER - 2008 - Released To Manufacturing Available
Microsoft has Released To Manufacturing available for SQL Server 2008. Released To Manufacturing (RTM) means that code of SQL Server 2008 has been approved by MS team and it is being send to manufacture. It will be while before it is available on distribute media on store shelves.Currently it is av......
SQL SERVER - EXCEPT Clause in SQL Server is Similar to MINUS Clause in Oracle
One of the JR. Developer asked me a day ago, does SQL Server has similar operation like MINUS clause in Oracle.Absolutely, EXCEPT clause in SQL Server is exactly similar to MINUS operation in Oracle. The EXCEPT query and MINUS query returns all rows in the first query that are not returned in the s......
SQL Server 2008 requires VS 2008 SP1
If your installing SQL Server 2008 on a box that already has Visual Studio 20008 pre SP1, you need to apply VS 2008 SP1 before installing. If not, you'll get this message:
VS 2008 SP1 should be available in a few days.
Thanks to Andrew Brust for pointing this out....Did you know that DotNetS......
SQL Server 2008 RTM Is Here!
That's right! For those of you who have been looking forward to the RTM, the wait is over: SQL Server 2008 has finally been released. It's already available on MSDN. If you haven't played with the new version yet, there are plenty of resources to help you get started. Check out some of these videos......
SQL SERVER - Query to Find Column From All Tables of Database
One question came up just a day ago while I was writing SQL SERVER - 2005 - Difference Between INTERSECT and INNER JOIN - INTERSECT vs. INNER JOIN.How many tables in database AdventureWorks have column name like ‘EmployeeID’?It was quite an interesting question and I thought if there are scripts wh......
SQL SERVER - 2005 - Get Field Name and Type of Database Table
In today’s article we will see question of one of reader Mohan and answer from expert Imran Mohammed. Imran thank you for answering question of Mohan.Question of Mohan:hi all,how can i get field name and type etc. in MS-SQL server 2005. is there any query available???Answer from Imran Mohammed:@mo......
Want to access SQL Server 2005 from PHP?
You are in luck! Version 1.0 RTM of the SQL Server 2005 Driver for PHP is live! Check out the SQLPHP blog for more details: http://blogs.msdn.com/sqlphp/archive/2008/07/28/microsoft-sql-server-2005-driver-for-php-v1-0-has-released.aspx -Marc Technorati Tags: sql server 2005,php...Did......
SQL SERVER - 2005 - Difference Between INTERSECT and INNER JOIN - INTERSECT vs. INNER JOIN
INTERSECT operator in SQL Server 2005 is used to retrieve the common records from both the left and the right query of the Intersect Operator. INTERSECT operator returns almost same results as INNER JOIN clause many times.When using INTERSECT operator the number and the order of the columns must be......
SQL SERVER - Effect of Order of Join In Query
Let us try to understand this subject with example.We will use Adventurworks database for this purpose. Table which we will be using are HumanResources.Employee (290 rows), HumanResources.EmployeeDepartmentHistory (296 rows) and HumanResources.Department (16 rows).We will be running following two q......
SQL SERVER - 2008 - Get Current System Date Time
How to get current system date time in SQL Server?First thing which comes to many users is using following script.SELECT GETDATE() AS CurrentDateTimeAbove method is not the only method to retrieve the current system date time for SQL Server. SQL Server 2008 has many different function which provide......
SQL SERVER - 2008 - Find Current System Date Time and Time Offset
If you want to find current datetime in SQL Server I suggest to read the following post :SQL SERVER - Retrieve Current Date Time in SQL Server CURRENT_TIMESTAMP, GETDATE(), {fn NOW()}This post is related to new feature available in SQL Server 2008. In SQL Server 2008 there is a function which provi......
SQL SERVER - SQL SERVER - Simple Example of Recursive CTE - Part 2 - MAXRECURSION - Prevent CTE Infinite Loop
Yesterday I wrote about SQL SERVER - SQL SERVER - Simple Example of Recursive CTE. I right away received email from regular reader John Mildred that if I can prevent infinite recursion of CTE.Sure! recursion can be limited. Use the option of MAXRECURSION.USE AdventureWorksGOWITH Emp_CTE AS (SELECT ......
SQL SERVER - Simple Example of Recursive CTE
Recursive is the process in which the query executes itself. It is used to get results based on the output of base query. We can use CTE as Recursive CTE (Common Table Expression). You can read my previous articles about CTE by searching at http://search.SQLAuthority.com .Here, the result of CTE is......
SQL SERVER - mssqlsystemresource - Resource Database
Just a day ago I received following email“Dear Pinal,While I was exploring my computer in directory C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data I have found database mssqlsystemresource. What is mssqlsystemresource?Thanks,Joseph Kazeka”Simple question like this are very interesting. ms......
Entity SQL Shortcut
I learned a neat ESQL trick from Danny
Simmons today.
The most basic Entity SQL expression is one that would simply query for a single entity
with no filters, no projection etc.
context.CreateQuery<Customer>("SELECT VALUE con FROM MYEntityContainer.Contacts
AS con")
You can a......
SQL SERVER - DBCC SHRINKFILE Takes Long Time to Run
If you are DBA who are involved with Database Maintenance and file group maintenance, you must have experience that many times DBCC SHRINKFILE operations takes long time but any other operations with Database are relative quicker. Rebuilding index is quite resource intensive task but that happens f......
Investigating SQL Server 2008 Wait Events with XEVENTS
Some reasons for the slow-running of database applications aren't obvious. Occasionally, even the profiler won't tell you enough to remedy a problem, especially when a SQL Statement is being forced to wait.
Now, in SQL Server 2008, come XEvents, which allow you to look at those wait events that ar......
SQL SERVER - 2005 -Track Down Active Transactions Using T-SQL
Just a day ago, I was wondering how many active transaction are currently in my database. I found following DMV very useful - very simple and to the point.Following SQL will return currently active transaction.SELECT * FROM sys.dm_tran_session_transactions Reference : Pinal Dave (http://www.SQLAuth......
SQL SERVER - Track Down Active Transactions Using T-SQL
Just a day ago, I was wondering how many active transaction are currently in my database. I found following DMV very useful - very simple and to the point.Following SQL will return currently active transaction.SELECT * FROM sys.dm_tran_session_transactions Reference : Pinal Dave (http://www.SQLAuth......
LINQ to SQL Dynamic Mapping
The problemYou have SQL Servers for each of your environments (development, test, pre-prod, production) and in each one, the table names are different. In fact, its not the table names that are different but the schema names but since the schema name is part of the table name, it must be spec......
SQL SERVER - Introduction to Log Viewer
SQL Server log data is very important for any DBA to troubleshoot SQL Server related problems. In SQL Server 2000 there was no facility to check System and Application log, however in SQL Server 2005 there is facility of the log viewer. It is very useful tool and very easy to use as well.In SQL [........
SQL SERVER - Clear SQL Server Memory Caches
If SQL Server is running slow and operations are throwing errors due to lack of memory, it is necessary to look into memory issue. If SQL Server is restarted all the cache memory is automatically cleaned up. In production server it is not possible to restart the server. In this scenario following t......
Compare To Backup in SQL Compare
Retrieving a build script from a backup, or synchronising a database schema with the version in a backup is a time-consuming chore. Well, it is'nt now, if you use SQL Compare 7. SQL Compare 7 now allows you to compare your database schema with a backup as well as another database. It was an interes......
SQLAuthority Author Visit - Ahmedabad SQL Server User Group Meeting - July 19 2008
Ahmedabad SQL Server User Group is just 2 months old chapter but it is getting extremely popular among enthusiastic IT professionals. I have joined this group and suggest all the developers of Ahmedabad and surrounding areas to join this group. It does not matter which application you are using but......
SQL SERVER - Change the Port of Service Broker Configuration
Just two day ago, I wrote small note about SQL SERVER - Introduction to Service Broker.Yesterday I wrote article where Service Broker throws error due to it is using same port as other application SQL Server - Fix - Error : 9692 The _MSG protocol transport cannot listen on port because it is in use......
SQL Server - Fix - Error : 9692 The _MSG protocol transport cannot listen on port because it is in use by another process.
If you face following error the solution of this is very simple.Error : 9692 The _MSG protocol transport cannot listen on port because it is in use by another process.Above error comes up with Service Broker. Service Broker is used to send Database Emails. Read more about SQL SERVER - Introduction ......
SCREENCAST: Rendering Polygons from SQL Server 2008 on Virtual Earth
In this screencast, I build off of the concepts shown in my previous screencast and show you how to render a polygon on a Virtual Earth map using REST, Windows Communication Foundation (WCF), LINQ to SQL, and the new geography data type in SQL Server 2008. To learn more about the GeoRSS utility li......
SCREENCAST: Saving Virtual Earth Polygons to SQL Server 2008
In this screencast, I show you how to draw a polygon on a Virtual Earth map and save it using ASP.NET AJAX, Windows Communication Foundation (WCF), LINQ to SQL, and the new geography data type in SQL Server 2008. Screencast: http://channel9.msdn.com/posts/keydet/Saving-Virtual-Earth-Polygons-to-......
SQL SERVER - Introduction to Service Broker
Service Broker is message queuing for SQL Server. It is used for sending emails and through Database Mails. You can read about SQL SERVER - Difference Between Database Mail and SQLMail here. Service Broker is feature which provides facility to SQL Server to send an asynchronous, transactional messa......
Maximum performance using Telerik RadGrid client-side data-binding with LINQ to SQL
As I mentioned in one of my previous posts with RadGrid for ASP.NET AJAX Q2 2008 you can access the grid sort and filter expressions on the client.
While filter expressions toString() method will create SQL syntax representing current grid filtering now you have toDynamicLinq() method which will cr......
SQLAuthority News - Ahmedabad SQL Server Usergroup Meeting
I will be attending Ahmedabad SQL Server Usergroup Meeting on July 19, 2008. I will be taking session about “SQL Server Best Practices“. I invite all of the SQL enthusiastic to stop by User Group Meeting and meet all the fellow developers, DBAs and members.Location : 401, TIME SQUARE, CG road, Op B......
Test Center preview: Microsoft`s " "Katmai" " is filled to the brim
Katmai, the code name for Microsoft's imminent SQL Server 2008 release, comes from an Alaskan territory know for volcanoes, which may not be the best symbol for a database. So far, however, Katmai hasn't blown up on me. And the lower-profile Katmai seems like a good follow-on to Yukon, the code nam......
Displaying Detail Records for User-Selected Master Records :: Saving the User`s Search Preferences
Last week's article, Using a Dynamic IN Clause, showed how to display detail records
for a set of user-selected master records. This entailed creating a User Defined Function
(UDF) in the database that would translate a comma-delimited string into tabular data that could then be parsed by SQL's I......
SQL SERVER - Readers Contribution to Site - Simple Example of Cursor
eaders are very important to me. Without their active participation this site would not be the community helping web site. I encourage readers participation and request that you help other users with your knowledge.I recently come across very good communication between two of blog readers. I want t......
Installing SQL Server 2008 RC0 & Visual Studio 2008 SP1 Beta on the same machine
I've been having some issues getting my VPC updated to SQL Server 2008 RC0 and Visual Studio 2008 SP1 Beta so I can record a couple screencasts on using Virtual Earth with SQL Server 2008. I swear I read through the readme docs:). However, I could not get Visual Studio 2008 SP1 to insta......