Moving 200000 records from a set of tables to another table with in same...
Hi,I want to move 200000+ records from a set of tables (4 tables to be precise) using join to another table with-in the same database.The data being moved from these tables will be either updated if it...
View ArticleQuery Help Merging 2 Tables
I have 2 tables as follows and need the output to be as the 3rd example below. I have tried using the left outer join, but have not been successful. I am using SQLServer 2008. Any help would be...
View ArticleDynamic sql from table
0Hi, I have a Hierarchic table T like this : ID Caption Table Id_Dim ----------------------------------------- 1 A [DimA] NULL 2 B [DimB]...
View ArticleHow to resolve below error
TITLE: Connect to Server ------------------------------ Cannot connect to 121.246.137.113. ------------------------------ ADDITIONAL INFORMATION: A network-related or instance-specific error occurred...
View ArticleConverting to date
I have a table with a field that is (nvarchar(4000)), this field takes different types of data (text and numbers, and dates). I have dates stored as follows:1) 20120824T165728.534 GMT 2) 20130824This...
View ArticleRe-use of procedures and functions, etc.
I have a general database design which I have inherited which has identical tables and procedures, but only with a different database names. The convention is like...
View ArticleHow to get the information on SQL configuration logins,SQL Service accnts for...
Hi everyone,My intention was to get the SQL configuration information (for sql 2005), SQL service account information ,Logins (server level) from server . Is there any script available that I can...
View ArticleError handling in SQL server 2012 - please help
Hi, I have a scenario. DECLARE @INPUTFILENAME VARCHAR(100) DECLARE @MAXLOAD_DT DATE DECLARE @FILEDATENAME DATE SET @INPUTFILENAME ='FileName-20131128' -----Filename SELECT @MAXLOAD_DT='20130628'...
View ArticleWrite a query with two count conditions
Hi Guys!In my VB.Net form I have NameBox and a SurnameBox and they are writing the data to the related columns in my sql server 2012 database with a Save button.So how can I write something to the...
View ArticleQuery suggestions
I have situation like below and i answered it like follows. I did count of emails. But what is SUMEMAILCnt ? And also an efficient way to count a billion rows which i never did. PLease help me with...
View ArticlePivot Report
I am having a hard time wraping my head around the PIVOT command and I hope someone can help me.I have a table with DBName, Size, RptDate that looks like this but with a lot more data and 2 years worth...
View ArticleQuery BOM
I need some directio for querying a BOM by project numberThe following is a table of records of whet I need.Project number Division 1 HVD3...
View ArticleHow to i convert a date time feild to be able to compare times that fall over...
the current format of my date and time feilds (work date, start time & end time) is :2013-07-09 20:00:00.0I need to return the time component as 24hr value (hh:mm) for start end end time feilds. I...
View ArticleRecursive sum in SQL 2005
Hello,I've reviewed quite a few recursive examples online, but unable to yet find a solution to my issue. I'm either missing something obvious or unable to apply the concepts. It'll be great if someone...
View Articledifference between these 2 queries
I have the following query that I would like to understand what is happeningcreate table #tmpclients (id int not null) insert into #tmpclients values ('1') insert into #tmpclients values ('2') insert...
View ArticleConverting RTF in a text column to plain text in bulk
Hello friends,I have a SQL Server 2008R2 table with a few fields of "text" data typethat contain rich text. I have to downstream this data and therecipient cannot handle rich text. I need to figure out...
View ArticleEfficient Cumulative Sum Calculation
Hello,Please can anyone advice my how to create cumulative sum efficiently? My data structure could be represented by the example below:CustomerIDProductIDPurchaseOrderIDQuantityCumulative...
View ArticleSplit the value into multiple values across the row
I have the values in the following waySourceTestRT,59,79 LT,59 RT,59,79,51FTI want the result set in the following wayExpected Result SetTest Test1 Test2 Test3...
View ArticleLinked Server returns only one row while reading remote server registry
The below script is to read registry information using linked server, however it returns only one row instead of multiple rows.SELECT a.* FROM OPENQUERY(LinkedServerName, 'SET FMTONLY OFF; Exec (''...
View Articlesys.internal_tables
HI,I noticed there few thing got automatically created in this tableSELECT * From sys.internal_tablesmsdn said when we create index on xml it create automaitic entries.but pleasea tel me can i also...
View Article