Viewing 15 posts - 2,326 through 2,340 (of 3,221 total)
DECLARE @Num AS Numeric(8)
SET @Num = 73982597
select cast(@Num/1000 as Numeric(8,3))
This will also return what you seem to require
select cast(73982597./1000 as numeric(8,3))
In the code immediately above note the decimal point..
Returns: 73982.597
November 10, 2009 at 2:21 pm
I belive this will give you the results you need.
CREATE TABLE #Codes(Code INT,Subcode INT)
INSERT INTO #Codes
SELECT 1111, 0 UNION ALL
SELECT 1111, 0 UNION ALL
SELECT 222, 0 UNION ALL
SELECT 222, 0...
November 10, 2009 at 8:39 am
Is this what you need?
IF Len(REPLACE(@s,'0','' )) > 0
select substring(@s,patindex('%[^0]%',@s),len(@s))
ELSE
SELECT LEN(REPLACE(@s,'0','' ))
November 9, 2009 at 3:10 pm
Are you using SQL Server Management Studio (SSMS) and displaying the query return in grid mode? If so switch the output to Text mode and the carriage return /...
November 9, 2009 at 10:39 am
gboyer (11/5/2009)
Now I am not an expert in database design but I would say that is not a good design
.
Like many questions about SQL Server the answer is "It all...
November 7, 2009 at 9:36 am
Look in Books On Line (BOL) at:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/41544236-1c46-4501-be88-18c06963b6e8.htm
It will explain in great detail the information available thru the T-SQL previously posted.
Then move on to the new system views available in SQL...
November 5, 2009 at 10:36 am
For a question like yours it would be of great help to those who would try to help you to post the create tables SQL statements, supply some sample data...
November 5, 2009 at 7:57 am
Have you tried using OPENROWSET as SELECT INTO which will create the table in the database.
SELECT * INTO [i]you select the name of the table to be created[/i]...
November 5, 2009 at 7:26 am
Try this and see if it gives you want you need. Contribued by a member of SQLServerCentral whose name I failed to record
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS...
November 5, 2009 at 7:03 am
Go to MSSQLTips.com and search for Michelle Gutzait work she has posted some sample code that will do all that you seem to want and then some more.
Written By: Michelle...
November 4, 2009 at 5:55 pm
Prehaps this will help
CREATE TABLE #Client(ClientID INT,[bgn Date] VARCHAR(50))
INSERT INTO #Client
SELECT 1,'08/11/1999' UNION ALL
SELECT 2, '26/11/1999' UNION ALL
SELECT 3, '26/11/1999'
SELECT Clientid,CONVERT( datetime, [bgn date], 103 ) as date from #Client
WHERE...
November 4, 2009 at 9:40 am
Converting first to decimal and then that decimal to integer for example:
DECLARE @Numb AS VARCHAR(50)
SET @Numb = '-74,000.00'
SELECT CAST(CAST(REPLACE(@Numb,',','') AS DECIMAL(10,2)) AS INT)
But be careful as:
DECLARE @Numb AS VARCHAR(50)
SET @Numb...
November 4, 2009 at 8:06 am
For example do both the branches contain the same item identification
It would be productive, that is getting you some assistance, to include any foreign keys, pertinent constraints...
November 2, 2009 at 7:50 am
It would be best if you would post the details of each of the tables, and what foreign keys exist in them in order for some one to give you...
November 1, 2009 at 4:10 pm
From Books On Line
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/48a5b230-102e-4a89-bb2a-fcf0cac862bb.htm
GETUTCTIME is a function in SQL 2005 check out the above link
November 1, 2009 at 4:03 pm
Viewing 15 posts - 2,326 through 2,340 (of 3,221 total)