SQL Query to produce multiple calculated count columns.
Hello SQL Masters,We are trying to write query which can produce included sample output for SSRS. Here, i am including sample query to produce ONLY 1 calculated column but how can I produce ALL...
View ArticleHow to generate script for ExtendedProperties ?
Hii have a view with a lot of columns which have some extended properties. i want to generate this extended properties to execute in another db. i know this option in generate script dialog box, but...
View ArticleCheck Rows BEING inserted without running the query again
Hi,How can I check/compare the rows selected for insertion while running the SQL like:INSERT INTO A SELECT * FROM B.So I can decide whether to cancel the script or keep the query running.I can run...
View ArticleEffects of Concurrent Trigger Firing on Inserted and Deleted Tables
I have a question regarding the Inserted and Deleted tables populated during the firing of a trigger. This would be in a situation where a single trigger has been fired multiple times by several...
View ArticleFull & Differential Database Backup using T-SQL/SSIS
Hi,I am trying to create Full and Differential backups using SSIS/T-SQL (Execute SQL Task). I have one pkg for Full backup and 1 pkg for Differential backup.For FullDB Backup pkg, I am using the...
View Articleasp.net database objects list
I am trying to document what are the sql server objects are being calling from the asp.net application.is there any tool , approach or method exists to meet this requirement ?Please mark the post as...
View ArticleSQL CommandTimeOut
To perform update task it takes me more than 30sec and due to which I got exception saying timeout. When I increase it to 60sec it works fine. But, my problem is day by day as the number of records to...
View ArticleDisplay records between two dates.
Hi all,I have records in the database that I would like to display the records by date range. The records that falls between 28th of the current month and the 10th of next month. The column name is...
View ArticleScript error in SQL Svr 2008 and not in 2008 R2
I am working on 2 different servers one of which has SQL Server 2008 and the other has SQL Server 2008 R2. I have a reindexing script that works on the R2 version but will not run on the plain 2008...
View ArticleThe query processor ran out of internal resources
Hey all!I have two similar SQL statements (bold represents a different param):1)SELECT REC_CI.CashItem, REC_CI.Position, REC_CI.DisplayName, REC_CI.Parent, REC_CI.OrderBy, PivotData.* FROM (SELECT...
View ArticleSQL Help?
Hi All,My below join working perfectly. Now I need to add one more condition for existing join.In M table I have one column ‘Type’=2 then I need +1 date condition including below join in E table and...
View Articleget pure date and time from a date time value
I have pure date and pure time fields in my SQL Server 2008 database server.My procedure receives datetime data from the client.I need to parse the datetime value to date and time to store in my...
View ArticleHow to resolve this Erro-------Conversion failed when converting the nvarchar...
select distinct pa1.project_attrvalue Brand, p1.project_manager PrgManager, pa2.project_attrvalue GBU,p1.Project_Name PrjName,p.u_email, wda.DOCUMENT_NAME DocumentName,wda.DocVersion_Counter...
View ArticleHow to assign identifiers to agents in a table
Hi everybody, I am working on an SSIS project, one step of which involves using T-SQL to create a temporary table in SQL Server, join it to other tables in the database (based on a series of person...
View ArticleScalar db variable SQL server
I would like to create scalar variable on database, just not sure if it is possible? I have db table with a column version and a single row with the version. I was thinking something like :SET DBNAME...
View ArticleMicrosoft Project Server 2010 SQL Query for Tracking Project Manager Hours...
Project Server 2010: I need some input in creating a report via a SQL query that pulls the following data: From TABLE A (MSP_EPM_USER_VIEW: ResourceName; ProjectName; TaskName, and; from TABLE B...
View ArticleUpdate Openquery to Oracle with date
Hi Guys,I have an issue with Update on an Openquery that points to an oracle server.UPDATEOPENQUERY (DWHNY,'SELECT UPLOAD_STATUS FROM app_cpm.PROCESS_CONTROL_CPM WHERE BUSDATE= ''11-Dec-2012'' ')SET...
View ArticleHow to calculate difference between 2 consecutive rows within single column?
I have a table named ShowSchedule. Attribs are as follows, ShowID INT PRIMARY KEYShowDate DATEShowTime TIMENameofShow NVARCHAR(100)I have records order by ShowTime in a table.....Now I want to...
View ArticleDerived Field Help
I have a requirement to return all the 'Message' objects that are in the same 'Subject'(s) as a given Message.A Message can be in 1 or more subjects, and there is a table called MessageSubject that...
View ArticleHow can i get the Next Row Data into Current Row
How can i get the Next Row Data into Current Row for Example i want to get End Date from Start Date IdCdCRCarStrt_DtEnd_Dt11700649...
View Article