|
How to start SQL Server Agent automatically when SQL Server starts.
|
Total Hit (3520) |
When you install SQL Server by default SQL Server Agent Service is set to Start Manual mode and some times this can stop your scheduled jobs. Its also possible that you stop Agent and forget to turn it on.
This article will show you how to create a SP which can start SQL Server Agent service if i
....Read More |
Rating
|
|
|
|
|
GROUP BY and UNION may return unsorted resultsets
|
Total Hit (3163) |
In SQL Server 6.5 and previous versions, the GROUP BY clause in a SELECT statement was carried out by temporarily sorting the resultset before grouping similar rows, therefore the end result was always sorted. For this reasons, many programmers omitted the ORDER BY clause, because the result was sor
....Read More |
Rating
|
|
|
|
OLE Automation in SQL server
|
Total Hit (3565) |
This is an example of a Transact-SQL statement batch that uses the OLE Automation stored procedures to create and use an SQL-DMO SQLServer object. Portions of the code are used as examples in the stored procedure references.
DECLARE @object int
DECLARE @hr int
DECLARE @property varchar(255)
DE
....Read More |
Rating
|
|
|
Check a string for numeric digits only
|
Total Hit (1805) |
The ISNUMERIC function in SQL60/65/70 checks for decimal & integer values. Hence characters like D, E are valid float representations & similarly ','. This is a simple logic that can check only for numeric digits without using a loop of any kind.
|
Rating
|
|
|
How to do error handling in transaction.
|
Total Hit (2222) |
The examples presented here are specific to stored procedures as they are the desired method of interacting with a database. When an error is encountered within a stored procedure, the best you can do is halt the sequential processing of the code and either branch to another code segment in the proc
....Read More |
Rating
|
|
|
How to run *.bat file using xp_CmdShell
|
Total Hit (6631) |
xp_CmdShell is a powerful SP if used with care. You can execute executable files (e.g. *.com, *.exe and *.bat) using xp_CmdShell however there is a little trick when executing executable file.
When you use the the following command you will get an error
<font color=red>'C:\myscript.bat' is no
....Read More |
Rating
|
|
|
Script to create dummy tables/procs and views for testing purpose
|
Total Hit (5022) |
This script can generate N number of Tables/Views and Stpored Procs in few seconds with some dummy data. I use this for stress testing and create dummy tables with data.
Change @howmanytables to create N number of tables and then set
- @howmanycolumns to create N number of dummy columns per tab
....Read More |
Rating
|
|
|
|
|
Get Started Using SQL Server 2005 Notification Services
|
Total Hit (934) |
People receive many notifications daily: weather updates, news updates, updates about stock prices, or a current account balance via a SMS message. But how can you build such notification applications on the Microsoft platform? You have two options: the first and less palatable is to build everythin
....Read More |
Rating
|
|
|
Monitor Event Viewer on Multiple SQL Servers
|
Total Hit (694) |
Muthusamy Anantha Kumar discusses three methods to monitor SQL Server Event Log on a list of servers and store the output either in a .CSV file or on a database table.
|
Rating
|
|
|
How to manipulate the Execute Process task.
|
Total Hit (805) |
Here is some code showing how we can dynamically manipulate the Execute Process task. Say we have an executable "c:\PassFile.exe" and it accepts one argument /F which is for a file. We want to be able to pass in whatever file we choose and we also want to be able to set some of the properties of the
....Read More |
Rating
|
|
|
XML and SQL 2000 (Part 5)
|
Total Hit (1055) |
In this article, we will continue exploring different ways of accessing SQL Server data in the XML format via HTTP. As we explained in the previous article, this type of functionality becomes available after creating a virtual directory corresponding to the target database using IIS Virtual Director
....Read More |
Rating
|
|
|
|
Sysprocesses table definition
|
Total Hit (751) |
The sysprocesses table holds information about processes running on Microsoft® SQL Server™. These processes can be client processes or system processes. sysprocesses is stored only in the master database.
|
Rating
|
|
|
SQL Server Stored Procedures Administration
|
Total Hit (604) |
A stored procedure is a precompiled collection of Transact-SQL statements stored under a name and processed as a unit that you can call from within another Transact-SQL statement or from the client applications.
|
Rating
|
|
|
|
Data Validation for Merge Replication
|
Total Hit (625) |
Microsoft SQL Server 7.0/2000 allows you to validate data for merge replication. You can specify rowcount only validation or rowcount and checksum validation of the article's data.
When you choose rowcount only validation, then SQL Server calculates a rowcount at the publisher level, then compares
....Read More |
Rating
|
|
|
Querying the SQL Server System Catalog FAQ
|
Total Hit (1120) |
Data Types
How do I find the data types of the columns of a specified table?
How do I find the LOB data types of a specified table?
How do I find the columns that depend on a specified data type?
How do I find the computed columns that depend on a specified CLR user-defined type or alias d
....Read More |
Rating
|
|
|
How do I enumerate tables in an Access Database
|
Total Hit (1161) |
If you need to enumerate the tables in an Access database, the easiest method is through the ActiveX Data Objects Extensions for Data Definition Language and Security. The ADOX library, as it is better known, can be used just like other COM objects from within ActiveX script, such as a task or workf
....Read More |
Rating
|
|
|
Generate Scripts for SQL Server Objects
|
Total Hit (2541) |
We all like the Generate Script feature of Enterprise Manager and like to use it programmatically. One of the most important uses would be backing up scripts periodically using SQL Server Scheduler.
|
Rating
|
|
|
MDX Member Functions: The "Family" Functions
|
Total Hit (856) |
This is the fifth article of the series, MDX Essentials. The primary focus of this series is an introduction to the MDX language. The series is designed to provide hands-on application of the fundamentals of the Multidimensional Expressions (MDX) language, with each tutorial progressively adding fea
....Read More |
Rating
|
|
|
New Version Showcases Native XML Type and Advanced Data Handling
|
Total Hit (1169) |
The next version of Microsoft SQL Server, code-named "Yukon," represents quite a few steps forward in the evolution of XML integration. Yukon supports native storage of XML data using the XML data type, which makes it possible to run native queries on XML data using the emerging industry standard XQ
....Read More |
Rating
|
|
|
Arrays and Lists in SQL Server
|
Total Hit (767) |
In the public forums for SQL Server, you often see people asking How do I use arrays in SQL Server? Or Why does SELECT * FROM tbl WHERE col IN (@list) not work? This text describes several methods to do this, both good and bad ones. I also present data from performance tests of the various methods.
....Read More |
Rating
|
|
|
|
|
How to move, copy, and back up full-text catalog folders and files
|
Total Hit (1502) |
Full-text catalogs and indexes are not stored in a SQL Server database. Full-text catalogs and indexes are stored in separate files that the Microsoft Search service manages. The full-text catalog files are not recovered during a Microsoft SQL Server recovery. Additionally, you cannot use the Transa
....Read More |
Rating
|
|