Viewing 15 posts - 376 through 390 (of 2,171 total)
Any reason you ignored my question about the -S option?
Where you set the database server and/or instance to use.
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 8:19 am
This is not a bug. And it is documented in Books Online.
Also see this blog post http://weblogs.sqlteam.com/peterl/archive/2007/09/27/SQL-Server-2005-too-smart.aspx
Books Online here (Transact-SQL, Expressions in queries)
http://msdn.microsoft.com/en-us/library/ms143359(SQL.90).aspx
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 8:14 am
Where is the -S option? You have to tell BCP which server to use.
There may actually be more than one instance on same server.
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 8:02 am
what does your bcp statement look like?
complete command must be on one line.
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 7:48 am
Your TallyNumbers table must begin with 0 (zero).
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 6:55 am
Something similar to this, if "random" also mean unique.
The drawback is that the numbers generated per "batch" are similar, but still unique in the batch.
DECLARE@Codes TABLE
(
Code CHAR(8) PRIMARY KEY CLUSTERED
)
DECLARE@Sample...
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 6:20 am
More math on CHECKSUM.
When you calculate the CHECKSUM for a 8-character string you utilizie the full INT (32 bit) without overflowing the cyclic XOR.
It means the checksum for any given...
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 3:54 am
The checksum can be considered "Good enough".
But you still will have to compensate for the duplicates; ie delete the duplicates and insert 217 new records (in your example), check them...
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 3:14 am
Or this pseudo code..
INSERT INTO #Temp (Code)
SELECT ... (record count equals the existing number of codes in Codes table plus the new wanted number).
insert into Codes
SELECT TOP (@wantedrecords)
from #Temp AS...
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 2:19 am
Yes, I have read the previous posts.
But why suggest an alternative that returns an error saying "Sorry mate, couldn't create as many codes as you wanted."
This behaviour wasn't there before...
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 1:46 am
Try this
CREATE TABLE [dbo].[Codes](
[Code] [char](10) NOT NULL,
CONSTRAINT [PK_Codes] PRIMARY KEY CLUSTERED
(
[Code] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = ON, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR =...
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 12:52 am
It's not the function that takes time here.
It's the LOOP. See this row of code
if ((select count(code) from codes where code = @tempcode) = 0)
For each created code, you COUNT...
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 12:47 am
Yes. Use the PIVOT operator.
N 56°04'39.16"
E 12°55'05.25"
July 10, 2009 at 12:42 am
People don't get married anymore and change their name?
N 56°04'39.16"
E 12°55'05.25"
July 9, 2009 at 2:14 pm
Something is very strange!
This post is duplicated 4 times, and cannot be deleted...
N 56°04'39.16"
E 12°55'05.25"
July 9, 2009 at 1:38 am
Viewing 15 posts - 376 through 390 (of 2,171 total)