Viewing 15 posts - 1,321 through 1,335 (of 1,923 total)
happy to help! u r welcome , Maina! 🙂
July 21, 2010 at 2:59 am
Try this, sorry, i dint check it first
select distinct table_name from information_schema.columns
EXCEPT
select distinct table_name from information_schema.columns
where column_name in ('A','B')
July 20, 2010 at 8:07 am
Easily possible. Try "DelimitSplit8K Jeff Moden" in the site's search, you will find an excellent solution for your problem.
July 20, 2010 at 5:26 am
If there are diffrent number of rows getting returned by the 2 queries, then u please remove the "WHERE" clause after the cross join..
July 20, 2010 at 5:23 am
oliver.morris (7/20/2010)
Sorry, thats what I did try. Did you mean to change the two lines.Many Thanks,
Oliver
Yes oliver, changed from
SELECT CAST(10.086 AS NUMERIC(20 , 2 [/i] ))
SELECT...
July 20, 2010 at 5:22 am
Then i guess, CROSS JOIN will help you, as in
WITH CTE1 as
(
select Jan, Feb, Mar,
RN = ROW_NUMBER() OVER(ORDER BY (SELECT 0))
...
July 20, 2010 at 5:19 am
Hi there, try this:
select distinct table_name from information_schema.columns
where column_name not in ('A','B')
order by table_name
Replace 'A' 'B' with your column names...
HTH
July 20, 2010 at 5:14 am
oliver.morris (7/20/2010)
Thanks for the reply using numeric
SELECT CAST(10.086 AS NUMERIC(20 , 2))
SELECT CAST (10.8 AS NUMERIC(20 , 2))
returns
10.09
and 10.80 - but I would like it to report 10.8 because...
July 20, 2010 at 5:11 am
You can use JOINS , specifically CROSS JOINS to acheive that.. but i have a query, any columns that are common to both?
July 20, 2010 at 4:54 am
Try this and let us know if this worked for you!
NUMERIC (A , 1) ?
July 20, 2010 at 4:50 am
piortasd (7/15/2010)
ColdCoffee (7/15/2010)
Does your table have any primary key to work on, apart from those 2 columns?yes it have a primary key
can u post the table structure and some sample...
July 15, 2010 at 9:30 am
Ok even if it doesn, try this:
if object_id('tempdb..#temp') is not null
drop table #temp
create table #temp
(name varchar(10), amount int )
insert into #temp
...
July 15, 2010 at 9:27 am
Does your table have any primary key to work on, apart from those 2 columns?
July 15, 2010 at 9:16 am
This will be useful only in VSTF or code-maintenance... As SQL Server cleverly distinguishes between objects, i dont think naming it with "tab" is mandatory..
July 15, 2010 at 6:27 am
david.c.holley (7/13/2010)
July 13, 2010 at 7:00 pm
Viewing 15 posts - 1,321 through 1,335 (of 1,923 total)