Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 convert DateTime to BigInt Rate Topic Display Mode Topic Options
Author
 Message
 Posted Tuesday, January 20, 2009 4:42 AM
 Grasshopper Group: General Forum Members Last Login: Tuesday, November 3, 2009 5:24 AM Points: 10, Visits: 18
 not lik tht,values entered in these column was datetime only but in future i need to make entriesonly as bigint
Post #639799
 Posted Tuesday, January 20, 2009 4:50 AM
 SSCrazy Eights Group: General Forum Members Last Login: Thursday, December 1, 2016 10:11 AM Points: 8,587, Visits: 18,753
 munishprathap (1/20/2009)not lik tht,values entered in these column was datetime only but in future i need to make entriesonly as bigintHow many rows are currently affected? “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail ShawFor fast, accurate and documented assistance in answering your questions, please read this article.Understanding and using APPLY, (I) and (II) Paul White Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff ModenExploring Recursive CTEs by Example Dwain Camps
Post #639801
 Posted Tuesday, January 20, 2009 4:55 AM
 Grasshopper Group: General Forum Members Last Login: Tuesday, November 3, 2009 5:24 AM Points: 10, Visits: 18
 we cant predict no. of rows affected assume tht tables have 10 rows
Post #639807
 Posted Tuesday, January 20, 2009 4:57 AM
 SSCrazy Eights Group: General Forum Members Last Login: Thursday, December 1, 2016 10:11 AM Points: 8,587, Visits: 18,753
 munishprathap (1/20/2009)we cant predict no. of rows affected assume tht tables have 10 rowsHow many rows do you have in the table right now? “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail ShawFor fast, accurate and documented assistance in answering your questions, please read this article.Understanding and using APPLY, (I) and (II) Paul White Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff ModenExploring Recursive CTEs by Example Dwain Camps
Post #639810
 Posted Tuesday, January 20, 2009 5:00 AM
 Grasshopper Group: General Forum Members Last Login: Tuesday, November 3, 2009 5:24 AM Points: 10, Visits: 18
 Ok thts great its having 10 rows and one column have DateTime type with values.
Post #639812
 Posted Tuesday, January 20, 2009 5:12 AM
 SSCrazy Group: General Forum Members Last Login: Monday, August 24, 2015 6:12 PM Points: 2,808, Visits: 7,195
 munishprathap (1/20/2009)Ok thts great its having 10 rows and one column have DateTime type with values.Do these date-time values mean anything? what are your rules for converting a date to integer while still keeping the same value as you will not be able to put a datetime into an int column..
Post #639817
 Posted Tuesday, January 20, 2009 5:19 AM
 SSC-Forever Group: General Forum Members Last Login: Today @ 7:14 AM Points: 42,072, Visits: 39,455
 munishprathap (1/19/2009)Thanks Jeffaccording to my requirement i need to keep the one column type as bigint but unfortunatelyi keep it as DateTime after long time i found that it was DateTime Type. so i need to write a Script / Query which updates the Column field type as BigInt from DateTime and set the ID Column asIdentity with primary key.My Table ScriptCREATE TABLE [dbo].Number ([ID] [BIGINT] NOT NULL,[LastModifyBy] [DATETIME] NOT NULL)Please stop and think a minute and I'll give you the answer. What is the purpose of storing a DateTime as a BigInt? I need to know the real reason... not that it's simply a requirement you've been given. --Jeff Moden"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column." Helpful Links:How to post code problemsHow to post performance problems
Post #639818
 Posted Tuesday, January 20, 2009 5:20 AM
 SSCrazy Eights Group: General Forum Members Last Login: Thursday, December 1, 2016 10:11 AM Points: 8,587, Visits: 18,753
 munishprathap (1/20/2009)Ok thts great its having 10 rows and one column have DateTime type with values.Is this table heavily used at present? “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail ShawFor fast, accurate and documented assistance in answering your questions, please read this article.Understanding and using APPLY, (I) and (II) Paul White Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff ModenExploring Recursive CTEs by Example Dwain Camps
Post #639820
 Posted Tuesday, January 20, 2009 5:20 AM
 Grasshopper Group: General Forum Members Last Login: Tuesday, November 3, 2009 5:24 AM Points: 10, Visits: 18
 No
Post #639821
 Posted Tuesday, January 20, 2009 5:25 AM
 SSCrazy Eights Group: General Forum Members Last Login: Thursday, December 1, 2016 10:11 AM Points: 8,587, Visits: 18,753
 munishprathap (1/20/2009)NoIf no other students are using it, why don't you simply script a new table using EM and copy the data into it? “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail ShawFor fast, accurate and documented assistance in answering your questions, please read this article.Understanding and using APPLY, (I) and (II) Paul White Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff ModenExploring Recursive CTEs by Example Dwain Camps
Post #639824

 Permissions