Skip to main content

Posts

SELECT records from STORED PROCEDURE

find a way to select from SPROC, using OPENROWSET SELECT * FROM OPENROWSET(SQLOLEDB', 'Trusted_Connection=Yes;Server=(local);Database=myDB', 'exec SPROC_NAME ''Param_1'', ''Param_1''') or SELECT * FROM OPENROWSET(SQLOLEDB', 'Trusted_Connection=No;Server=(local);Database=myDB;uid=user_id;pwd=password', 'exec SPROC_NAME ''Param_1'', ''Param_1''') PS: change the server and database, sproc_name, uid, pwd to your need until then

HIiiiii :D

almost 1 year from my last post? alot news from me :D i got married in sept 2007, got daughter by now ( my knowledge about SAP is better than the last, got my own project running (hope gonna be alot more so i don't have to work for someone again), learning NET .2008 now and Enterprise Library 4.0 (for .NET 2008 version) and gonna developt new application using .NET syntax only (maybe migrate to C# because it's faster) MCSD, try it for two times and it both fails for the same Subject :D, don't intrested in taking exam ever again.. what else???? hmmmmmmm, until then

in Medan again

not like it used to be (like working under stress), now i feel more relax coz we're on schedule not so many distraction :D now i writing a query for Costing so end user can see what's being input to the GL (not describe in detail here) anyway..see u soon

hi again

been busy doing some inside and outside project hehehe the last inside project i do is BSRE project in Medan, like work under stressed coz we must willing to work late at night..from 7.00AM till 12 PM i think rest is only at lunch and dinner :( that day already past but still going to Medan in coming days :( outside project that i do are, one for my cousin..selling voucher for Cellular Phone..i thought in kind'a simple but as usual after that user keep telling it must be something like this and this and that :D anyone have like document to keep user requirement like they said so something like above is never happening again???? please share send to my email [erickwidya][at][yahoo][dot][com] thanks

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.ItemCode, A.ItemName, MAX(CASE B.Price...