الأحد، 12 أكتوبر 2014
Russland - riesiges Pangäa auf Kaiser
Da ich den Save des Ausgangsspiels nicht mehr habe und ich dort ohnehin einige schwerwiegendere Fehler begangen habe, muss ich neu starten.
Einzige Veränderungen zum 1. Spiel: Wasser 70%, SG Kaiser
Ich gebe keine Garantie dafür, dass ich das Spiel zu Ende spiele. Vorgenommen habe ich mir aber auf jeden Fall bis zum Ende des MA zu spielen. Danach wird mir das Truppengeschiebe vermutlich zu langwierig.
Ich habe auch einige Versuche mit Wasser 80 % gestartet, aber dort wurde ich sehr sehr schnell zugesiedelt.
Russland - riesiges Pangäa auf Kaiser
[Wasteland 2] - Die Desert Rangers
Ich habe jetzt viele Jahre kommen und gehen gesehen und der Tag ist gekommen, an dem ich euch von der schlimmen Zeit kurz nach dem dritten Krieg erzählen will, damit ihr daraus lernt. Hört mir zu, denn ich werde euch von heldenhaften Taten berichten in einer grausamen Zeit . Na ja, es waren meistens meine, aber das ist nicht so wichtig.
Ich hatte ja auch ab und zu Hilfe von meinen damaligen Freunden. Nicht, dass ich sie wirklich gebraucht hätte. Die Hilfe, meine ich.
Alles begann ein paar Jahre noch den Abwürfen der Bomben. Es war damals eine wilde Gegend mit schlimmen Menschen : Kannibalen, Banditen, Kultisten und andere. Alles in einer Welt, in der die Radiaoaktivität durch die vielen Bomben allgegenwärtig war. Damals entschloß ich mich, den Rangers beizutreten. Ich war selbstverständlich der beste der Ausbildung, so dass ich bald ein eigenes Team zugeteilt bekam.
Natürlich waren wir die Gruppe, die man mit den schwierigsten Aufgaben betraut. Tja Kinder, man hätte uns fast damals schon als Elite bezeichnen können. Ich werde nie die ehrfuchstvollen Blicke meiner Kameraden vergessen, mit denen sie mich ansahen, als sie mir zugeteilt wurden.
Eigentlich war der erste Auftrag einen Fortsetzung eines bereits Begonnenen . Ein anderer Ranger war dabei gescheitert und getötet worden. Es gab Hinweise auf geheimnisvolle Funksignale und der Ranger, er hieß Ace, sollte an drei Türmen Geräte anbringen, damit man den Ursprung der Signale ermittel konnte.
Niemand wusste damals so recht, ob sein Tod Zufall war (das Land war eben wild) oder ob jemand nicht wollte, dass man die Geräte anbringt.
Der Turm lag im Osten, eine Tagesreise entfernt.
[Wasteland 2] - Die Desert Rangers
السبت، 4 أكتوبر 2014
SQL SERVER – How to Catch Errors While Inserting Values in Table
Question: “I often get errors when I insert values into a table, I want to gracefully catch them, how do I do that.”
Answer: Very simple. Just use TRY… CATCH. Here is the simple example of TRY…CATCH I have blogged earlier when it was introduced.
Here is the example, I have build from the earlier blog post where user can catch the error details during inserting value in table.
First, we will create a sample table.
CREATE TABLE SampleTable (ID INT IDENTITY( 1,1), Col VARCHAR( 10))
GO
Now we will attempt to insert value in this table which will throw errors and the same error we will catch into the table.
BEGIN TRY
INSERT INTO SampleTable (Col)
SELECT 'FourthRow '
UNION ALL
SELECT 'FifthRow ---------'
END TRY
BEGIN CATCH
SELECT
ERROR_NUMBER( ) AS ErrorNumber
, ERROR_MESSAGE( ) AS ErrorMessage;
END CATCH
GO
The second row of the above table will throw an error as the length of the row is larger than the column in which we are inserting values. It will throw an error and the same error will be caught via TRY…CATCH and it will be displayed in the SELECT statement. Here is the result set.
Reference: Pinal Dave (http://ift.tt/wkSzP3 )
Filed under: PostADay, SQL, SQL Authority, SQL Error Messages, SQL Interview Questions and Answers, SQL Query, SQL Server, SQL Tips and Tricks, T SQL
via Journey to SQL Authority with Pinal Dave http://ift.tt/1uLGYi3
الخميس، 28 أغسطس 2014
SQL SERVER – Query to Find Seed Values, Increment Values and Current Identity Column Value of the Table with Max Value of Datatype – Part 2
Seven years ago, I wrote a blog post about – Query to Find Seed Values, Increment Values and Current Identity Column value of the table. It is quite a popular blog post and lots of people like it as it gives immediate details about Identity Values. SQL expert Mark Hickin has further improved this query and posted an interesting modification where the query also display upper limits of the data type used in the query. You can read the blog post over Query to Find Seed Values, Increment Values and Current Identity Column Value of the Table with Max Value of Datatype.
However, this query has a small limitation that it only works in those cases when increment value is 1 and seed is 1. However, if you have any other value as identity or seed, you will need a bit more modification in the script. SQL Server Expert and Guru Harsh has provided amazing script where he has provided query with the said adjustment.
SELECT Seed, Increment, CurrentIdentity , TABLE_NAME, DataType, MaxPosValue ,
FLOOR((MaxPosValue -CurrentIdentity )/Increment) AS Remaining,
100-100*((CurrentIdentity -Seed)/Increment+1) / FLOOR((MaxPosValue - Seed) /Increment+1) AS PercentUnAllocated
FROM (
SELECT IDENT_SEED( TABLE_SCHEMA + '.' + TABLE_NAME) AS Seed ,
IDENT_INCR( TABLE_SCHEMA + '.' + TABLE_NAME) AS Increment ,
IDENT_CURRENT( TABLE_SCHEMA + '.' + TABLE_NAME) AS CurrentIdentity ,
TABLE_SCHEMA + '.' + TABLE_NAME AS TABLE_NAME ,
UPPER( c.DATA_TYPE) AS DataType ,
FLOOR( t.MaxPosValue/IDENT_INCR( TABLE_SCHEMA + '.' + TABLE_NAME)) * IDENT_INCR( TABLE_SCHEMA + '.' + TABLE_NAME) AS MaxPosValue
FROM INFORMATION_SCHEMA.COLUMNS AS c
INNER JOIN ( SELECT name AS Data_Type ,
POWER( CAST( 2 AS VARCHAR), ( max_length * 8 ) - 1) AS MaxPosValue
FROM sys.types
WHERE name LIKE '%Int'
) t ON c.DATA_TYPE = t.Data_Type
WHERE COLUMNPROPERTY( OBJECT_ID( TABLE_SCHEMA + '.' + TABLE_NAME), COLUMN_NAME,
'IsIdentity') = 1
) T1
ORDER BY PercentUnAllocated ASC
Here is the screenshot of the image. Thanks Harsh- a very nice query .
Reference: Pinal Dave (http://ift.tt/wkSzP3 )
Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL Tagged: Identity
via Journey to SQL Authority with Pinal Dave http://ift.tt/1n0kKB0
الثلاثاء، 26 أغسطس 2014
SQL SERVER – Query to Find Seed Values, Increment Values and Current Identity Column Value of the Table with Max Value of Datatype
Seven years ago, I wrote a blog post about – Query to Find Seed Values, Increment Values and Current Identity Column value of the table. It is quite a popular blog post and lots of people like it as it gives immediate details about Identity Values. SQL expert Mark Hickin has further improved this query and posted an interesting modification where the query also display upper limits of the data type used in the query.
SELECT IDENT_SEED( TABLE_SCHEMA + '.' + TABLE_NAME) AS Seed ,
IDENT_INCR( TABLE_SCHEMA + '.' + TABLE_NAME) AS Increment ,
IDENT_CURRENT( TABLE_SCHEMA + '.' + TABLE_NAME) AS CurrentIdentity ,
TABLE_SCHEMA + '.' + TABLE_NAME ,
UPPER( c.DATA_TYPE) AS DataType ,
t.MaxPosValue,
t.MaxPosValue -IDENT_CURRENT( TABLE_SCHEMA + '.' + TABLE_NAME) AS Remaining,
((t.MaxPosValue -IDENT_CURRENT( TABLE_SCHEMA + '.' + TABLE_NAME))/t.MaxPosValue) *100 AS PercentUnAllocated
FROM INFORMATION_SCHEMA.COLUMNS AS c
INNER JOIN ( SELECT name AS Data_Type ,
POWER( CAST( 2 AS VARCHAR), ( max_length * 8 ) - 1) AS MaxPosValue
FROM sys.types
WHERE name LIKE '%Int'
) t ON c.DATA_TYPE = t.Data_Type
WHERE COLUMNPROPERTY( OBJECT_ID( TABLE_SCHEMA + '.' + TABLE_NAME), COLUMN_NAME,
'IsIdentity') = 1
ORDER BY PercentUnAllocated ASC
Here is the screenshot of the image. Thanks Mark – a very nice query.
Reference: Pinal Dave (http://ift.tt/wkSzP3 )
Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL Tagged: Identity
via Journey to SQL Authority with Pinal Dave http://ift.tt/1taM6eQ