Viewing 15 posts - 121 through 135 (of 171 total)
Like it?
create table TableA (textname char(3))
GO
insert into tableA values ('ABC'),('DEF'),('GHI')
GO
create table TableB (id int, ind tinyint, textname char(3))
GO
insert into tableB values
(101,1,'ABC')
,(102,1,'ABC')
,(103,2,'ABC')
,(104,2,'ABC')
,(105,1,'DEF')
,(105,1,'DEF')
,(106,2,'DEF')
,(107,1,'GHI')
,(108,2,'GHI')
GO
select *
from tableA a
cross join TableB b
where...
February 2, 2012 at 12:48 pm
It ill not work.
You are selecting from a STRING not from a table.
If are you trying do create a generic "select * from" using a parameter to pass the name...
February 2, 2012 at 12:36 pm
The cast to float trick is good for get rid of the hour:minute:second.millisecond part.
But as I said its imprecise if used direclty to hour/minute/second by multiply and division.
That's why I...
February 2, 2012 at 11:28 am
You solution is not bad but:
1. My method can be adapted as well, think about it.
2. Any implementation of datetime rely on internaly using a kind of float (and it...
February 2, 2012 at 9:24 am
Svakka,
I worked with Oracle and for SQL Server most cursor based "traditional ways" can be done using relational logic.
Tell more about your goal.
Its a insert, update, delete?
Can you join dept...
February 2, 2012 at 8:40 am
The records seing insert are wrong since only dates like '30-01-2012' ill fail, poping a error message.
Your database language most probabily is seted to US-en (default value).
You can change instance,...
February 2, 2012 at 5:43 am
You can cast the datetime to float and apply ceiling or floor to it.
select GETDATE(), CAST(getdate() as float), CAST(ceiling(cast(getdate() as float)) as datetime)
select GETDATE(), CAST(getdate() as float), CAST(floor(cast(getdate() as float))...
February 2, 2012 at 4:59 am
Before going further make sure this column is not referenced by a FK.
If there are a FK pointing to that column dont touch it!
If you realy want to repopulate the...
February 2, 2012 at 4:54 am
Someone droped the index at production?
If can only make selects at production box try a select top 10 id column order by id column for each table.
if its too slow...
February 1, 2012 at 11:17 am
chowdarysurendranath.c (2/1/2012)
...2) select t1.col1,t2.col1 from t1 full outer join t2 on t1.col1 <> t1.col1
...
t1.col1 <> t1.col1
this clause returns false for every row (is the same as 1 <> 1...
February 1, 2012 at 10:25 am
A common misconception about null lies in most people thinks: null = nothing or even null = 0.
Null sounds more "I dont know".
"null = null" sounds like "what's in my...
February 1, 2012 at 9:18 am
"can't do" attitude is bad for everyone and works both sides.
Just go direct to the point: Deactivating this messagens ill deactivate also usefull messages and you cannot guarantee correctness =...
January 31, 2012 at 11:56 am
I understand the team worry about extending the size of the column.
It can broke some procedure expecting a 245 size string.
I dont know you DB or app, but I know...
January 31, 2012 at 11:24 am
Let me clarify,
Alter the column to varchar(max) AND create the trigger, it ill avoid you to set off warnings (setting it off is a bad, bad, very bad idea)
and keep...
January 31, 2012 at 11:08 am
Can You rely on a trigger to safe truncate the data to the column?
And tell your team it's not acceptable to the UI to sent invalid data to the DB!
And...
January 31, 2012 at 10:50 am
Viewing 15 posts - 121 through 135 (of 171 total)