February 5, 2010 at 3:39 am
I have 3 values e.g 100,200,300 and without inserting those values into any table I have to display those value in row wise.
Example
100,200,300
after Query it will display like
100
200
300
February 5, 2010 at 4:37 am
February 5, 2010 at 4:40 am
Use union
February 5, 2010 at 7:55 am
Any Idea how to insert the number of static data into a table
example:
I have data like 'AAA','BBB','CCC'...........................'ZZZ'
without write the individual insert statement is it possible to insert those values into a single table
table structure is the following
Create table Temp (sData varchar(10))
is there any way to insert those values into Temp table??
February 5, 2010 at 9:52 am
Does this do what you want?
select top 26 replicate(char( row_number() over (order by object_id)+64),3)
from sys.objects
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
February 5, 2010 at 9:03 pm
vyas (2/5/2010)
Use union
Please show us how. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
February 5, 2010 at 9:06 pm
WayneS (2/5/2010)
Does this do what you want?
select top 26 replicate(char( row_number() over (order by object_id)+64),3)
from sys.objects
Heh... I can't tell if they want a split function or what you did.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 8, 2010 at 6:20 am
Query you provided is not generic one.
please provide a generic query.with use that query we can split and insert into a table.
February 9, 2010 at 7:18 am
See the section on string splitting in Jeff Moden's tally table article. Link is in my sig below
Edit: Apologies I see that somone has already pointed you to that article earlier.
Doesn't mean you shouldn't read it though.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply