Stored Procedure to insert xml with sequences into database as single row
Hi, have an XML file that has sequences for multiple address lines and while using OPENXML I can't seem to load the values in these subs as a single row (or load at all).Here's the XML with the addy...
View ArticleT-sql script is running in 2000 sql server not in 2008 sql server.
This script running in 2000 server and updates other tables but if I run this table not updating any tableINSERTINTO Appraisers(ContactID, FirstName, LastName, Company,...
View ArticleSql server bugs? Query result isn't determined when group by expression?
I have the following querywith cte1 as ( select isnull(A, 'Unknown') as A, isnull(nullif(B, 'NULL'), 'Unknown') as B, C from ... group by isnull(A, 'Unknown'), isnull(nullif(B, 'NULL'), 'Unknown'), C...
View ArticleParent Child count- so complicated!
Hi Guys I have a dataset where there are parent and child products. Each parent has got a unique code(P1,p2 etc) and a link code (L1) on their account and each child of the parent has got a seperate...
View ArticleJOE CELKO: There is a Nested Sets Model Question on Database Design
Can you answer it? Thanks.Thread: http://social.msdn.microsoft.com/Forums/en-US/f686ccb9-e936-4cfd-af6a-a52a0ed56b26/does-a-nested-set-model-defy-normalization?forum=databasedesignKalman Toth Database...
View ArticleUrgent Help on a query
HELLO, I am comparising some 20 fields between 2 tables and then returning data for the fields that are different when compared. But the requirement now is for example. For ID 1 the first record PRD1...
View ArticlePopulate data in table from another table
i have a csv file like this example: ques_1 ques_2a ques_3 ques_4... 4 5 28 27 i have two tables survey,surveyanswers right now im populating data from csv file into survey table like this but i want...
View ArticleKeyword DISTINCT,LTRIM, RTRIM not working properly
Hi All,Probably I am doing something wrong or I am not aware of hidden functionalities of subjected keywords, But I am facing a bizarre problem with them.Please help. Attached is the snapshot of the...
View ArticleRandom Sorting of Delimited List Items with NEWID()
How do I get a random sort of the comma delimited colors?SELECT Subcategory = ps.[Name], ColorList = Stuff((SELECT DISTINCT ', ' + Color AS [text()] FROM AdventureWorks2012.Production.Product p WHERE...
View ArticleParameter query
I am looking for some advice on best way of doing this. I have a student table and a location table that contains a Home city field. What I am wanting to do is rather then displaying a long list of...
View ArticleSet based practical challenge for those that love SQL.
Hi. Thank you for your time and expertise.Please take a look at fully defined problem below and supplied test code. Give it your consideration and see if you see set based solution to this challenge....
View ArticleDense_Rank() is ordering by the partition column and I dont want it to!
Hi all, I have been stuck on a particular use of the DENSE_RANK() function. I am trying to partition by a column but order by another column, but when I try to partition by a column SQL is ordering...
View ArticleNovember on TechNet: Calling All T-SQL Gurus - Enlighten Us!
"An influential teacher, or popular expert" Oh mighty reader, we need your enlightenment! Only YOU can show us... the TRUE WAY to code! Win the love and adoration of generations to come, by giving...
View ArticleHow do Create Trigger After Update
there my dear, I'm experiencing some difficulties when creating a trigger to update when a change occurs in a particular column of a table, with an update occurs in other columns. I own a system to run...
View ArticleT-SQL Challenge - sum/avg
Hi All,I am encountering a tricky situation and need your help. We have a table called @InitialFacts that has customer facts as shown in the first code below. There is another table build from this...
View ArticleVS2010 - Converting to type 'date'
In essence our Date entry Database inputs in date's and times for deliveries, if one isn't entered it is shown as 01/01/1990 & 00:00:00.When this is then transferred/subsumed to our useable...
View ArticleQuery to Display Data for SalesMen
I have 3 salesmen, each who cover a few states. I want to build one query that displays the data for each salesmen, but can't figure out how to build ONE query that does this. Mike covers the states...
View Articleselecting correct rows
I am having trouble selecting the correct rows, as I have got duplicate rows in my table.Column 1 Column 2 Column 3 Column 41...
View ArticleMicrosoft TechNet Wiki T-SQL Guru - Winners for October!!
The results for October's TechNet Guru competition have been posted!http://blogs.technet.com/b/wikininjas/archive/2013/11/17/technet-guru-awards-october-2013.aspx Congratulations to all our new Gurus...
View Articlefind total money of parent node of mlm tree according to a particular pattern...
<pre> hi friends actually i am working on a mlm project in which members are added in a tree pattern, and get the payment accordingly. My table structure is as follow: Id...
View Article