Viewing 15 posts - 9,346 through 9,360 (of 10,143 total)
Hi Johann
Looking at this from a slightly different angle...which variables do you have populated before you run this bit of code (nicked from Gail's post, thanks Gail)...
SELECT @BuildID = BuildID
FROM...
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
November 28, 2008 at 4:38 am
Hi
You could truncate using LEFT() as follows:
[font="Courier New"]DROP TABLE #tblClients
CREATE TABLE #tblClients (
Client_short_Name NVARCHAR(30) NOT NULL,
Client_long_name NVARCHAR(100) NULL,
CountryCode VARCHAR(5) NULL,
ClientID NVARCHAR(10) NOT NULL)
DECLARE @Client VARCHAR(255)
SET @Client = 'This is...
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
November 28, 2008 at 4:15 am
pri.amin (11/28/2008)
the error is:
Msg 8152, Level 16, State 4, Procedure procImportAllFiles, Line 33
String or binary data would be truncated.
The statement has been terminated.
dbo.tblClients
Client_short_Name...
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
November 28, 2008 at 3:12 am
rbarryyoung (11/27/2008)
I just notice that you are putting "and" after your Hundreds, like this:
nine hundred and seventy seven thousand, six hundred and ninety two dollar(s)
Technically, this is...
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
November 28, 2008 at 2:56 am
rbarryyoung (11/27/2008)
Well I did test them on my laptop. Chris's ran in 13 & 15 seconds, while Jeff's ran in 5.1 and 5.2 seconds.
Testing in my reporting environment yields...
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
November 28, 2008 at 2:52 am
Jeff Moden (11/27/2008)
Chris Morris (11/27/2008)
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
November 27, 2008 at 12:43 pm
Here's a 2k/2k5-friendly version with a permanent lookup table. It translates 30,000 numbers from a standard tally table, in both SQL Server versions, in about 4 seconds.
[font="Courier New"]IF EXISTS...
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
November 27, 2008 at 10:40 am
Hello
A quick Google confirms that this requirement is fairly common nowadays. The following thread describes a couple of sprocs which could be used to help, with a minimum of fuss.
http://www.tek-tips.com/viewthread.cfm?qid=1499975&page=11
This...
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
November 27, 2008 at 8:02 am
Hi Thatok
If you are intending to eliminate from your result using the condition
If the fifth character = 0 then the sixth character should not be 0.
then shouldn't this do the...
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
November 27, 2008 at 2:36 am
Jeff Moden (11/26/2008)
Chris Morris (11/26/2008)
Chris, the link in your signature is broken. You'r missing the right hand bracket on the first instance of the URL IFCode ShortCut.
Thanks Jeff, it's...
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
November 27, 2008 at 2:28 am
rbarryyoung (11/26/2008)
My guess would be that it is the SUBSTRING()'s in your ON clauses.
You're spot on. It works fine in 2k, I should have tested it in 2k5 :blush:. The...
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
November 27, 2008 at 12:51 am
Matt Miller (11/26/2008)
Chris Morris (11/26/2008)
I'll test it for speed tomorrow using a permanent table. A whole minute for...
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
November 26, 2008 at 2:35 pm
TheSQLGuru (11/26/2008)
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
November 26, 2008 at 2:30 pm
Hi Nishant
It's exactly as your error message states, you can't use
INSERT INTO NewDataBase.Extensions.FieldSelectionGroups
SELECT *
FROM OldDataBase.Extensions.FieldSelectionGroups
you have to use
INSERT INTO NewDataBase.Extensions.FieldSelectionGroups (column1, column2 etc)
SELECT column1, column2 etc
FROM OldDataBase.Extensions.FieldSelectionGroups
Cheers
ChrisM
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
November 26, 2008 at 2:20 pm
Here's another way, similar. Quite quick.
[font="Courier New"]ALTER FUNCTION dbo.ToWords(@TheNumber DECIMAL (15,2), @CurrencyName VARCHAR(20), @JoinWord VARCHAR(20), @CentsName VARCHAR(20))
RETURNS VARCHAR(200)
-- USAGE: SELECT dbo.ToWords(1.01, 'dollar(s)', 'and', 'cent(s)')
-- MAX. VALUE: 999999999999.99 (twelve nines...
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
November 26, 2008 at 10:00 am
Viewing 15 posts - 9,346 through 9,360 (of 10,143 total)