This script contained within this post, applies permissions to all stored procedures or tables within the database.
Category: SQL Server
When creating non-clustered indexes, you should never include the clustered index key fields (commonly used for the primary key) as part of the non-clustered index. This is because the fields will always be used within queries. There is no need to specify them again. The only exception to this, would be if the clustered index […]
While going through “Question of the day” from http://www.sqlservercentral.com/, I discovered an issue with the ISNULL function.
If you were to run the query in this script you will be surprised to hear, that the result returned is “A”. I am sure you would expect the result to be “ABC”.
This query can be used to identify those indexes that should be rebuilt (using ALTER INDEX REBUILD WITH (ONLINE = ON), or those that should be reorganized (USING ALTER INDEX REORGANIZE)
If yes, then following the instructions below[ref]Please ensure you test any script taken from my website on a test/development machine, before running on a production server.[/ref], from MSDN (http://msdn.microsoft.com/en-us/library/ms179254.aspx): Make sure you have all the information or scripts needed to re-create your user databases and all the objects in them. See my note below Export […]
Script to return a list of database tables (the schema and table name) along with a count of the records within each table. This can come in useful if you are trying to compare databases.
If you are trying to install SQL Server 2005, and receive an error regarding the SQL Server Native Client package being missing, go to your “servers” install CD/folder, and right-click on the sqlncli.msi file, and click on Uninstall. Once uninstalled, just re-run the setup again, and it should install successfully.
If you are using SQL Server Integration Services (SSIS) to import data and want to record the row number against each record, then the Konesans Row Number Transformation product is exactly what you need. Please click here for more information about the Konesans Row Number Transformation product (http://www.konesans.com/rownumber.aspx).
When SQL Server is installed, the “tempdb” database is placed by default, on the same drive that SQL Server is installed on.
As this is usually the same drive as the operating system, it is best to move the “tempdb” database to a separate drive.
Whilst studying for my MCITP Database Developer certification, I have come across a very useful function that returns the value of the first non-NULL value from multiple choices
The default value of a parameter can be specified as NULL. In this case, if you do not supply a parameter, SQL Server executes the stored procedure according to its other statements. No error message is displayed.
The procedure definition can also specify that some other action be taken if you do not give a parameter.