Viewing 15 posts - 9,346 through 9,360 (of 10,144 total)
Like this:
[font="Courier New"]INSERT INTO dbo.tblClients
(Client_Short_Name,
Client_Long_Name,
CountryCode,
ClientID)
SELECT
CASE WHEN LEN(c.Client) > 30 THEN LEFT(c.Client, 27) + '...' ELSE c.Client END AS Client,
CASE WHEN LEN(c.Client) >...
November 28, 2008 at 4:44 am
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...
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...
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...
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...
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...
November 28, 2008 at 2:52 am
Jeff Moden (11/27/2008)
Chris Morris (11/27/2008)
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...
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...
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...
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...
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...
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...
November 26, 2008 at 2:35 pm
TheSQLGuru (11/26/2008)
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
November 26, 2008 at 2:20 pm
Viewing 15 posts - 9,346 through 9,360 (of 10,144 total)