www.nuneworld.net

January 20, 2012

Check your security.

October 7, 2011

Simple replace Null Value with something that you need sql

Filed under: info — admin @ 12:30 pm

SELECT IsNull(ColumnName, ' bla bla')
As NewColumnName
FROM TableName

September 26, 2011

Cant insert Cyrillic Macedonian or Russian characters into database when doing bulk insertion.

Filed under: Software, info — admin @ 10:07 am

If you are Bulk inserting informations in your database that contain  characters with value  greater than 127 or less than 32. then in your bulk insert procedure just add

CODEPAGE = { ’ACP’ }

and also be sure that your .csv file is saved in ANSI.

BULK INSERT
   [ database_name . [ schema_name ] . | schema_name . ] [ table_name | view_name ]
      FROM 'data_file'
     [ WITH
    (
   [ [ , ] BATCHSIZE = batch_size ]
   [ [ , ] CHECK_CONSTRAINTS ]
   [ [ , ] CODEPAGE = { 'ACP' | 'OEM' | 'RAW' | 'code_page' } ]
   [ [ , ] DATAFILETYPE =
      { 'char' | 'native'| 'widechar' | 'widenative' } ]
   [ [ , ] FIELDTERMINATOR = 'field_terminator' ]
   [ [ , ] FIRSTROW = first_row ]
   [ [ , ] FIRE_TRIGGERS ]
   [ [ , ] FORMATFILE = 'format_file_path' ]
   [ [ , ] KEEPIDENTITY ]
   [ [ , ] KEEPNULLS ]
   [ [ , ] KILOBYTES_PER_BATCH = kilobytes_per_batch ]
   [ [ , ] LASTROW = last_row ]
   [ [ , ] MAXERRORS = max_errors ]
   [ [ , ] ORDER ( { column [ ASC | DESC ] } [ ,...n ] ) ]
   [ [ , ] ROWS_PER_BATCH = rows_per_batch ]
   [ [ , ] ROWTERMINATOR = 'row_terminator' ]
   [ [ , ] TABLOCK ]
   [ [ , ] ERRORFILE = 'file_name' ]
    )]

September 22, 2011

Event Viwer Error ODBC

Filed under: info — admin @ 8:56 am

Perfmon

Short:

You are runign in services.mcs  Smlogsvc.exe service and that service is run under Network Service account that have no privilege to read  data from MS SQL bin folder. Locate your MSSQL bin folder add permisons to  Network Service to be able to read.

Long: http://support.microsoft.com/kb/912399/en-us

The description for Event ID ( 0 ) in Source ( ODBC ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Error in d:\nt\enduser\databaseaccess\src\mdac\odbc\core\dm\perf.c(349), Access is denied.

: Failed to create mutex for MS ODBC Perf File Mapping.

Couse:

This problem occurs because the Performance Logs and Alerts service (Smlogsvc.exe) does not have sufficient permissions to access the performance counter DLL or the “bin” directory and “bin\en” directoryfor SQL Server 2005 Analysis Services.

On a Windows XP-based computer, the Performance Logs and Alerts service runs under the Network Service account. However, the Network Service account has limited permissions on the local computer. The Network Service account cannot access the performance counter DLL or the SQL Server 2005 Analysis Services “bin” directory and the “bin\en” directorywhen you collect data from SQL Server 2005 Analysis Services performance counters.

Solution:

To resolve this problem, you must grant the Read & Execute permission to the Network Service account on the performance counter DLL for SQL Server 2005 Analysis Services. The DLL is located in the following folder:

C:\Program Files\Microsoft SQL Server\MSSQL.x\OLAP\Bin\Msmdctr90.dll

Additionally, you must grant Read permissions to the Network Service account on the “bin” directory and the “bin\en” directory for SQL Server 2005 Analysis Services. For example:

  • C:\Program Files\Microsoft SQL Server\MSSQL.x\OLAP\bin
  • C:\Program Files\Microsoft SQL Server\MSSQL.x\OLAP\bin\en

Note MSSQL.x represents the corresponding value for the instance ID in the system.

For more information about how to grant permissions to a specific folder in Windows XP, click the following article number to view the article in the Microsoft Knowledge Base:

308419 How to set, view, change, or remove special permissions for files and folders in Windows XP

resource: Microsoft

September 21, 2011

Missing performance counters of MSSQL 2005

Filed under: Software — admin @ 11:51 pm

Missing performance counters of MSSQL, check if your MS SQL is 32 bit runing on 64 bit server and if its then do this

If you want to log you results using the CounterLogs functionality take the following steps

1) Stop the Performance Logs & Alerts service from services.msc

