Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
T-SQL
»
convert DateTime to BigInt
33 posts, Page 2 of 4
««
1
2
3
4
»
»»
convert DateTime to BigInt
Rate Topic
Display Mode
Topic Options
Author
Message
munishprathap
munishprathap
Posted Tuesday, January 20, 2009 4:42 AM
Grasshopper
Group: General Forum Members
Last Login: Tuesday, November 03, 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 entries
only as bigint
Post #639799
ChrisM@Work
ChrisM@Work
Posted Tuesday, January 20, 2009 4:50 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 8:51 AM
Points: 5,608,
Visits: 10,970
munishprathap (1/20/2009)
not lik tht,
values entered in these column was datetime only but in future i need to make entries
only as bigint
How 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 Shaw
For 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 Moden
Exploring Recursive CTEs by Example
Dwain Camps
Post #639801
munishprathap
munishprathap
Posted Tuesday, January 20, 2009 4:55 AM
Grasshopper
Group: General Forum Members
Last Login: Tuesday, November 03, 2009 5:24 AM
Points: 10,
Visits: 18
we cant predict no. of rows affected assume tht tables have 10 rows
Post #639807
ChrisM@Work
ChrisM@Work
Posted Tuesday, January 20, 2009 4:57 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 8:51 AM
Points: 5,608,
Visits: 10,970
munishprathap (1/20/2009)
we cant predict no. of rows affected assume tht tables have 10 rows
How 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 Shaw
For 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 Moden
Exploring Recursive CTEs by Example
Dwain Camps
Post #639810
munishprathap
munishprathap
Posted Tuesday, January 20, 2009 5:00 AM
Grasshopper
Group: General Forum Members
Last Login: Tuesday, November 03, 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
steveb.
steveb.
Posted Tuesday, January 20, 2009 5:12 AM
SSCrazy
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 7:42 AM
Points: 2,802,
Visits: 7,103
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
Jeff Moden
Jeff Moden
Posted Tuesday, January 20, 2009 5:19 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 1:51 PM
Points: 32,906,
Visits: 26,789
munishprathap (1/19/2009)
Thanks Jeff
according to my requirement i need to keep the one column type as bigint but unfortunately
i 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 as
Identity with primary key.
My Table Script
CREATE 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 "
R
ow-
B
y-
A
gonizing-
R
ow".
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."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #639818
ChrisM@Work
ChrisM@Work
Posted Tuesday, January 20, 2009 5:20 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 8:51 AM
Points: 5,608,
Visits: 10,970
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 Shaw
For 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 Moden
Exploring Recursive CTEs by Example
Dwain Camps
Post #639820
munishprathap
munishprathap
Posted Tuesday, January 20, 2009 5:20 AM
Grasshopper
Group: General Forum Members
Last Login: Tuesday, November 03, 2009 5:24 AM
Points: 10,
Visits: 18
No
Post #639821
ChrisM@Work
ChrisM@Work
Posted Tuesday, January 20, 2009 5:25 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 8:51 AM
Points: 5,608,
Visits: 10,970
munishprathap (1/20/2009)
No
If 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 Shaw
For 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 Moden
Exploring Recursive CTEs by Example
Dwain Camps
Post #639824
« Prev Topic
|
Next Topic »
33 posts, Page 2 of 4
««
1
2
3
4
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.