Parsing and joining XML using xquery
I have a table which has an xml column which contains multiple xml elements as follows:[code="sql"]CREATE TABLE ReportData ( id INT, ReportData XML );[/code]There is a second table called UIElements...
View ArticleHelp with Temp Table.. and query
Query below - I need to pull in the Person's extension - which is in the same same table as person_Id and person_name.. (mart.dim_person) is the table. In the dim_person table, the field I need to also...
View ArticleMicrosoft Access 2010 Runtime with SQL Server 2014
Apologies for such a question...We have a supplier of a piece of software that is made up of an Access front end with a SQL Server back end. It was previously on a Windows 2003 server, with a SQL...
View ArticleResources to entity tables relationship
Hello,I have about 100 tables which represents different entities related to person. For example, tables are person_car, person_children, person_house etc. So, in person_children are stored info about...
View ArticleRename Column with comma
Hi I have comma in column name. we just import from somewhere and cant change. I want to rename column name from upper case to lowercase and i can do it with gui but i have lot and want to use script....
View Articlesimple date function concept
Hi Friends,please some one help me how can i get my Expected output.?Sample Input :Start End Amount14-Apr-14 13-May-14 20015-May-14 16-Jun-14 320Expected OutputStart End Amount14-Apr-14 30-Apr-14...
View ArticleSelect within Case Statement
I have the following select statement where i am trying to pull period Revenue along with Total Revenue for engagements. The Rev_main table has a period column so i am trying to setup the case...
View Articleadd getdate() at end of expression
Hello I m trying to achieve something like this without patindex[code="sql"]DECLARE @source_path nvarchar(1000)SET @source_path = 'hello_there_123.zip'PRINT @source_path--Expected Result is using...
View ArticleFull-Text Indexing & Searches
Greetings, all.I have not used full-text indexing. If we have a title column (nvarchar(1000)) & a description column (nvarchar(max)), and we expect that many web users will be querying these by...
View Articleconvert sum of seconds to time h:mm:ss
,case when sum([CallsAnswered]) = 0 then 0 else sum([TalkTime]+[HoldTime]+[PostCallProcessingTime])/sum([CallsAnswered]) end as [IB HandleTime (Sec)]TalkTime, holdtime, postcallprocessingTime are all...
View ArticleCharacter Encoding Conversion Issues?
I have a column thats defined as nvarchar(256). I wish i could post the exact data i'm having issues with but i can't because its sensitive information. Anyways when do the following:[code="sql"]Select...
View ArticleExport Database Diagram to Visio
I want to export a diagram preferably to Visio but I do not currently have it installed.Before I get a license I was wondering if that is the best option?Does the export require manipulation to clean...
View ArticleLast day of month in a WHERE clause
Hi all!Have looked a bit around to find something here, but only found something about how to calculate last day of month.Given this extremly simple table:CREATE TABLE [dbo].[a_dates]( [id] [int] NOT...
View Articleneed to copy a 600 gig table
What would be the best way to do this? The db is in simple mode. i need a copy format that doesnt write to trans log.Ideas?
View ArticleCredits and Debits
Hello,This is my first post here , so please be patient.I am trying to build a logic in SQL server 2012 where the Debit amount should always be assigned to the Previous credit amount which still has an...
View ArticleComplex XML Source Import
Hi All, I've an interesting challenge, I have just received a new set of XML files which we need to shred and import into our data warehouse. The files are anywhere between 100mb and 2GB and have been...
View ArticleNegative duration
Hi,I used the below query [code="sql"]select CONVERT(TIME, DATEADD(ms, DATEDIFF(ms, last_request_start_time, GETDATE()), 0), 114) AS Duration, *from sys.dm_exec_sessions where (status <>...
View Articletokenize string into key value pairs
[size="6"]hi everybody we have to parse some strings with tsqlthis are the strings I want to tokenize into key value pair tokens[/size][size="1"]<parameters>SearchName="Flat "...
View ArticleLow Cardinality estimate in Hash match operator
Hi Guys,Sorry to post this in 2014 forum, I did that because the problem seems to be fixed in the new cardinality estimator.I am trying to fix a performance problem with one of our reporting queries. I...
View Articleso businesses will hold off committing
[url=https://www.linkedin.com/pulse/mbc-mobile-binary-code-review-software-howard-kesslers-jhon-pfi][MBC] Mobile Binary Code Review[/url]
View Article