Selecting a Column dynamically
I Have a table with the following columnsBusiness Unit,AprTarget,AugTarget ,DecTarget,EtcDepending on the month we are in want to select the column with the appropriate month. So, if I ran the query...
View ArticleHow to overcome the identity column "jump 1000" issue
Hey, Since SQL2012 MS changed something with the identity column; after a restart the value jumps with 1000 (for INT identity column). This is an undesired "feature" for us. One solution I have read is...
View ArticleGetting jobs that failed for a period of time
Hi guys, I need to get a list of the top 10 jobs that failed the more during the last month (last 4 weeks).I need:
View ArticleWhitespace in 3-part name ignored???
Hi all,I noticed that if I use spaces and/or tabs in a 3-part name OUTSIDE the brackets , they are ignored.For example: select count(0) from [SomeDB].[db
View ArticleOData source + Sharepoint in SSIS
Hi ,How to read the excel file in sharepoint and store excel data in SQL server databasethere are multiple excel files are placed in sharepoint say regionwise.NA ,APAC ,EMEAthere are some 20-30 excel...
View ArticleDisplay the inserted data in the right collation
hi everyone i was testing collation with japanese characters and when i inserted the data into the database using collation SQL_Latin1_General_CP1_CI_AS the japanese letters were displaying but when i...
View ArticleSSIS issue with Event Viewer
hello there, I have an SSIS package that it reads the event viewer logs in C# but for some of the rows like DCOM and Perflib it brings back this and not the message The description for Event ID...
View ArticleManipulate two columns of information into one column for each type of data.
Currently I have this:[code language="sql"]Client.id AS ‘ID’, RTRIM(Users.lname) + ‘, ‘ + LTRIM(Users.fname) AS ‘Name’,--CASE SHOWING READING, LANGUAGE OR MATH TEST TYPE CASETest
View ArticleFind out consecutive date difference
Dear All,Please help me to sort out itI have reporttable where the fault report date and complete date is inserted and i have a master table for the ID.
View ArticleExcel Import - Truncation Error
I'm trying to import data from a spreadsheet, but the last column containing URLs is giving problemsError 0xc020901c: Data Flow Task 1: There was an error with Source - Sheet1$.Outputs[Excel Source...
View ArticleViolation of primary key constraint error when updating sql table ?
Hello I am using below query to update my table from another table...................................[code language="sql"]SET IDENTITY_INSERT [dbo].[Employees] onINSERT INTO [dbo
View ArticleJoining two datasets from two servers in a SSRS report
Hello,I have created a SSRS report that displays items based on countries and States and pulls data from two data sets. One data set provides the location information and the other the count of items...
View ArticleDifferences in this where statement
I'm modifying a few queries to make them more efficient and have had success using the following technique.Instead of manually changing the dates each time I run this, I've just used DATEADD and am now...
View ArticleBatch Deletes in Explicit Transaction
Hi SSC,I ran across a block of code today which does deletes from a table in batches of 5000. Nothing crazy there. However the developer wrapped the entire set of batches in an explicit transaction,...
View ArticleUpdate Query Performance
Hello Experts,Following update Query takes about 1 Millisecond to update a Product reserve under less Load. But when thousands of users try to update the same product at the same time, it is taking up...
View ArticleAuto increment Foreign Key Column in sql
I have a column for ID in remarks table which is linked to customers table ID columnThe primary key is auto increment, but how to make foreign key auto incremental .
View ArticleConvert Cross Join to Inner Join
Hopefully this isn't too daunting given that I'm providing a rather lengthy piece of sample code. I understand that cross joins using where clauses are the same as inner joins but I would rather...
View ArticleAzure SQL Function Performance issue
Hello Everyone,I am facing some challenges with SQL performance, the database is SQL Azure. Please let me know if anyone has some suggesations to improve this performance, Code block,[
View Article