Int(4) coln. Could someone please explain how to do this..??
thanks
Sunitsjoshi (sjoshi@.ingr.com) writes:
> I need to compare and update a Binary(8) coln with values from an
> Int(4) coln. Could someone please explain how to do this..??
No, because I don't know how you want to compare four bytes with eight.
The standard recommendation is to include:
o CREATE TABLE statemens for your table(s)
o INSERT statements with sample data.
o The desired result given the sample data.
That permits people who tackle your problem to post a tested solution.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||CREATE TABLE [dbo].[COREBaseClass] (
[oid] [uniqueidentifier] NOT NULL ,
[ConditionID] [int] NOT NULL ,
[persistentFlag] [int] NOT NULL ,
[UIDCreator] [uniqueidentifier] NOT NULL ,
[UIDLastModifier] [uniqueidentifier] NOT NULL ,
[DateCreated] [smalldatetime] NOT NULL ,
[DateLastModified] [smalldatetime] NOT NULL ,
[ApprovalStatus] [int] NOT NULL ,
[ApprovalReason] [int] NOT NULL ,
[tsRelations] [int] NOT NULL ,
[ts] [int] NOT NULL
)
CREATE TABLE [dbo].[COREProxy] (
[oid] [uniqueidentifier] NOT NULL ,
[dwProperties] [int] NOT NULL ,
[sourceTimeStamp] [binary] (8) NOT NULL ,
[COREPersistentFlags] [int] NOT NULL ,
[ts] [int] NOT NULL ,
[tsRelations] [int] NOT NULL
)
These are the 2 tables and I need to update COREProxy.sourceTimeStamp
with the value of COREBaseClass.ts wherever they are not the same.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||Sunit Joshi (sjoshi@.ingr.com) writes:
> CREATE TABLE [dbo].[COREBaseClass] (
> [oid] [uniqueidentifier] NOT NULL ,
> [ConditionID] [int] NOT NULL ,
> [persistentFlag] [int] NOT NULL ,
> [UIDCreator] [uniqueidentifier] NOT NULL ,
> [UIDLastModifier] [uniqueidentifier] NOT NULL ,
> [DateCreated] [smalldatetime] NOT NULL ,
> [DateLastModified] [smalldatetime] NOT NULL ,
> [ApprovalStatus] [int] NOT NULL ,
> [ApprovalReason] [int] NOT NULL ,
> [tsRelations] [int] NOT NULL ,
> [ts] [int] NOT NULL
> )
> CREATE TABLE [dbo].[COREProxy] (
> [oid] [uniqueidentifier] NOT NULL ,
> [dwProperties] [int] NOT NULL ,
> [sourceTimeStamp] [binary] (8) NOT NULL ,
> [COREPersistentFlags] [int] NOT NULL ,
> [ts] [int] NOT NULL ,
> [tsRelations] [int] NOT NULL
> )
> These are the 2 tables and I need to update COREProxy.sourceTimeStamp
> with the value of COREBaseClass.ts wherever they are not the same.
But how? If ts is 4711, what do you want in sourceTimeStamp?
0x126700000000000, 0x0000126700000000 or 0x000000000001267?
If the number is 47114711, do you want:
0xE9D702CE00000000, 0x02CEE9D700000000 or 0x0000000002CEE9D7?
In my previous post, I said:
> The standard recommendation is to include:
> o CREATE TABLE statemens for your table(s)
> o INSERT statements with sample data.
> o The desired result given the sample data.
> That permits people who tackle your problem to post a tested solution.
I did not say this only for fun. If you cannot give a good specification
to the problem you have, you will either get no solution at all or
You can say things like:
convert(binary(8), ts) or convert(int, sourceTimeStamp)
But whether this gives you the values you are looking for, I can't
say, because I don't know what you are looking for.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||I would need 0x126700000000000 as below:
thanks
Sunit
---------------
But how? If ts is 4711, what do you want in sourceTimeStamp?
0x126700000000000, 0x0000126700000000 or 0x000000000001267?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||Sunit Joshi (sjoshi@.ingr.com) writes:
> I would need 0x126700000000000 as below:
And what about 47114711?
0xE9D702CE00000000, 0x02CEE9D700000000 or 0x0000000002CEE9D7?
And why do you refuse to post:
> The standard recommendation is to include:
> o INSERT statements with sample data.
> o The desired result given the sample data.
If you are not prepared to put any effort into your problem, why do
you expect someone else to do it?
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
No comments:
Post a Comment