Auto Increment Value
Hi, I have an issue that I need to resolve. I have a table that uses an auto increment value for the primary key.I need to insert a couple rows into this table, but I need to enter a specific value for...
View ArticleHow can i remove old .LDF file except last 3 month
I am Using SQL server 2008 in windows platform. Day by day my .LDF log file is increasing and it reached to 86 gb. I want to remove .LDF log file except last three(3) month. How can i remove .LDF log...
View Articlehow to run faster access database file over the network
I am using ms access database with my application but the problem is that when I run thissoftware on network place after sharingdatabase file. the application run very slow on client machine but run...
View ArticlePerformance of GROUP BY vs. PARTITION BY
Hi all,Apologies if this has already been addressed but I couldn't find anything useful. My problem is this: SELECT Identifier, SUM(Value) FROM dbo.Table (NOLOCK) GROUP BY Identifier vs. SELECT...
View Articlehow to add row cell data in one row
USE [] GO /****** Object: Table [dbo].[ParaClassification] Script Date: 11/25/2013 13:42:57 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ParaClassification]( [Para_Id]...
View ArticleHow to get All "Employee" name field in one row ?
Hi,Any body know how to get all employee names in single row record with comma separated value.Example :EmployeeIDEmployee Name1Amit2Varun3Rakesh4RajeshExpected Result : Amit,Varun,Rakesh,RajeshPlease...
View Articlepivot query / unique concatenate
Hello and thank you for reading this. I have a table like:ItemSpecA16 GB RAMA1.4 GhzAWindows 8B4 GB RAMB2.5 GhzBWindows 7CWindows 8B2.5 GhzA1.4 GhzPlease note the duplicate specs on the same item. I...
View ArticlePivot on a Group without the same number of elements
I have an table with an ID and a description4 bob 4 sam 5 mike 5 Bill 5 joe 6 sally 6 jill 6 pat 6 kim 6 sueI need the out put to be like this ID F1 F2 F3 F4 F5 4...
View ArticleAutomated Testing for rowcounts
I need to come up with some automated testing tool, where when the sql query is given , it breaks it down to each table and the join conditions and find the rows at each level. for e.g Select * From...
View ArticleCreating Closure rates By Months
HiI have created two queries, One is for total Open cases and other is total closed cases. I want to get the closure rate by month and the formula is TotalClosed/TotalOpen*100TotalClosedSELECT...
View ArticleDifference between two dates ignoring the year - SQL 2008 R2
HiI have a date field in the database called cutoffdate. The table name is Paydate. The cutoffdate is as shown below:CutoffDate2013-01-11 00:00:00.0002013-02-11 00:00:00.0002013-03-11...
View Articleconvert datetime to date
my dates are in the format want to convert to'2013-11-10 1:00:00' '2013-11-10 1 am''2013-11-10 1:00:00' '2013-11-10 1 am''2013-11-10 14:00:00' '2013-11-10 2 pm'
View ArticleHow to store the result of Exec command into a temp table ?
Hi,I wanted to insert the result-set of a Exec(@sqlcommand) into a temp table. I can do that by using:Insert into #tempExec(@sqlcommand)For this to accomplish we need to define the table structure in...
View ArticleI guess I don't understand Instead-Of-Update triggers
I have a simple Table with a View on it. The View has an Instead-Of-Update Trigger on it. Lets say I execute an UPDATE command on the View that affects all rows. It appears that the...
View Articleonly one experssion can be specified in the select list when subquery is...
I am new to sql please help me where i am going wrong. declare @cnt int set @cnt=(select count(*),start_yy,school as total from table_a where id is not null group by start_yy,school)
View ArticleSQL Joins statements
I am trying to write an MysQL statement that requires me to pull data from different tables. I wrote a statement and used JOINs to link tables and extract data. I have a table called people. It lists...
View ArticleLog user access to file table
Hi Forum,I am trying to log access and changes to files in a FILESTREAM share. Mostly I want to log who changed a file and when.Can someone point me in the right direction?(I tried Google and serached...
View ArticleHow to Union while using Function?
I Have List of Company ,i need to union to display all Company as select all how can i achieve this i have code below:(SELECT CompanyID FROM dbo.HRMEmployeeMaster WHERE...
View ArticleA severe error occurred on the current command. The results, if any, should...
HiI will make this short. i'm running the following query: SELECT productindex, ROW_NUMBER() OVER (ORDER BY productIndex) AS Row1 FROM products where (categoryIndex = 52 or categoryIndex = 53 or...
View ArticleReplacement for sp_getbindtoken
We have read that sp_getbindtoken will be removed in a future version of SQL Server, future as in after SQL Server 2008. What will be the alternative to getting a unique transaction ID?The articles...
View Article