2) Open up the registry editor (regedit.exe), browse down to HKLM\System\CurrentControlSet\Services\Sysmonlog.

3) Change the ImagePath from the default value to %SystemRoot%\syswow64\smlogsvc.exe.( This would launch the 32-bit service on starting the Counter logs)

4) Open the 32-bit Perfmon from Start - Run - %SystemRoot%\syswow64\perfmon.exe, & add the SQL counter objects to a Counter log.

5) Set the various parameters of the Counter log, & start it to collect the data.

August 11, 2011

Google+ invitation ….

Filed under: Software — admin @ 11:50 pm

If you like Google+  invitation just leave comment with your  gmail account,  and you will have  your invitation as soon as i check my blog  ….

July 3, 2011

GRIDVIEW HIDDEN COLUMN DATA ACCESS

Filed under: Software — admin @ 1:24 am

If you have this kind of issue if, you can’t access data after you set your colum to visible false , you can do this kind of trick:

set a event on Row created and then do hidding od the data:

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)

{

e.Row.Cells[0].Visible = false;

}

if you try to access data now you can, and that what we want :)

June 16, 2011

Xp_cmdshell and permissions

Filed under: info — admin @ 2:06 pm

Tutorial from

This blog post was inspired from a newsgroup discussion. The question basically is:
What do you need to do in order to use xp_cmdshell?

Note that there are obvious security implications of doing this. (I’m not recommending usage of xp_cmdshell in general, this is atechnical blog post!) We first need to think about what happens here, from an architectural level:

Somebody who has logged in to SQL Server executes xp_cmdshell. For this, SQL Server need to spawn a process in Windows. A process in Windows need to execute in a Windows user account.

So, what Windows account is used? If the SQL Server login who is executing xp_cmdshell is sysadmin, then SQL Server will use the service account (it will not “pretend to be somebody else”). But if the login isn’t sysadmin, then we need to configure what Windows account to be used (using sp_xp_cmdshell_proxy_account). Note that this configuration is the same for all non-sysadmins!

But there’s a little bit more to it. Below is an outline of what need to be done. Step 2 and 3 are only needed if the one who is to execute xp_cmdshell isn’t sysadmin. Note that the steps don’t have to be performed in the order listed below.

  1. We need to allow usage of xp_cmdshell in general (on 2005). Use “Surface Area Configuration” or sp_configure for this.
  2. We need to have a user in the master database which has execute permission on xp_cmdshell. If you are uncertain about the difference between logins and users, you should read up about it in BOL.
  3. We need to say what Windows account should be used when a non-sysadmin user is executing xp_cmdshell.

So, here’s the TSQL script that does all above:

–1, allow xp_cmdshell
EXEC sp_configure ‘xp_cmdshell’, 1
RECONFIGURE
GO

–2, grant permission to xp_cmdshell
USE master
CREATE LOGIN JohnDoe WITH PASSWORD = ‘jlkw#.6(’

–Note, we are in the master database!!!
CREATE USER JohnDoe FROM LOGIN JohnDoe

–Run as login x
EXECUTE AS login = ‘JohnDoe’
–Below fails, no execute permission on xp_cmdshell
EXEC xp_cmdshell ‘DIR C:\*.*’
REVERT
GO

–Note, we are in the master database!!!
GRANT EXECUTE ON xp_cmdshell TO JohnDoe

–Try again
EXECUTE AS login = ‘JohnDoe’
–Execution of xp_cmdshell is allowed.
–But I haven’t configured the proxy account…
EXEC xp_cmdshell ‘DIR C:\*.*’
REVERT
GO

–3, specify the proxy account for non-syadmins
–Replace obvious parts!
EXEC sp_xp_cmdshell_proxy_account ‘Domain\WinAccount’,'pwd’
EXECUTE AS login = ‘JohnDoe’
–Execution of xp_cmdshell is allowed.
–And executes successfully!!!
EXEC xp_cmdshell ‘DIR C:\*.*’
REVERT

–Cleanup
EXEC sp_xp_cmdshell_proxy_account null

DROP USER JohnDoe
DROP LOGIN JohnDoe
EXEC sp_configure ‘xp_cmdshell’, 0
RECONFIGURE

—-

if you have problem with step 3 then continue here and after that return to step 3 :)

Everything was ok til step 3! When i run step 3 it says something like this:

An error occurred during the execution of sp_xp_cmdshell_proxy_account. Possible reasons: the provided account was invalid or the ‘##xp_cmdshell_proxy_account##’ credential could not be created. Error code: ‘0′.

The account was ok but SQL stil reporting error… so I create crdental manualy with command:

create credential ##xp_cmdshell_proxy_account## with identity = ‘SERVERNAME\useracount’, secret = ‘42342eddds#’

(i m not on a domain, and servername mast be inculded because if you  not you will same error that windows user is not valid!!!)

next in Microsoft SQL Server Menagment studio  go to server Agent  an in proxies define new proxi

in General

proxy name: some name

credetials: clisk on  … button and select

##xp_cmdshell_proxy_account##

in Principals:

clisc add button and select User  click, OK..

and now run:

EXEC sp_xp_cmdshell_proxy_account ‘Domain\WinAccount’,'pwd’

EXECUTE AS login = ‘JohnDoe’

–Execution of xp_cmdshell is allowed.

–And executes successfully!!!

EXEC xp_cmdshell ‘DIR C:\*.*’

REVERT

and should be OK….

UPDATE:

if  you have a stored procedure that is using bcp xp_cmdchell  and you want to call from your ASP.NET application just add to your stored procedure   EXECUTE AS ‘Jondoe’ , the procedure should be  executed with user that have privilage to start xp_cmdshell otherwise  you if you call your procedure from youar apllication you will recive error something like : The EXECUTE permission was denied on the object ‘xp_cmdshell’, database ‘mssqlsystemresource’, schema ’sys’….  so  to you  u have:

ALTER PROCEDURE [dbo].[procedureNAME] (@parametar1 bigint,@parametar2 varchar(100)) with EXECUTE AS ‘JhonDoe’

AS

BEGIN

…..
end.

who is JhonDoe user  read the tutorial above this update… or here

March 26, 2011

asus

Filed under: Software — admin @ 2:58 pm

Asus drivers find here: http://support.asus.com/download/download.aspx?SLanguage=en-us

Windows Genuine Advantage (WGA)

Filed under: info — admin @ 2:40 pm

Windows Genuine Advantage (WGA) is an anti-piracy system enacted by Microsoft that enforces Microsoft Windows online validation of the authenticity of several recent Microsoft operating systems when accessing several Microsoft Windows services, such as Windows Update, and downloading from the Microsoft Download Center.

June 4, 2010

Problem installing drupal with wam 2.0 server, php version 5.3.0

Filed under: Software — Tags: , , — admin @ 9:41 am

Problem installing drupal on wamp server 2.o  php 5.3.o

Function ereg() is deprecated in …..  drupal\includes\file.inc on line …

Solution:

open file
includes/file.inc
Goto line no xxx
where you can see something like this
elseif ($depth >= $min_depth && ereg($mask, $file))
Now add @ sign before ereg($mask, $file)
copy below line past this line
elseif ($depth >= $min_depth && @ereg($mask, $file))

May 13, 2010

Magento can’t log into admin after installation

Filed under: Software — admin @ 11:19 am

Some cookie issue, if you are running on a local host than you may experience this problem. So … locate app\code\core\Mage\Core\Model\Session\Abstract\Varien.php
open with ant editor, or notepad, and make comment like this:

// session cookie params
$cookieParams = array(

‘lifetime’ => $cookie->getLifetime(),

‘path’ => $cookie->getPath(),

// ‘domain’ => $cookie->getConfigDomain(),

//’secure’ => $cookie->isSecure(),

//’httponly’ => $cookie->getHttponly()

);

/*

if (!$cookieParams['httponly']) {

unset($cookieParams['httponly']);

if (!$cookieParams['secure']) {

unset($cookieParams['secure']);

if (!$cookieParams['domain']) {

unset($cookieParams['domain']);

}

}

}

 

if (isset($cookieParams['domain'])) {

$cookieParams['domain'] = $cookie->getDomain();

}

*/

May 4, 2010

Post from Microsoft on drupal…

Filed under: Software — admin @ 2:28 pm

 

Administer-> Site Building -> Modules -> Blog API

  • Activate the Blog API module

Administer-> Site configuration->Blog API

select enable external bloging clients…. And save configuratons…

Site COnfiguration-> Full HTml as default

Go to word 2007 select publish ->Blog new post

 

Set up your account:

blog provider ->other ->next

API MetaWebLog

Blog Post URL ->http://localhost/drupal/XMLRPC.php

username:your usser name

pass: your password

Testing Microsoft office for blogging on wordpress

Filed under: Software — admin @ 10:49 am

 

    

Filed under: Software — admin @ 10:39 am

Test from Microsoft Office…

Older Posts »

Powered by WordPress