Converting A Number To Hexadcimal

Feb 25, 2004

Is there any function in SQL-Server which converts a number into its Hexadecimal equivalent..? if not, how should I convert a number to its hexadecimal equivalent..?

Thanks
Jake

View 2 Replies


ADVERTISEMENT

Converting Number To Text

Jul 20, 2005

Hi,I have two tables. One of them has a text field, and the other has a numeric(integer) field that serves a similar purpose. I want to connect (UNIONactually) the two tables, and store the text from the first table in thesame field as the number from the other.For example:SELECT TextID AS IDFROM W1UNIONSELECT NumericID AS IDFROM W2The above query results in a type mismatch error due to trying to store anInt in a text field. I have tried the SQL CONVERT function, but the docsseem to indicate that it is just for Dates. In any case, it hasn't workedfor me.Any ideas?Thanks!

View 3 Replies View Related

Converting Date To Number And Concatenating

Nov 1, 2013

I've converted a date field to a number. I'd then like to concatenate this with another number field.

(CONVERT(bigint,convert(datetime,[Date of Incident])) + ' ' + cast([Incident Number]as nvarchar(4))) as 'lookup'

Using the code above only returns the converted date to number field.

View 2 Replies View Related

Converting A Text Field To Number

Jul 20, 2005

I have a table with over a million rows and one of the fields containsamounts of money in text format.What is the most efficient way of converting this field to a numberformat that I can sum on?Regards,Ciarán

View 3 Replies View Related

Converting A Number Into A Date Type Using An Expression

Jul 2, 2007

I am loading data from an iseries into a sql server 2005 DB. Our dates are stored as a numeric value in a format of CYYMMDD where C = Century indicator 20'th is 0 and 21'st is 1, YY = Year, MM = Month and DD = Day!



Today would be 1070701. Now I want to use a derived column which which would be of type date using an expression to do the conversion.



Usually, we would add 19000000 to the number to give us 20070701 then I'd convert it to a string and then substring into a date format.



I'm just getting started with SQL 2005 so I don't know how to do this using an expression.



Any help would be greatly appreciated.



Thanks,

Gray

View 3 Replies View Related

The Number Of Requests For XXXServerXXXUser Has Exceeded The Maximum Number Allowed For A Single User

Oct 15, 2007



