Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
VB VB (1648)
VB.net VB.net (736)
C# C# (15)
ASP.net ASP.net (779)
ASP ASP (41)
VC++ VC++ (25)
PHP PHP (0)
JAVA JAVA (4)
JScript JScript (5)
  Database
» SQL Server (708)
» ORACLE (5)
» MySQL (0)
» DB2 (0)
Automation
» C/C++/ASM (11)
» Microcontroller (1)
» Circuit Design (0)
OS/Networking
» Networking (5)
» Unix/Linux (1)
» WinNT/2k/2003 (8)
Graphics
» Flash (0)
» Maya (0)
» 3D max (0)
» Photoshop (0)
Links
» ASP.net (2)
» PC Interfacing (1)
» Networking (4)
» SQL Server (4)
» VB (23)
» VB.net (4)
» VC (3)
» HTML/CSS/JavaScript (10)
Tools
» Regular Expr Tester
» Free Tools

(Page 6 of 6) 171 Result(s) found 

 

Reading Text Files Into Tables with line numbers.
Total Hit (2372) Some times we need to read text file line by line or read a specific line using T-SQL. This article will explain a simple technique using xp_CmdShell stored proc. Let's first create a sample file which we will import into SQL Server table. <b>test.txt</b> «code LangId=999»<Pre>Hello this is a ....Read More
Rating
How to find first/last record in the group?
Total Hit (4482) Yes this is certainly a common situation where you have to write a query to only extract first or last record from the group. For example you might want to extract only first product from each category. Let's look at some examples. «code LangId=6»Drop table #TempTable Go create table #Te ....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
How to find start/end date of Previous Quarter
Total Hit (3345) «code LangId=6»declare @PrevQtrDate datetime declare @PrevQtrStartDate datetime,@PrevQtrEndDate datetime declare @ReportDate datetime set @ReportDate=getdate() set @PrevQtrDate=dateadd(q,-1,@ReportDate) Print @PrevQtrDate set @PrevQtrStartDate=cast(month(@PrevQtrDate) as varchar(10)) + ' ....Read More
Rating
How to Implement IRR Financial function like Excel IRR in SQL Server using T-SQL
Total Hit (27284) Have you ever wondered how to use same functionality of IRR function of Excel in T-SQL. Well unfortunately there is no inbuilt function in T-SQL but we can create a user defined function to implement the same logic as IRR of Excel/VB. «code LangId=6»create table IncomeTable ( amt float, d ....Read More
Rating
How to find all tables with/without Primary Key from a specified Database
Total Hit (3694) Primary Key is important constraint to maintain integrrity and speed. Here is the query if you want to find all tables without Primary key. <u><b>Note: Please change Northwind with your DB name.</b></u> <b>All tables without primary key from Northwind Database</b> «code LangId=6»Select * from ....Read More
Rating
Grouping Problem: How to get single record from group with minimum value of one field?
Total Hit (2600) Assume that you have multiple record of customer transactions but you only want one record for each customer with minimum transaction date field... How would you do it ???? Please check the following query «code LangId=6»create table #tmp(cust_code varchar(10),cdate datetime,amount money) ....Read More
Rating
Real world recursion example of CTE (Common Table Expression) used in SQL 2005 / 2008 , Finding information from Tree Structure.
Total Hit (3126) CTE is new powerful feature in SQL Server 2005. Two advantages of CTE <b>1. Implement Recursion (See example)</b> This is the biggest advantage using CTE. Recursion was possible in SQL 2000 but you had to write UDF or nasty joins. <b>2. Reuse Query anywhere by name (Just like View or Temp ....Read More
Rating
How to pass array to stored procedure in SQL Server
Total Hit (4014) Have you ever come across the situaction when you have to pass mutiple values as parameter to your stored procedure. Assume the following scenario. - Your application pass comma seperated CustomerID list to stored procedure to get Orders for related customers. Above requirement can be don ....Read More
Rating
Script - Update Blank Values of Group until Next group starts
Total Hit (2641) Recently I came across simple scenario where I had to update some blank values of certain records. Here is what i mean Assume you have two columns. You want to update Order# column with same order number until next group starts (e.g. ID 2,3 update with Order# => 1000). ID Order# 1 1000 2 ....Read More
Rating
How to return Error Description using Error Code in SQL Server 2000 ( DBCC OUTPUTBUFFER technique )
Total Hit (5677) This code will show you how to grab error description in sql server 2000/2005 Originally Published on <a href='http://pjondevelopment.50webs.com/articles/retrieveErrorMessage.htm'>http://pjondevelopment.50webs.com/articles/retrieveErrorMessage.htm</a> «code LangId=6»CREATE PROCEDURE dbo.spGET_ ....Read More
Rating
How to backfill data (i.e. populate missing values from historical data)
Total Hit (7211) Consider scenario where you want to populate missing data from previous date when data was available. In the following example we want to populate price of orders from most recent previous date when price was available. «code LangId=6»create table #orderinfo ( odate datetime ,product varcha ....Read More
Rating
DATEFLOOR : Rounding dates to nearest day,hour,minute,second
Total Hit (7239) This function takes a date and a date part parameter and rounds the date down to the nearest date part. Credit goes to "Gordon Klundt" <b>Example:</b> In order to round '2010-11-03 17:44:10.117' to the nearest hour ('2010-11-03 17:00:00.000') «code LangId=6»select dbo.datefloor(cast('2010- ....Read More
Rating
Script to create dummy tables/procs and views for testing purpose
Total Hit (5023) 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
Shrink log files of all user databases
Total Hit (5110) «code LangId=6»declare @ssql nvarchar(4000) set @ssql= ' if ''?'' not in (''tempdb'',''master'',''model'',''msdb'') begin use [?] declare @tsql nvarchar(4000) set @tsql = '''' declare @iLogFile int declare @sLogFileName varchar(55) declare @RecoveryModel nvarchar(10) declare LogFiles cursor ....Read More
Rating
Tricky order by without writing dynamic T-SQL
Total Hit (2477) This example shows you how to write dynamic order by statement without writing Dynamic T-SQL which is required to re-compile the execution plan every time you run it.
Rating
Get more than 40 Date/Time formats with SQL Server using Convert function
Total Hit (5680) You can use convert function to format your datetime the only thing you need to to know is format type which is a integer number. This sample output will help you to find your format id quickly.
Rating
How to find tablesize and estimated rows for all tables
Total Hit (2706) Since there is no easy way using Enterprise Manager to know size and rows for all tables you need to write your own query. Run the following Query to see the result «code LangId=6»USE Northwind Go SELECT a.Name , SUM(b.RowCnt) EstRowCount , SUM(b.Used) * 8 TableSize_KB , (SU ....Read More
Rating
This is a link to a different site 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
This is a link to a different site Writing Secure Transact-SQL
Total Hit (702) There are plenty of good sources of information about how to deploy SQL Server in a secure fashion. However, these resources are often targeted at database administrators tasked with securing already developed applications. In addition, there is a rich body of information that discusses writing secu ....Read More
Rating
This is a link to a different site Dynamic order by
Total Hit (902) You can use CASE statement in order by clause to select field by which you want to order the resultset. This is very handy technique.
Rating


(Page 6 of 6) 171 Result(s) found  1 2 3 4 5 6

Recommanded Links

 

Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.