Welcome to SQL world on Planet Source Code! This site is one of the Internet's largest online databases of free code! You can search for particular code, simply browse by category, or just peruse! The site is filled with programs, .zip files, examples, snippets, and tutorials so feel free to jump on in!
For all you masochists, here is a list of all the code in the Planet Source Code database for this world, all 44,515. lines of it!!!
SQL 2 String-lists comparison
Enables SQL Server to perform a comparison between two string lists ; the items sperated with a Delimiter (same one in both strings) ; it splits the twos strings and then check if all of the first array or string's elements in the second array or not ; can be used in stored procedures/views/functions
Special Thanks to GuyH
Affecting all the tables in one shot Executes any command on for every user table in the database
Avoiding Cursors Some times, in our query, we may use temporary tables and cursor's to get the required result. This implementation in some cases can be avoided using User Defined Functions.
Strip Out Weekend dates - user defined function Allows you to get an accurate count of weekdays for a given date range.
Group Data Values Often we have to group certain values by providing their id's. If the id's are seperated by comma's, this function gives you the simple methodology rather than parsing one by one.
Grouping Data Often we have to group certain values by providing their id's. If the id's are seperated by comma's, this function gives you the simple methodology rather than parsing the id's one by one.
Separating Function We often have a string of numbers separated by a delimiter and are required to break up the string into individual numbers for further use in code.This function emulates the split function.
Filter duplicate records from a table Deletes duplicate records from a table
qStats_Ex This a rewrite of qStats, which was a rewrite of sp_TStats.
find depended objects handle - cr's you cant find all the depended objects by using sp_depends ,if you are execute a string which contains a table inside a stored procedure, but this function will give you a list of objects
Is Num The is numeric function can return some weird results isnummeric('.'), isnumeric('+'), isnumeric('-'). Yes, Yes and Yes. These are not the most helpfull results. Heres a little function that tells it like it is.
Changing object owner to dbo Use this one liner to change object owner to dbo (rights).
Brief Tutorial on Text, Ntext, and Image MSDN article Using Text, Ntext, and Image. From the basics to very elaborate cases such as using file IO, conversions, extc.
Proper Case All Words - UDF Proper Case All words in a string of words, and removes any extra spaces. A UDF in SQL 2000 but can be changed to a Stored Procedure in other SQL versions. This was resubmitted. I tried to edit my previous submission and the site deleted it. A user pointed out that if a 1 charater string was sumitted the next word would not be capitalized. This submission fixes that problem.
How to remove excessive spaces How to remove excessive spaces from column in your table? Example: how to convert 'dupa___jasiu______pierdzi___stasiu' to 'dupa_jasiu_pierdzi_stasiu' (tested only with varchar) :).
Convert To Currency Quickly formats any number to currency. Adds commas(if applicable) and dollar sign. Very usefull if exporting dollar amount data to XML format.
Uppercase This little snippet will allow you to change words in characterfields to uppercase. Might be usefull on Fullname fields or similar datafields.
Get environment variable in MS-SQL It is now possible to get any environment variable through SQL with this simple stored procedure. Unfortunately, there is apparently no "cleaner" way to do it. Enclosing the plumbing in a stored procedure surely cleans it up a little.
Document Generator generates document having the list of all the tables including their column names datatypes and with their extended properties also in the database
Google Display searches a keyword in a text column and displays as a google search format
Page 1 of 37 found. Entries 1 - 20 of 738 found
Next 20 entries