I have created a local user on Report Server Computer and the user has the administrative rights.
When i try to connect Report Server (http://xxx.xxx.xxx.xxx/reportserver) with this user's credantials. (ReportServer directory security is set -only- to Basic Authentication. ).
I get the following error.


Reporting Services Error
--------------------------------------------------------------------------------

The number of requests for "XXXServerXXXUser" has exceeded the maximum number allowed for a single user.
--------------------------------------------------------------------------------
SQL Server Reporting Services


Then i try to login using a different user with administrative rights on the machine, i can logon successfully.
The system is up for a month but this problem occured today?!? What could be the problem?!?

View 2 Replies View Related

How To Enter More Number Of Rows In A Table Having More Number Of Columns At A Time

Sep 24, 2007

Hi

I want to enter rows into a table having more number of columns

For example : I have one employee table having columns (name ,address,salary etc )
then, how can i enter 100 employees data at a time ?

Suppose i am having my data in .txt file (or ) in .xls

( SQL Server 2005)

View 1 Replies View Related

Transact SQL :: How To Select A Number Less Or Equal Than A Supplied Number

Jun 23, 2015

Got this query and I need the following result;

declare @NumberToCompareTo int
set @NumberToCompareTo = 8
declare @table table
(
number int
)
insert into @table 
select 4

[Code] ....

The query selects 4 and 5 of course. Now what I'm looking for is to retrieve the number less or equal to @NumberToCompareTo, I mean the most immediate less number than the parameter. So in this case 5

View 4 Replies View Related

How To Change A Decimal Number To Percent Format Number?

Oct 8, 2006

in my sql, i want to change a decimal number to percent format number, just so it is convenient for users. for example there is a decimal number 0.98, i want to change it to 98%, how can i complete it?

thks

View 4 Replies View Related

Limitations In Term Of Number Of Tasks And Number Of Columns

Jun 5, 2007

Hi,

I am currently designing a SSIS package to integrate data into a data warehouse fact table. This fact table has about 70 columns among which 17 are foreign keys for dimension tables.

To insert data in that table, I have to make several transformations and lookups. Given the fact that the lookups I have to make are a little complicated, I have about 70 tasks in my Data Flow.
I know it's a lot, but I can't find a way to make it simpler. It seems I really need all these tasks.

Now, the problem is that every new action I try to make on the package takes a lot of time. At design time, everything is very slow. My processor is eavily loaded each time I change a single setting in one of the tasks, and executing the package in debug mode takes for ages. If I take a look at the size of my package file on disk, it's more than 3MB.

Hence my question : Are there any limitations in terms of number of columns or number of tasks that can be processed within a Data Flow ?

If not, then do you have any idea why it's so slow ?

Thanks in advance for any answer.

View 1 Replies View Related

How To Number Records / Duplicates Receiving Same Number

Feb 19, 2013

I have a large table of customers. I would like to add a column that contains an integer, unique to that customer. The trick is that this file contains many duplicate customers, so I want the duplicates to all have the same number between them.the numbers dont have to be sequential or anything, just like customers having the same one.

View 8 Replies View Related

How To Query A Number (street Number)...

Jul 30, 2007

I have a table that has a street number field.
if the user types in a street number of '2' i would like to return all street numbers the begin with 2 (2,20,21, 200, 201,205,2009,...)
how can this be done.

View 10 Replies View Related

Maximum Number Of Tables - Is 4^15 Big A Number?

Nov 26, 2006

Hello people,I might sound a little bit crazy, but is there any possibility that youcan incorporate 4^15 (1,073,741,824) tables into a SQL Database?I mean, is it possible at all? There might be a question of whereanyone would want so many tables, but i'm a bioinformatics guy and I'mtrying to deal with genomic sequences and was coming up with a newalgorithm, where the only limit is the number of tables I can put intoa Database.So, can you please advise if its possible to put in so many tables intoa SQL database? Or is the Bekerley DB better?

View 3 Replies View Related

Page Number && Records Number

Jun 20, 2006

1. how to show page number & total page number in report body?

2. how to show total records number?

View 25 Replies View Related

Format A Number For Use As Number In Excel

Dec 20, 2006

I want to format a number like "#,##0.00" in order to handle it in Excel as a number (i.e. compute a sum).

Excel is able to show a number in a specail format and still allow to compute with ...

Thanks in advance,

Peter

View 3 Replies View Related

Field LIKE Number,number,number

Nov 26, 2006

I am testing something in Visual Basic
that talks to a database and I want to
filter results by -> field1 like "###".
However, that 'like' and '#' is VB syntax.
How do you say that in SQL?

View 7 Replies View Related

Converting A Value

Nov 8, 2006

I have a select statement like this:
 select IsVerified from AppForm
 the IsVerified returns 'True'  ...can I convert that value to 'Yes' by using some sort of function?

View 2 Replies View Related

Converting PL/SQL

Jun 9, 2005

I have an anonymous PL/SQL block that I'd like to Convert into T-Sql and im completly stumped on 2 things:

What is the equvilent of a Cursor and how do I declare one?
How do I declare an anonymous block?

 my code wrote:
Declare
     -- Type Declarations
     Type ct_UConstr_Cur is REF CURSOR;

     v_Begin Integer := 0;
     v_End   Integer := 0;
     v_PageSize Integer :=0;

     c_Data ct_UConstr_Cur;

    
Begin
     v_PageSize := :PageSize;
     v_Begin := ( v_PageSize * :PageNumber) - 1;
     v_End := v_Begin + v_PageSize;

    
     Open c_Data For
          Select * from (
               Select A, B, C, ROWNUM as RN from Foo;
          ) where RN >= v_Begin AND RN < v_End;
     :cur := c_Data;
END;
/

View 2 Replies View Related

Converting Hex To Int

Sep 15, 1999

Does any one know of a tool SQL 7 has for doing this kind of conversion?

View 2 Replies View Related

Help Converting .xls To SQL

Jun 29, 2007

ok i am very very new at this, ive downloaded the SQL 2005 trial and i can not seem to figure this out. I have a .xls i want to make a active sql page out of. please please help me with this

the .xls is here http://www.mediafire.com/?5jtgzcxb232

feel free to email me @
bevanglynn@gmail.com

thanks

View 1 Replies View Related

Converting (too Big)Raw Into Hex

May 25, 2007

Hi there,

Here at my work(in Germany) i have a big problem:

Once a week there is a sqlscript, which should run and store data to a txt file.

There is a tablle in which imagedata is stored in RAW format(that one with small boxes, Qmarks and dots...).

Now i want to export it to the txtfile as HEX, so i can decode it by php further.

With the thumbnail, also stores there everything is fine, the SQL looks that way:

SELECt hex(thumbnail) FROM picTable where id_pic=54985

The Data is then displayed as HEX. But the standart picture is to big. When i use the statement:
SELECt hex(bigpic) FROM picTable where id_pic=54985

i got the error message:

An error occurred while running the query.

The data type, length, or value of argument 1 of HEX is invalid.

(SQL code = -171, SQL state = 42815)

After some research i found that the maximum lenght is 16 336 bytes for the HEX-operation. The picture is nearly 30 000 bytes... :shocked:
Have anyone an idea how to fix that?
I am not able here to accsess to the database direct...

I have been working for days on it.

View 4 Replies View Related

Converting A SP To UDF

May 22, 2007

Hi All,
I am in the process of changing the cursor based Proc with temp tables, I have one of the Procs which is beening used to get a value for the cursor, I am thinking if it is possible to change it to a function so that I can update the column at once.

[code]
CREATE PROCEDURE[dbo].[get_cre_tijd_id] (
@tijd_datum datetime,
@tijd_id int output
)
AS


DECLARE @datum_tekst VARCHAR(25)
DECALRE @datum_tijd DATETIME

SET @datum_tekst = CAST(@tijd_datum AS VARCHAR);
SET @datum_tijd = CONVERT(DATETIME, SUBTRING(@datum_tekst, 1, 12), 21 )
SET @tijd_id = (SELECT tijd_id FROM dim_tijd WHERE tijd_datum = @datum_tijd )

IF @tijd_id IS NULL
BEGIN
INSERT INTO dim_tijd (
tijd_datum
, jaar
, kwartaal
, maand
, dag
, periode
, week
, weekdag
)
VALUES ( @datum_tijd
, datepart(yy,@tijd_datum)
, datepart(q,@tijd_datum)
, datepart(m,@tijd_datum)
, datepart(d,@tijd_datum)
, ceiling(datepart(wk,@tijd_datum)/4.00)
,dbo.get_iso_week(@tijd_datum)
, datepart(dw,@tijd_datum)
)

SET @tijd_id = (SELECT tijd_id FROM dim_tijd WHERE tijd_datum = @datum_tijd)
END

Necessity is the mother of all inventions!

View 4 Replies View Related

Converting From Dd.hh:mm:ss

Sep 26, 2007


Hello all,

I am subtracting two datetimes (last(fields!FaultStart.value))-(first(fields!FaultStart.value)) this works fine and returns a value in a textbox 5.23:44:23. I need to convert that number to minutes I am very new to sql programming and do not know very many commands. I am using Microsoft sql server 2005 express edition along with sql server business intelligence development studio where I placed a textbox and entered the expression above. I have also tried to use datediff command
=datediff(second, (last(fields!FaultStart.value)),(first(fields!FaultStart.value)))
but the second is underlined and tooltips says WRONG NUMBER OF ARGUMENTS I€™ve tried
=datediff(€œsecond€?, (last(fields!FaultStart.value)),(first(fields!FaultStart.value)))
and
=datediff(€œ€™second€™€?, (last(fields!FaultStart.value)),(first(fields!FaultStart.value)))
also for second I€™ve tried seconds. Any help would be most appreciated

Thanks

Ed

View 3 Replies View Related

Converting To UTC

Nov 8, 2007

I haven't seen a really good solution for this in amongst the threads about UTC. What I want to do is convert a date time to UTC, taking into account whether or not it is in DST, and be able to deploy this code to any server in the world without customizing the SQL code, and have it know how to convert, as long as a I feed it the local Time Zone.


I would think this would be easy because the OS knows at any given time what time zone has what UTC offset, and exactly at what time DST starts and ends. Right now I do this, but it is limited. I have a table that, for each site (there can be more than one site in different time zones) stores the UTC offset and whether or not the site observes DST. New York would have the "Observes_DST" set to 1, Phoenix would have it set to zero. The "Hours_To_UTC" value would be 5 for New York.



This code below assumes all sites are located in Canada or the US, as Canada and the US now use the second Sunday in March and first Sunday in November as the switch over times. (although this would work fine for countries like India and China that don't observe DST).



UPDATE a

SET Time_Arrived_UTC =

CASE

WHEN b.Observes_DST = 1 THEN

CASE

WHEN Month(Time_Arrived) IN (4,5,6,7,8,9,10) THEN

DATEADD(hh,b.Hours_From_UTC - 1,Time_Arrived)

WHEN Month(Time_Arrived) = 3 AND Day(Time_Arrived)- DATEPART(dw,Time_Arrived) >= 7 AND

Day(Time_Arrived) <= 14 AND DATEPART(dw,Time_Arrived) <> 1

then DATEADD(hh,b.Hours_From_UTC - 1,Time_Arrived)

WHEN Month(Time_Arrived) = 3 AND Day(Time_Arrived) > 14

then DATEADD(hh,b.Hours_From_UTC - 1,Time_Arrived)

WHEN Month(Time_Arrived) = 3 AND Day(Time_Arrived) >= 8 AND Day(Time_Arrived) <= 14 AND

DATEPART(dw,Time_Arrived) = 1 AND DATEPART(hh,Time_Arrived) >= 2

THEN DATEADD(hh,b.Hours_From_UTC - 1,Time_Arrived)

WHEN Month(Time_Arrived) = 11 AND Day(Time_Arrived) <= 7 AND DATEPART(dw,Time_Arrived) = 1 AND

DATEPART(hh,Time_Arrived) < 2 then DATEADD(hh,b.Hours_From_UTC - 1,Time_Arrived)

WHEN Month(Time_Arrived) = 11 AND Day(Time_Arrived)- DATEPART(dw,Time_Arrived) < 0 then

DATEADD(hh,b.Hours_From_UTC - 1,Time_Arrived)

ELSE DATEADD(hh,b.Hours_From_UTC,Time_Arrived)

END

ELSE DATEADD(hh,b.Hours_From_UTC,Time_Arrived)

END FROM

Facts_Table a INNER JOIN Site_Info_Lookup_Table b

ON a.Site_Name= b.Site_Name



This works, (and is much more efficient than using a UTC lookup table) and I could probably go about hard coding various other start and end DST datetimes for other time zone DST (Australia and Europe, for example), but that wouldn't be dynamic in case one country makes a change in policy that changes when DST starts and stops, like the US just did.



SQL Server only provides current time UTC conversion--I would think it should have a function like this:



ConvertToUTC(datetimevalue,timezone)



Oracle has a function like that, but it is useless because it doesn't take into account DST, it would for instance just add 5 hours to EST for every date you entered (now that's helpuful!). It is baffling that this function doesn't exist.



I am using Integration Services so I could probably build a script task that would query the OS for DST start and stop times given a particular time zone (if available), but I'm not much of a coder--would be nice to have an easy way to do it in Transact-SQL.



Thanks,

Kayda



View 5 Replies View Related

Converting To Hex

Oct 1, 2006

Hi All,

I'm needing to take a value inputted by a user via html form and convert it to a hex value upon inserting into SQL2000 db. I only need to store the 8 chars after "0x". Is there any T-SQL that can pull this off? CAST or CONVERT? Sorry if this is a silly question and hope I supplied enough info...

Thx,
Mike

View 1 Replies View Related

Converting Data

Dec 7, 2006

Hi I am converting data from old DB to NEW DBIn the OLD table fields like "PhoneNumber" the data enterd are [ 657 985-986,     (03)-987-543,      675(89)00,     ect]Is their any function in sql where I can get rid of all those spaces and () and -  between the numbers as my new field is only numbers and with out spaceOtherwise I have to clean them up manually as I have 1000000 records
cheers
 
 
 

View 1 Replies View Related

Converting Problems

Dec 8, 2006

I have a stored procedure which I user to retur an Email-address from aspnet_Membership (DB-table).
Here is the code:
 ALTER PROCEDURE dbo.StoredProcedure2     @user nvarchar(256) AS DECLARE @id uniqueidentifier SET @id = '' SELECT @id = UserId from aspnet_Users WHERE UserName = @user SELECT Email From aspnet_Membership WHERE UserId = @id
I use StoredProcedure2 in this way:
Dim cmd As SqlCommand = New SqlCommand("StoredProcedure2", MyConnection) cmd.CommandType = CommandType.StoredProcedure
'send in  UserName as @User to StoredProcedure2 cmd.Parameters.Add("@user", SqlDbType.NVarChar).Value = User.Identity.Name.ToString()      'Return EmailAddresse returnValue = cmd.ExecuteScalar()
 Message I get is: 
"Conversion failed when converting from a character string to uniqueidentifier"
Please help...
 
 

View 2 Replies View Related

Converting From MS SQL SERVER

Mar 27, 2007

Hi,
I am developing a project that using the one of the starter kits which use the MS SQL EXPRESS database.The project is almost ready to be launch.
few questions:

I am looking for a good host with good support reasonable paid.
What is my options if I would like to convert from the current database, to other databases like MySql, MS SQL Server or any? which tools can help with this convertions?
thats all, thanks.
 

View 2 Replies View Related

Converting Date

Feb 25, 2008

I have an old table (table1) and a new table (table2).  I need to move some of the data from table1 to table2.
For my example, table1 contains 1 field that is a DateTime, we’ll call it table1_Date.
table2 also contains 1 field that is a SmallDateTime, we’ll call it table2_Date. 
I want to do something like this:
Insert into table2
     table2_Date
Select
     table1_Date
From table1
Where ….. 
I am getting the following error:
The conversion from datetime data type to smalldatetime data type resulted in a smalldatetime overflow error. 
How can I go about converting this on the insert?
 

View 9 Replies View Related

Converting Data

May 27, 2008

hi, 
can any one tell me how to  convert my access data to sql server data. using sql server express edition

View 2 Replies View Related

Converting From MySQL To SQL

Mar 26, 2004

hi..
may i know how to convert from mysql to microsoft sql server ??
is it very troublesome ??
coz its quite a big project..
i need to convert frm mysql to sql..
is there any example or reference?
thanks

View 7 Replies View Related

Converting DateTime

Oct 14, 2004

Hello Everyone and thanks for your help in advance. I have an application that inserts a variety of values into a SQL Server database. Among the columns are three DateTime values. I have code working properly on my test server, but when I port the identical code to my production database, I get the following error:

Arithmetic overflow error converting expression to data type datetime. The statement has been terminated

When I remove any type of insert involving date, the application works. I have tried the date in various formats, for instance "09/12/2001" and "20010912", but still get the same error. Obviously, there must be differences in the SQL Servers, but I have never run into this problem before and the current server is running many applications involving dates. I haven't got a clue as to how to solve this problem. Any help is greatly appreciated. Thanks.

View 1 Replies View Related

Converting Boolean To Bit

Mar 2, 2005

I have a control with checkboxes. The checkbox.checked property returns a boolean value. If I want to insert a record into a table that has a corresponding column of type bit, how do I do it?

I triedCType(myChkBox.checked,String), which returns the strings "True" or "False". But, I get the errorThe name 'True' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.I then tried "CAST(" & CType(myChkBox.checked,String) & ",bit)", but got the same error.

I can write a function that will return a 1 or a 0 but that seems ludicrous. Surely there must be a more elegant way to use the result of a checkbox in an SQL statement.

Thanks
Martin

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved