CTE VS PIVOT
I have two tsql command that gives me the same result. I want to know which one is better and I looked at the execution place.1st query : I used two CTE to pull the data from same table and joined at...
View ArticleRun Stored Procedure through Batch Files [CMD]
Hi,I want to execute my SP through Batch Files on CMD.Can somebody help me on this ?
View ArticleEstimated Execution Plan No Longer Recommends Covering Index?
Hello all. I must start of by apologizing, I cannot post any table definition details per my employer's rules. The actual layout of the tables and indexes that should be built are not the question I...
View ArticleT-sql - finding all sales orders that have similar products.
Hi,I've the following table and the data in it as well as per below. My question now is, I've to find all orders that have similar products placed in the sales table.So looking at the data entered, I...
View ArticleHow yo make these two queires to one please
Hello There,Could you please assist me to solve this, basically the below is 2 sql statements how can i convert these two queries to one, please---Query 1 select languagetype , Indication,...
View Articlemax Qty of serial number without duplicated.
I have QuerySELECT Serial,Itemcode,ItemName,Storecode,factor,pckqty,qty,'' "varient in PCS" FROM s_products where storecode='MEENA' GROUP BY...
View ArticleQuery in one step
I have available quantity of some product on my stock in different warehouses. Now, i have to take some quantity from stock. I have to take it from warehouse based on priority order. Every product has...
View ArticleCompare data and return the different columns
Good Afternoon,I am trying to compare the data in two tables and return only the columns and data where there is a difference.I have a compare script which checks every column in the two tables against...
View ArticleInject Dummy Months by Group
Hi I am updating a report in SSRS where I am usinga Bar Chart which shows the last 12 months. However because I am using a grouping feature, each graph will only show data that is present - so if a...
View ArticleT-SQL Query
UsageStartTime UsageCount 7:42 AM7 7:43 AM3 7:44 AM13 7:45 AM14 7:46 AM9 7:47 AM9 7:48 AM3 7:49 AM19 7:50 AM1 7:53 AM5 7:54 AM16 7:55 AM10 7:56 AM14 7:57 AM13 7:58...
View ArticleSSMS QUERY
hi ALL,This is my table:-Id Location Date Quantity Starting stck Ending Stck1 Delhi 1/1/2013 52 Delhi 1/1/2013 73 Delhi 1/1/2013 34...
View ArticleNot work correctly
Hi I try to update a value inside a table (ExTable01) but updated value is not true.Please help.When I apply update Saved wrong value is 891257536,00 (Column type real False ) but True...
View ArticleHow to use the Debugger in SQL Server 2012
I am wondering how to step through a SQL script. I copied/pasted the code from the example here.http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/interesting-t-sql-problemsI hit F11 3x and...
View ArticleI INSERT DAta into SQL Daata Base using C# visual studio and succeeded but...
this fucntion calls query methodprivate static void CreateStudent(StudentHandle ObjStudent) { String ConectionString = Properties.Settings.Default.Database1ConnectionString;...
View ArticleDate Format in Text file
Friends,I am generating a file through some script and need to add the date in front of it. I used cmd command and created a batch file but the format is coming as test.txt_12272013 but it should be...
View ArticleIndexing and Deadlock in SQL Server 2008?
All, I am running into a deadlock in SQL Server 2008. Using a profiler I was able to determine that the deadlock happens as I am trying to select and update row(S) in table in 2 different sessions....
View ArticleUpdate Record
Hello All, I have a table which contain around 130 million records I have added new column and now I want to update this column with certain conditions join from other tables .It is taking around 5...
View Articlehow to convert the following query to sql server 2005
hii have the following query in ms access and i want to convert it into sql server 2005 express editionSELECT iif(Max(BNo) is null,1,Max(BNo)+1) AS BNo from ( SELECT iif(Max(Product.BNo) is...
View ArticleBCP command
I am using below command in BCP but it's not working. because EMP table is different server and config is in different server.EMP table is in server1config table is in server2Running the BCP command...
View Article