Skip to main content

Posts

Showing posts from 2007

SQL .mdf, .ldf path from query

try this code DECLARE @retvalue int, @data_dir varchar(500) EXECUTE @retvalue = master.dbo.xp_instance_regread 'HKEY_LOCAL_MACHINE', 'SOFTWARE\Microsoft\MSSQLServer\Setup', 'SQLDataRoot', @param = @data_dir OUTPUT PRINT 'SQL Server Data Path: '+ @data_dir i get it from here

Pivot Table in SQL SERVER 2005

SELECT /* < non-pivoted column > , [ first pivoted column ] AS < column name > , [ second pivoted column ] AS < column name > , ... [ last pivoted column ] AS < column name > */ ItemCode, ItemName, [1] AS Price1, [2] AS Price2, [3] AS Price3, [4] AS Price4, [5] AS Price5, [6] AS Price6, [7] AS Price7, [8] AS Price8, [9] AS Price9, [10] AS Price10 FROM -- < this is the query that produces the data> (SELECT A.ItemCode, A.ItemName, B.PriceList, B.Price FROM OITM A INNER JOIN ITM1 B ON A.ItemCode=B.ItemCode WHERE A.ItemCode LIKE '11%') AS SourceTable PIVOT ( -- < aggregation function> MAX(Price) FOR -- < column that contains the values that will become column headers > PriceList IN -- ([first pivoted column], [second pivoted column],... [last pivoted column] ) ([1], [2], [3], [4], [5], [6], [7], [8], [9], [10]) ) AS pvt ORDER BY ItemCode; here is the equivalent code for SQL SERVER 2000 SELECT A.ItemCod

Chasing .NET again..:D

been a while again .. been married for almost 2 weeks now :shy: for precisely 14 Sept 2007 me and natalia just married at Vihara Jakarta Dhamma Cakka Jaya at 11 AM.. starting to build family and for that i must proceed the Certificate in order to get a better salary and after that will pursue a better job PS: gonna need to set up my mind to less play DoTa.. until then

What i'm doing now?

simply just doing job like programming..doesn't had a chance to read some book too after my last failed exam :(..oo btw the exam that i took several weeks ago is failed i get 539 from 700 passing grade.. gonna married soon..Sep, 15 2007 for exactly and of course i need to get better job for my family..not sure where to start.. i like it here (at IDU) but the salary is not enough for a starting family i think, maybe it's because of my laziness that slow down my progress to get the certificate..bad me.. need to relax now..see u
learn something new..if it involved transaction between two different server it need to be used four part name something like this ServerName.DbName.OwnerName.TableName in my case: SELECT * FROM [myComputer].Db1.dbo.Table1 until then

MCSD on the road

finally, after a couple time posponed due project..in this friday, 10 Aug 2007 i will start getting my exam for MCSD go for 70-229 topic first and the rest in every two weeks i hope :D need to learn now :D

confusing :D

it's kinda heptic here..there are 2 deadline project and the computer is in reinstall step :D alot of multitasking need to be prefomed :(..not sure wether it can complete or not updated: well everything is looks ok now..NEC project is on golive now, also other project looks fine :D..i'm so glad it can finish just need some finishing i'm gonna take a rest now, playing dota he he he

been 3 weeks in NEC

well, i'm not aware that i've been more than 3 weeks now working in our client NEC Indonesia. first i gonna tell u that making an Add-On in SBO is not hard as i imagine before..they got all sample that need to be used in SDK..just installed the SDK component that u can move forward.. also u need some more experience than u to ask for why this working, why u need this, etc..so u can move more fast :D IMHO SAP SDK is not flexible enough and the error documentation is not great enough coz i some time need to search from internet for the error..most of it just take a guess by looking at the source code ;( but most of all, they put up great effort coz making it possible modifying SBO using other code like C#, VB 6, VB.NET, etc.. gonna continue my exploration ;) see u

some code to Read excel file..

took me some time to search for it eventhough i already found a few months ago ;( -- Read from Excel file SELECT * FROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=PATH_TO_EXCEL_FILE_HERE;IMEX=1;HDR=Yes;', 'SELECT * FROM [SHEET_NAME_HERE$]') Or SELECT * FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="C:\TemplateImportBudget.xls";Extended properties=Excel 8.0;')...Expenses$ PS: when try this query, make sure no application open the excel file otherwise u'll get an error u need to enable Ad Hoc Distributed Queries configuration see this link see u

MSSQL Code

took me some time to search for it eventhough i already found a few months ago ;( first is to read from excel file..i tried this using Query Analyzer -- Read from Excel file SELECT * FROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=PATH_TO_EXCEL_FILE_HERE;IMEX=1;HDR=Yes;', 'SELECT * FROM [SHEET_NAME_HERE$]') Or SELECT * FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="PATH_TO_EXCEL_FILE_HERE";Extended properties=Excel 8.0;')...SHEET_NAME_HERE$ PS: [FROM MS] IMEX=1 tells the driver to use Import mode. In this state, the registry setting ImportMixedTypes=Text will be noticed. This forces mixed data to be converted to text. For this to work reliably, you may also have to modify the registry setting, TypeGuessRows=8. The ISAM driver by default looks at the first eight rows and from that sampling determines the datatype. If this eight row sampling is all numeric, then setting IMEX=1 will not convert the default da

Bridgstone Project

well after meeting in Medan for 4 days (fiuh, a hard day there..coz work all the time :D)..we finally got a project with Bridgestone developing an AddOn using .NET 2003 i think.. the project start on this week..on monday May 07 2007..need to learn using SDK then.. huaa learn something new again... see u all

SAP Business 1

just get back from the training for 2 days now, the training is scheduled for 1 week i think :D weel first of all SAP made a great program like B1..very interesting in way of programming side coz i never realized it can be done that way(B1 way) hard for me to understand business process before but after attend the training the understand is well in higher level now but still can't be a consultant.. just come to my thought wether i should be programmer or consultant coz SAP is worlwide vendor with worldwide program that use well in 'BIG' company i think :D but i think i'll be an SDK for B1 since it still 'touch' B1 also programming skill that i have and also perhaps in this 15th March i'll be try my exam now to get MCAD after that go on for MCSD.. much much pray :D until then

about me :D

it's been a long time since my last post :D..sorry, got a new job just a month ago and been being adapted to it since then :) been learning .NET for localization, can't wait time to used it in app..(my project will have a couple of language :day dreaming:) also been learning to go for MCSD coz it's one of requirement at the new place :D later..