Showing posts with label india. Show all posts
Showing posts with label india. Show all posts

Monday, March 26, 2012

Need HELP

I have a string 'I Love India'

I want to write a query that will display o/p in following format--

I

LOVE

INDIA

all in seperate lines

Thanks,

Ankur

The code below will meet your very specific requirement.

Are you looking for a solution that you can utilise for any text string containing spaces?

Chris

SELECT t.[Text]

FROM

(SELECT 1 AS [ID], 'I' AS [TEXT] UNION

SELECT 2, 'LOVE' UNION

SELECT 3, 'INDIA') t

ORDER BY T.[ID]

|||

Use a variation of Jen Seussmeyer's SPLIT function, located here:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=326300&SiteID=1

Or, if you are really attempting to simulate an array, check out these resources:

Arrays and Lists in SQL Server
http://www.sommarskog.se/arrays-in-sql.html
http://www.realsqlguy.com/?p=9
http://www.aspfaq.com/2248
http://www.projectdmx.com/tsql/sqlarrays.aspx
http://realsqlguy.com/twiki/bin/view/RealSQLGuy/ParseDelimitedStringToTable
2005- http://omnibuzz-sql.blogspot.com/2006/06/interesting-queries-using-recursive.html
http://solidqualitylearning.com/Blogs/dejan/archive/2004/10/22/200.aspx

Saturday, February 25, 2012

nee stored procedure please help

Dear Experts,
I'm vinod, a junior DBA. working in HYD, india. i need one stored procedure.

Using one procedure i want to know the columns that are associated with the primary key and the name of the primary key.


The output should be as follows


Table Name PK_Constraint Name Columns

TABLE017 PK_TABLE009 COLUMN001

TABLE017 FK_TABLE009 COLUMN002

please send me the stored procedure, it will be a great help for me. thanks in advance.
vinod.mallolu@.exensys.com
vinodselect kcu.Table_Name, kcu.Constraint_Name, kcu.Column_Name from information_schema.table_constraints tc join information_schema.key_column_usage kcu
on tc.Constraint_Name = kcu.Constraint_Name and tc.Constraint_Type = 'PRIMARY KEY'

Mahesh|||i'M TRYING WITH THAT FRIEND. THANK YOU VERY MUCH FOR YOU REPLY