Viewing 15 posts - 6,826 through 6,840 (of 7,164 total)
I would recommend handling this kind of thing outside the database...e.g. pull the resultset into a memory-resident data structure (like an ADO.NET DataTable) then remove all columns from the data...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 23, 2011 at 10:53 am
malleswarareddy_m (3/23/2011)
...i need the child tables type also using this query.It is showing through tabletype then right click view dependencies and it showing child items in tree
nodes.
...
It sounds like maybe...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 23, 2011 at 10:43 am
May I ask how you ended up with delimited strings in a column? How is this data entering the system? Tools like BCP, BULK INSERT and SSIS are designed to...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 23, 2011 at 10:23 am
Jeff Moden (3/23/2011)
opc.three (3/22/2011)
In general dynamic sql is a bad idea and you should avoid it...
In general, I disagree. 😀 There are some very easy steps that can...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 23, 2011 at 8:39 am
belgarion (3/22/2011)
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 22, 2011 at 5:37 pm
sku370870 (3/22/2011)
SELECT [SalesOrderID], [OrderDate], [Status],...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 22, 2011 at 5:04 pm
Jinx! Diet Coke please Wayne 😎
Just passing along the knowledge...Gail's article is the de facto standard on the topic.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 22, 2011 at 4:46 pm
In general dynamic sql is a bad idea and you should avoid it...however your example code is building "catch all query". Have a look at this article:
http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/%5B/url%5D
In your case the...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 22, 2011 at 4:36 pm
BCP was designed to be fast...not tolerant of bad data or feature-rich.
If you have data quality issues then you can ask for better data or cleanse it after you...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 22, 2011 at 3:42 pm
GSquared (3/22/2011)
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 22, 2011 at 2:29 pm
Try this:
IF OBJECT_ID('test') > 0
DROP TABLE test
GO
CREATE TABLE test (col VARCHAR(20))
GO
INSERT test
(
...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 22, 2011 at 2:15 pm
SQL_Padawan_Learner (3/22/2011)
parthi-1705 (3/22/2011)
Have a look on this
declare @flg tinyint
Select @flg= case when cmptlevel=100 then 1 when cmptlevel=90 then 2 when cmptlevel=80 then 3 end
from master.dbo.sysdatabases
Select @flg
IF...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 22, 2011 at 1:31 pm
mtassin (3/22/2011)
opc.three (3/22/2011)
What you want is a dynamic cross-tab. Here is a comprehensive article about how to do that...and why cross-tabs almost always outperform the built-in PIVOT operator:http://www.sqlservercentral.com/articles/Crosstab/65048/%5B/url%5D
Jeff writes great...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 22, 2011 at 1:05 pm
I cannot think of how you could know programmatically in T-SQL that the first one occurred...it's a popular topic right now though. Here is a related thread:
http://www.sqlservercentral.com/Forums/Topic1082102-338-1.aspx
As a side note...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 22, 2011 at 12:26 pm
mtassin (3/22/2011)
He definately wants to use Pivot here...
Sorry, I misunderstood the original intent behind the question.
sku370870 (3/22/2011)
... are [Project 1] and [Project 2] hard-coded?
In the real data...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
March 22, 2011 at 11:54 am
Viewing 15 posts - 6,826 through 6,840 (of 7,164 total)