Viewing 15 posts - 91 through 105 (of 205 total)
I got it.
USE [DatabaseName]
GO
SELECT column_name 'Column Name',
data_type 'Data Type',
CHARacter_maximum_length 'Maximum Length'
FROM information_schema.columns
WHERE table_name = 'TableName'
GO
October 1, 2013 at 7:40 am
Chris, thank you again. This is a magic.
I need to learn
"ROW_NUMBER() OVER(PARTITION BY ID ORDER BY COLOR) - AUTOID"
Would you mind to explain more about this statement?
September 12, 2013 at 3:03 pm
Thank you very much.
This is exatly what I need.
The last question is how to delete duplicate records before output?
ID-------DATEFROM-----------------DATETO--------------------COLOR
-----------------------------------------------------------------------
1112012-01-10 00:00:00.0002012-03-16 00:00:00.000BLUE
1112012-01-10 00:00:00.0002012-03-16 00:00:00.000BLUE
1112012-04-05 00:00:00.0002012-06-16 00:00:00.000GREEN
1112012-04-05 00:00:00.0002012-06-16 00:00:00.000GREEN
1112012-07-17 00:00:00.0002012-10-10 00:00:00.000BLUE
1112012-07-17 00:00:00.0002012-10-10...
September 12, 2013 at 2:27 pm
Here is my ddl. Please help.
--===== If the test table already exists, drop it
IF OBJECT_ID('TempDB..#mytable','U') IS NOT NULL
...
September 12, 2013 at 12:29 pm
That is what boss whant.
The sample data sort by DATEFROM but once COLOR change, it need to re-group and need min(DATEFROM) adn max(DATETO) again.
September 12, 2013 at 12:03 pm
How to post ddl?
I list the sample data and result I need again as below.
Sample data:
ID--DATEFROM-DATETO-----COLOR
--------------------------------
111 01/10/2012 01/11/2012 BLUE
111 02/02/2012 02/02/2012 BLUE
111 03/15/2012 03/16/2012 BLUE
111 04/05/2012 04/05/2012 GREEN
111 05/25/2012 05/26/2012...
September 12, 2013 at 9:53 am
No, this result is not right.
If I use this query, the result is not same as I expected.
September 12, 2013 at 9:01 am
This will delete entire row.
What I need is to delete data in [ORDERDATE] cell and keep bbb in [NAME] field.
August 16, 2013 at 7:09 am
If I change top 200 to top 1000, does this change only apply for my account?
August 14, 2013 at 8:02 am
Thank you so much, richard.noordam
This is just what I am looking for.
August 13, 2013 at 3:14 pm
richard.noordam, I just use your way but I am tired to change 200 every time.
I just want to find a way to modify SQL server setting to make job easier.
August 13, 2013 at 3:07 pm
Works like magic.
Thanks
August 6, 2013 at 12:43 pm
Viewing 15 posts - 91 through 105 (of 205 total)