Tuesday, March 27, 2012
Configuration problems
I am trying to configure my serwer (local computer) as a distributor and
publisher to see how it works. I have created sample database with one table
and few filelds. One of them is unique primary key.
During Configuring and Selecting Distributor or Creating Publication I get
an error:
Error 14114: '(null)' is not configured as a Distributor.
What can be the problem? I was trying to configure transactional
replication, but I think that it has no influence, because error occures
during configuring distributor. Also I have used fo snapshot folder admin
share C$ ans normal share with full rights for all users C.
Software versions are:
Windows XP Professional SP1
SQL 2000 Developer SP3 version 8.00.760
Thank you
Przemo
Have a look at http://support.microsoft.com/kb/q302223/
You may have changed the name of the machine since installing replication
and there is no entry in sysservers with the new machine name
--
Mary Bray [SQL Server MVP]
Please only reply to newsgroups
"Przemo" <Przemo@.discussions.microsoft.com> wrote in message
news:3473CCB4-6C0B-4ED4-833E-73CEC5E2E1DB@.microsoft.com...
> Hi,
> I am trying to configure my serwer (local computer) as a distributor and
> publisher to see how it works. I have created sample database with one
> table
> and few filelds. One of them is unique primary key.
> During Configuring and Selecting Distributor or Creating Publication I get
> an error:
> Error 14114: '(null)' is not configured as a Distributor.
> What can be the problem? I was trying to configure transactional
> replication, but I think that it has no influence, because error occures
> during configuring distributor. Also I have used fo snapshot folder admin
> share C$ ans normal share with full rights for all users C.
> Software versions are:
> Windows XP Professional SP1
> SQL 2000 Developer SP3 version 8.00.760
> Thank you
> Przemo
Tuesday, February 14, 2012
Concurrency Issues
I'm suspecting the answer is no. You can use transactions on completely database oriented operations that read/write to a database and complete. But there aren't complete synchronization controls for operations like below that try to return a value to an outside process.
IF OBJECT_ID('SimpleTable') IS NOT NULL
DROP TABLE SimpleTable
CREATE TABLE SimpleTable (
A INTEGER
)
INSERT INTO SimpleTable (A) VALUES (1)
-- Run in one window
DECLARE @.value INTEGER
BEGIN TRANSACTION
SELECT TOP 1 @.value = A FROM SimpleTable
WAITFOR DELAY '00:00:05'
UPDATE SimpleTable SET A = @.value + 1
COMMIT TRANSACTION
SELECT @.value
SELECT A FROM SimpleTable
-- Run in a second window
DECLARE @.value INTEGER
BEGIN TRANSACTION
SELECT TOP 1 @.value = A FROM SimpleTable
UPDATE SimpleTable SET A = @.value + 1
COMMIT TRANSACTION
SELECT @.value
SELECT A FROM SimpleTableUse an identity property, instead of code. While you might loose a few values if threads (spids) die for some reason, and you might cause other holes by deleting rows, the values will be unique and monotonically increasing.
-PatP|||Use an identity property, instead of code. While you might loose a few values if threads (spids) die for some reason, and you might cause other holes by deleting rows, the values will be unique and monotonically increasing.
-PatP
Actually, I did just that. However, I was kind of curious if it was possible to acheive with transactions or with some explicit locking calls.|||There definitely is a way to do it using just SQL statements with Transact-SQL's locking model. The identity process is simpler and supported though.
-PatP|||You'll need to use (TABLOCK) or (UPDLOCK) as table hints to ensure ACID properties of a transaction while attempting to generate an artificial IDENTITY value.|||You'll need to use (TABLOCK) or (UPDLOCK) as table hints to ensure ACID properties of a transaction while attempting to generate an artificial IDENTITY value.
Thank you. That will work. Except BOL calls those locking "hints" which means the solution isn't guaranteed to work even though it probably will on today's implementations.|||I don't see how it will not work, but you're free to refute it.|||It won't work if a future implementation (either a future version or service pack of SQL Server) decides to ignore the locking "hint". The database engine is completely free to obey or ignore "hints" at will so you shouldn't base an algorithm on that.
I don't see how it will not work, but you're free to refute it.
concatnate values for different rows
Hi ,
I have a situation where i need to concatnate values from different rows and store it a one string.
sample
dealid date
1 1/5/2007
1 2/4/2009
2 5/5/2004
2 8/5/2006
2 4/8/2006
so for one particular deal how many ever dates there are , i need to concatnate them all separated by a comma(,) and return and one string.
Is ther any way i could do it, Any suggestions appreaciated
Thanks
Ashsih
Maybe something like:
|||select distinct dealId,
reverse(substring(reverse(
( select convert(varchar(10), date, 101) + ', ' as [text()]
from theTable b
where a.dealId = b.dealIdorder by date desc
for xml path('')
)), 3, 300))
from theTable a
For a particular DealD:
declare @.targetDeal int set @.targetDeal = 1
select reverse(substring(reverse
( select convert(varchar(10), date, 101) + ', ' as [text()]
from theTablewhere dealId = @.targetDeal
order by date desc
for xml path('')), 3, 300)) as DealDates
Sunday, February 12, 2012
Concatenation Isssue (SELECT QUERY)
XZZZZZQPD2X2NF0WIYPHUFQHB5OLU515 2 arrier and DeltaV Controller is
XZZZZZQPD2X2NF0WIYPHUFQHB5OLU515 3 nets and field equipment interface.
XZZZZZQPD2X2NF0WIYPHUFQHB5OLU515 1 This is the quote for RS3 migration
Thanks,
Rahul Jhasomething like SUM() for varchar data type.|||avast, you should be doing this in your application layer, me hearty
:)|||have just gt a code. wanted to share this with others, and looking forward for the comment from the forum.
-- Prepare sample data
DECLARE @.Sample TABLE (ID INT, Code VARCHAR(3))
INSERT @.Sample
SELECT 290780, 'LT' UNION ALL
SELECT 290780, 'AY' UNION ALL
SELECT 290781, 'ILS' UNION ALL
SELECT 290780, 'AY'
SELECT * FROM @.Sample
-- Show the expected output
SELECT DISTINCT s1.ID,
STUFF((SELECT DISTINCT TOP 100 PERCENT ',' + s2.CODE FROM @.Sample AS s2 WHERE s2.ID = s1.ID ORDER BY ',' + s2.CODE FOR XML PATH('')), 1, 1, '') AS CODES
FROM @.Sample AS s1
ORDER BY s1.ID
SELECT DISTINCT s1.ID,
STUFF((SELECT TOP 100 PERCENT ',' + s2.CODE FROM @.Sample AS s2 WHERE s2.ID = s1.ID ORDER BY ',' + s2.CODE FOR XML PATH('')), 1, 1, '') AS CODES
FROM @.Sample AS s1
ORDER BY s1.ID
SELECT DISTINCT s1.ID,
STUFF((SELECT ',' + s2.CODE FROM @.Sample AS s2 WHERE s2.ID = s1.ID FOR XML PATH('')), 1, 1, '') AS CODES
FROM @.Sample AS s1
ORDER BY s1.ID|||but my database is 2000. not 2005. and in 2000 the above code will not work.|||Why not do it in the presentation layer/|||This here DBA needs to walk the plank.|||Arggggghhhh
shiver me timbers|||Your wood is cold..?
I just don't even want to know :p
...seriously, what doesthat phrase even mean?|||...seriously, what doesthat phrase even mean?haaaarr, ye be a pitiful excuse for a young pirate, me lad
http://en.wikipedia.org/wiki/Shiver_my_timbers|||hahaha its true its Pirate day today :) aaaaaarrrrrrr|||Arggggghhhh
shiver me timbers
Brett, Opie and Anthony fan ?
They had pirate talk today.|||buffett
He mentioned it last night at his concert at MSG|||buffett
He mentioned it last night at his concert at MSG
Rush Fan ? they played Monday night at MSG.|||Rush Fan ? they played Monday night at MSG.
In another lifetime|||Original Quote Posted By MCrowley.....
Why not do it in the presentation layer/
No I can't do this at the presentation layer. This issue has come duriong the data migration phase. It has to be done at the DB side only.........
Thanks,
Rahul Jha|||Why does it have to be during data migration?
Chances are that you are de-normalising your data by concatenation.|||Why does it have to be during data migration?
Chances are that you are de-normalising your data by concatenation.
Actaully m normalising the DB. currently it's in De-normalised state......
Thanks,
Rahul Jha|||Ha!
Anyhow, have you done any googling? http://www.google.co.uk/search?hl=en&q=how+to+concatenate+in+SQL+msdn2&meta=|||Chances are that you are de-normalising your data by concatenation.that's a bit tentative, isn't it george?
for sure it's denormalizing the data
:)|||I can think of one single example where concatenation (ok, it's not really concatenation, but you can't blame a guy for trying!) would not cause denormalisation.
DateField + TimeField
Bleugh.|||You can try this out...
"SELECT THIRD_COLUMN+FIRST_COLUMN FROM TABLE"
...it works if both are varchar type columns.
if you wanna add some special character inbetween ...
THIRD_COLUMN+'-'+FIRST_COLUMN will solve your purpose.|||I can think of one single example where concatenation (ok, it's not really concatenation, but you can't blame a guy for trying!) would not cause denormalisation.
DateField + TimeField
Bleugh.actually, that is "really concatenation" :)
what he wants to do is aggregation (a column operation over several rows)
it's a reasonable request
in MySQL, the GROUP_CONCAT aggregate function performs exactly this operation, with options for the separator and sequence of terms|||Ha!
Anyhow, have you done any googling? http://www.google.co.uk/search?hl=en&q=how+to+concatenate+in+SQL+msdn2&meta=
How is it gonna help Georgy by any chance...........?? Have a look again on the query............. And if the link can help me to qrite the query then kindly guide me thru.........
Thanks,
Rahul Jha|||what he wants to do is aggregation (a column operation over several rows)
ur rgt.......
Thanks,
Rahul Jha|||start here:
http://databases.aspfaq.com/general/how-do-i-concatenate-strings-from-a-column-into-a-single-row.html|||ur rgt.......
Thanks,
Rahul Jha
I love those phone commercials
omg wtf lol roflmao|||buffett
He mentioned it last night at his concert at MSG
You went all the way from the Channel Islands to Madison Square Gardens?! Wow, you are a serious Jimmy Buffett fan!! :D|||ur rgt.......OMG, is there a new instance of The Great Bangalore Alphabet Famine of 1978 (www.nevermind-Im-just-kidding) going on?
Horrors.
Fortunately, relief packages of 1000 letters are available on a first-come-first-served basis at the CIIL (http://www.ciil.org/)|||he is debugging his app on a cell phone while driving
using only his thumb
actually, i will cut him a lot of slack because of this
:cool: