Manipulation of date ranges Hello, We have to deal with date ranges (start_date, end_date). We wrote some basics table function that return intersection, union, exclusion having two table variable parameters. We also sometime need to clean such a table (so that the ranges won't intersect). It works but I guess it can be improved. Do yo... 28 Apr 2010 01:48
Parameter Sniffing Why Parameter Sniffing is Not happened in Each Query of SQL.Why its only occur in some query.I Wrote Stored procedure more Complex that the Stored Procedure Which Have Problem of Parameter Sniffing.But All those Working fine ... 24 Apr 2010 07:13
SQL Query needed Sample Data Type # Amt # Trno # DC # Code # Subcode ADV # 1000 # 1 #D # 103625 # ADV # 1000 # 1 #C # 103400 # S1 ADV # 2000 # 2 #D # 103625 # ADV # 2000 # 2 #C # 103400 # S2 VES # 5000 # 1 #D # 103400 # S1 VES # 5000 # 1 #C # 300070 # S1 Now I wanna find out the details of Code & Subcode of Type(VES) wh... 24 Apr 2010 06:07
Leading and trailing spaces trimmed with SQL XML Hi, I am inserting data into a table using xml bulk insert. One of the field is of string type and contains data with leading and trailing spaces. But on insert the spaces automatically trimmed off. Can you please tell me how to avoid this trimming of spaces, as i have to insert data using xml. EXEC sp_xml_pr... 3 May 2010 18:44
Query for non unique record How can I write a query that returns to me those records whose SequenceNumber and Symbol are not unique ? (have more than 1 records whose combination of SequenceNumber and Symbol are the same) Thank you CREATE TABLE [dbo].[TickData1Day]( [SequenceNumber] [char](13) NOT NULL, [CommodityCode] [char](10) NOT ... 30 Apr 2010 15:10
Particular query problem Hi, I have 2 similar tables, like these: Create Table Report(Month int, Value float) Create Table ReportCorrect(Month int, Value float) with these values: Insert Report values(1,16),(2,11),(3,12),(4,15),(5,0),(6,34),(7,56),(8,14),(9,24),(10,0),(11,12),(12,14) Go Insert ReportCorrect values(1,16),(2,1... 27 Apr 2010 17:57
Gettting an SQL snippet from a query Given: select cde from mytable; A1% BV7% CV5% What SQL will give me the following as a result (SQL snippet): where cde like 'A1%' or cde like 'BV7%' or cde like 'CV5%' Thanks. ... 23 Apr 2010 18:12
SQL 2005\2008 Hashbytes - salt key Hi, Does Hashbytes function in SQL Server (2005/2008) use internal salt key? I have noticed in several posts that it was mentioned but couldnt find the salt key length. Appreciate the help.. Thanks, DBboy888 ... 23 Apr 2010 03:28
SubQueries or CASE Is there a better way to write: Select * FROM #Temp WHERE MyID = (SELECT WorkID From Defaults Where EID = @EID OR MyID = (SELECT NonWorkID From Defaults Where EID = @EID I am doing 2 subqueries which looks at the same record but this is how it was written and am trying to see if there is a bett... 22 Apr 2010 19:45
How to script all stored procedures In SQL 2005, how do you create a script for all the stored procedures to a file ? I only know how to do it 1 procedure at a time. Thank you. ... 23 Apr 2010 10:46 |