w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Copy data from local production SQL Server database to remote read only SQL Server database
I think the logshipping solution fits your needs. After a one-time setup proces, the logs would be continually shipped from the local db to the remote db. Keeping the remote perfectly in sync with the local one, providing you with the readonly copy. Logshipping is available in all editions, besides Express. There would be no need for a continuous restore process. You can find more information here.

Categories : Sql Server

LAMP Web Server: Executing Application on Server Side can't detect USB device
I think your on the right track with this being a permissions issue. In a typical LAMP stack, the php process runs as a module in the apache process, unless you've configured it differently. In my server OS of choice, the php process runs as the user 'www-data' by default. Probably the easiest solution would be to give sudo permission to your web user account, and set the sudoers file to NOPASSWD. This is very insecure, so only do this in rare cases. <?php echo shell_exec("sudo /home/pi/FDTI_test/FDTI_test_application"); ?> The next easiest option is to give the web user account permission to write to the USB device directly. Depending on your distribution, you may only need to add the user to the 'adm' group. sudo usermod -a -G adm www-data Again, this may not be the most s

Categories : PHP

SQL Server 2008 Express - How to update my local database to server database
You can alsouse tools which generate diff scripts, like this one for schema or see here

Categories : SQL

how to export or import sql server database from sql server to mysql server through network
Try to use this script, which allows you to import data. You must specify the table name and run the generated code on your MySQL server. DDL: CREATE TABLE Labour.Employee ( EmployeeID INT IDENTITY (1, 1) PRIMARY KEY NOT NULL , IsMainWorkPlace BIT NOT NULL , TabelNumber VARCHAR(6) NULL , PersonID INT NOT NULL , DepartmentUID UNIQUEIDENTIFIER NOT NULL , DateIn DATETIME NOT NULL , DateOut DATETIME NULL , PositionID INT NULL , DatePension DATETIME NULL , IsLabourUnionMember BIT NOT NULL , FiringReasonID INT NULL ) Query: DECLARE @Table NVARCHAR(50) , @Schema NVARCHAR(50) , @ObjectID INT , @IsImportIdentity BIT = 1 , @IsCreateTable BIT = 1 DECLARE [tables] CURSOR READ_ONLY FAST_FORWARD LOCAL FOR SELECT t.name

Categories : Mysql

How to detect that username already use in the database
I hope this help you, $query=mysql_query("select * from employee where Emp_Username=$name"); $row=mysql_num_rows($query); if($row>0){ echo 'user exist'; }else{ echo 'User not exist'; }

Categories : PHP

Detect Database Query Update
You can do this in Application layer. You can have a centralize method/class to update files in your database. Then you can register observers(Observer pattern) to get notification of any updates. In this way you can refresh multiple clients when data changes in database. Above suggestion will work only if there is no data change from other process or direct DB updates.

Categories : C#

After onclick no error detect but cannot post into my database
Looks like you are storing an array of functions that make different validations: var ary=[checkfname,checklname,checkEmail,checkAge,checkAdd,validtp,validhp,checkName,validpass]; Then you iterate that array and each function is executed receiving the form as parameter. !ary[z0](f) If you return false, the default action will be prevented, in this case the form won't be submitted. So I'm pretty sure one of your validations is returning false. You should check each one of those functions and see wich one is returning false - you could debug using tools such as chrome dev tools or firebug.

Categories : Javascript

Detect if user is behind a proxy server
Unless a proxy uses special header, like X-Forwarded-For, you can't differentiate it from a normal user. As those 'black' proxies are not so naive (their purpose is to protect their users, remember), your only choice are IP blacklists - like the ones provided by Project Honeypot.

Categories : PHP

WLST Detect / Start Weblogic server
I'm not very sure about your question. 1. If you want to shutdown the WLS, use shutdown command in WLST 2. if you want to start WLS in another window, add "start" before the call command, like: start call startWebLogic.cmd

Categories : Java

How do you create and detect one-time Server Sent Events?
You likely want to use Web Sockets. Socket.io is great if you're using node.js but there are also php libraries to help you out,

Categories : PHP

How do I generically reference a local table in a SQL Server database from an assembly installed in that database?
All you have to do is use a context connection. At the moment it may not seem obvious, but CLR code always executes in some context. There is always something (somebody) that executed the code directly or in some parent scope (stored procedure calls CLR function, CLR trigger fires on insert etc). When program execution reaches context connection, it just takes connection parameters (server, database, SET options etc) of that scope. I want this method/storedproc to refer to a specific known table in the database. After context connection is opened, you are querying your database as usual. using (SqlConnection conn = new SqlConnection("context connection=true")) { conn.Open(); SqlCommand cmd = new SqlCommand("SELECT * FROM MyTable"); SqlContext.Pipe.ExecuteAndSend(cmd); }

Categories : Sql Server

Spring security login point to MySQL database and other functionality should use SQL Server database
in your spring security context you can use authentication-manager with authentication-provider then with jdbc-user-service and set data-source-ref with you mysql datasource as in below: <security:authentication-manager alias="authenticationManager"> <security:authentication-provider> <security:password-encoder hash="md5" /> <security:jdbc-user-service id="jdbcUserService" data-source-ref="dataSource" /> </security:authentication-provider> </security:authentication-manager>

Categories : Mysql

Searching for a sql server database reference string pattern [Database].[Schema].[Object]
This regex: (w+|[w+]).(w+|[w+]).w+ Is as simple as it gets. It means: A word, or a word in between [] ((w+|[w+])); Followed by a dot (.); Followed by a word, or a word in between [] ((w+|[w+])); Followed by a dot (.); Followed by a word (w+). Check out this demo and see (and test) what it matches. Naturally, just place it in the Find what: text field of notepad++ search box.

Categories : SQL

I want to get updated records from web sql server database into local database table through Store Procedure
Check linked server. http://www.jensbits.com/2010/11/10/create-linked-server-sql-server-2008/ after link the web server in to your local server, can access data easily.

Categories : Sql Server

PostgreSQL Performance: keep seldomly used small database in memory while server busy with big database
PostgreSQL doesn't offer a way to pin tables in memory, though the community would certainly welcome people willing to work on well thought out, tested and benchmarked proposals for allowing this from people who're willing to back those proposals with real code. The best option you have with PostgreSQL at this time is to run a separate PostgreSQL instance for the response-time-critical database. Give this DB a big enough shared_buffers that the whole DB will reside in shared_buffers. Do NOT create a tablespace on a ramdisk or other non-durable storage and put the data that needs to be infrequently but rapidly accessed there. All tablespaces must be accessible or the whole system will stop; if you lose a tablespace, you effectively lose the whole database cluster.

Categories : Postgresql

Improve process of mirroring server database to a client database via JSON?
I have experience in a very similar project. The Core Data insertions take some time, so we condition the user that this will take a while, but only the first time. The best performance tweak was of course to get the batch size right between saves, but I am sure you are aware of that. One performance suggestion: I have tried a few things and found that creating many download threads can be a hit on performance, I suppose because for each request there is some latency from the server etc. Instead, I discovered that downloading all the JSON in one go was much faster. I do not know how much data you have, but I tested with > 100.000 records and a 40MB+ JSON string this works really fast, so the bottleneck is just the Core Data insertions. With an @autorelease pool this even performed acce

Categories : IOS

Acces database from appfog's node.js server (Database settings)
Use the db credentials from the VCAP_SERVICES environment var and do not hard code them. The credentials are provided when the app is started on AppFog. See the Appfog Node Docs var env = JSON.parse(process.env.VCAP_SERVICES); var creds = env['mysql-5.1'][0]['credentials']; # grabs the creds for the first mysql database var client = mysql.createConnection({ host: creds.hostname || 'localhost', user: creds.username, password: creds.password, database: creds.name, port: creds.port || 3306 }); I created a npm package to help facilitate getting production and development credentials. See AppFog Env How to use it: First set a local env var with your local dev database credentials: export DEV_DB_CREDS='{ "username": "root", "name": "dev-db-name" }' Then get the creds in t

Categories : Mysql

Synchronize Postgres Server Database to Sqllite Client database
There is no one size fits all approach here. You need to carefully consider exactly what needs to be done, what you are replicating, how much data is involved, and what your write models are, all before you build a solution. Along the way you have to decide how to handle write conflicts and more. In general the one thing I would say is that such synchronization works best with append-only write models (i.e. inserts, no deletes, no updates), and one way to do it is to log changes that need to be made and replicate those changes. However, master-master replication is difficult on the best of days and with the best of tools available. Jumping between databases with very different capabilities will introduce a number of additional problems. You are in for a big job.

Categories : Sqlite

Update Oracle database and SQL Server 2008 R2 database within a transaction
This is known as an eXtended Architecture (XA) transaction, and yes, it is supported on Microsoft Windows via the MSDTC.exe application. You can read all about it here: http://technet.microsoft.com/en-us/library/cc753563(v=ws.10).aspx another good article describing how to configure the DTC to support transaction with Oracle is here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa344212(v=vs.85).aspx

Categories : C#

Using SQL Server database for login control instead of default ASPNETDB.mdf database
Just change the connection property string in the membership section in the web configuration to use what ever database connection from the database connection string section like : <connectionStrings> <add name="membershipConnectionString" connectionString="Data Source=ALGHABBAN-DEV;Initial Catalog=TimeTable;Integrated Security=True"/> </connectionStrings> <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15"> <providers> <clear/> <add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="membershipConnectionString" applicationName="/" enablePasswordRetrieval="false" enablePasswordReset="true" requiresUniqueEmail="true" passwordFormat="Hashed"/> </provider

Categories : C#

libevent2 http server how to detect client close
I think that this is a bug in libevent. I have a similar issue with libevent 2.0.21, and here's what happens in my case: When evhttp_read_header() in libevent's http.c is done reading the HTTP headers from the client, it disables any future read events by calling bufferevent_disable(..., EV_READ). However, read events need to be enabled for the underlying bufferevent to report EOF. That's why the bufferevent never tells libevent's HTTP code when the client closes the connection. I fixed the issue in my case by simply removing the call to bufferevent_disable() in evhttp_read_header(). I use "Connection: close" and nothing but GET requests, so the client never sends any data after the headers and this solution seems to work well for this very specific and simple use case. I am not sure, ho

Categories : Http

How do I detect a server host:port on the local network?
You can use the netstat command to find the open ports on a server (windows or linux) example on linux to find a java app server: netstat -anp | grep java Output - it was listening on port 8080: tcp 0 0 10.121.235.200:8080 0.0.0.0:* LISTEN 7051/java And as a side note, you may find this useful, if you have an idea it should be a certain port, you can check if there's a process running that is listening to it by using lsof: lsof -i :portNumber Example: lsof -i :80

Categories : Javascript

How to detect and pick-up changes in underlying schema for sql-server tvf functions
A) You can use system views - sys.sql_modules or sys.sql_dependencies In sql_modules you can search for definition of your objects (functions, procedures, views) and find the pattern you need. Maybe something like: SELECT * FROM sys.sql_modules WHERE definition LIKE '%TableA%' AND definition LIKE '%SELECT *%' sys.sql_dependencies shows dependencies between object. So you can easily find all objects dependent on you TableA, after you change it. Might get you a bit results more than you need. SELECT * FROM sys.sql_dependencies WHERE referenced_major_id = object_id('TableA') Either way, you can join it on sys.objects to get the names and filter for functions only (I would include views because they also need refreshing after underlaying object has changed)'. Something like this: SEL

Categories : SQL

Reading CSV files located on LINUX server and updating the tables in SQL Server Database
Since you know how to proceed once the csv file is on your Windows box, it seems this question amounts to how to get the file from a Linux server to a Windows server. I suggest rcp or rsync. There are Windows versions of both.

Categories : Linux

Pooling connection to mysql database server from django application server
Your approach is not amateur at all. The purpose of bouncer in your case would be to eliminate connection time that happens on each request django handles. For example, on Heroku, which is hosted on AWS servers, this could eat up 40-50ms of each request. Now, if you had a master/slave setup or something like that, a connection pool would also provide you a failover functionality (just an example)

Categories : Mysql

Frequent, periodic server-side updates to server MySQL database
i would create a cron task (on unix) or scheduled task (on windows) on the server. Have the script run every interval you require populate your db. Cron http://www.pantz.org/software/cron/croninfo.html Windows Schedule Task (obviously you'll need to find to suit your version) http://windows.microsoft.com/en-au/windows7/schedule-a-task Also, cron will only run with every minute of granularity, but i found a simple solution if your wanting to run your script with more frequency than that. #run every minute on the minute * * * * * user /path/to/executable param1 param2 #run every minute on the minute with 30sec pause before exec. * * * * * user ( sleep 30 ; /path/to/executable param1 param2 ) http://stackoverflow.com/a/9619441/1258598

Categories : Mysql

Open WebMatrix SQL Server database in Microsoft SQL Server Management studio
I need more information to help you, are you having trouble determining the server or the login or what? You need to login as a user with rights on that database. Do you know the server name that it was migrated to? If you are looking for an easy to use tool to convert between mssqlce and sqlserver try this one: http://sqlcetoolbox.codeplex.com/releases/view/69910

Categories : SQL

SQL server 2012 : SQL query to get list of database for which a server is secondary in high availability configuration
So, I don't have an exact query for you but it shouldn't be too hard to do, there are 2 DMVs to look at for this: sys.dm_hadr_availability_group_states - This will tell you about the availability groups and which servers are primary/secondary replicas for each sys.dm_hadr_database_replica_states - This will tell you about the databases within each availibility group and what state they are in Join the two of these together on the group_id column and you will be able to see what databases are in which availability group and which servers are acting as primary/secondary replicas. Links to the docs here: AlwaysOn Availability Groups Dynamic Management Views and Functions

Categories : Sql Server

prestashop: Database Server is not found. Please verify the login, password and server fields (DbPDO)
Ok, I think I know what you did here. Did you create a separate gear on your own running the MySQL cartridge? If that is the case, you will not be able to reach it from your php scaled gears because of SELinux and the way that applications are protected from directly reaching each other. You should add the MySQL database to your existing scaled PHP application, it will get put on it's own gear, and you will get MYSQL environment variables like these to use: [phpscaled-cdaley.rhcloud.com 5296d2cc5973cac73800018f]> env | grep MYSQL OPENSHIFT_MYSQL_DB_PORT=62551 OPENSHIFT_MYSQL_DB_HOST=5296d32550044690010001c3-cdaley.rhcloud.com OPENSHIFT_MYSQL_DB_PASSWORD=xxxxxx OPENSHIFT_MYSQL_DB_GEAR_UUID=5296d32550044690010001c3 OPENSHIFT_MYSQL_DB_USERNAME=xxxxxx OPENSHIFT_MYSQL_DB_URL=mysql://xxxx

Categories : PHP

Issue when using linked server to pass a parameterized dynamic query from SQL Server to a MySQL database
You need to prepare the a statement and then execute it: SET @Params = '1000001289,1000001294,1000001296,1000001303,1000001304,1000001306,1000001308'; SET @SQL = CONCAT('SELECT LoanNumber FROM plms.vw__bid_dd_overlay WHERE LoanNumber IN (' , @MyParams , ' );'; PREPARE statement FROM @SQL; EXECUTE statement; Reference to the mySQL manual

Categories : Mysql

Error while inserting data from SQL server to AS400 database using IBMDASQL provider for linked server
IBMDASQL does support commitment control; it's IBMDA400 that does not (according to the http://www-01.ibm.com/support/docview.wss?uid=nas8N1014514 link). If the table is not journaled, then the transactions must run with commitment control disabled. That's a bad practice. The table should be journaled. If it causes significant performance issues, it's almost certainly because the system is too small for its workload or it's configured poorly.

Categories : Sql Server

SQL Server 2008 R2 custom database as system database
Thanks to cgsmks, the answer was to disable replication. The database had been marked as the distributor database during replication configuration, which moves it to the system folder! From the link http://www.sqlservercentral.com/Forums/Topic1381740-1292-1.aspx posted by cgsmks: To undo the operation, I right clicked on the Replication Folder and selected Disable Publishing and Distribution. I then selected the Yes, Disable Publishing on this Server option and completed the wizard.

Categories : Sql Server

Rails encrypt Database password in database.yml for SQL-Server
You can use Crypto gem for that encrypted_password = Crypto.encrypt(password, 128_character_key, 128_character_iv) To decrypt use password = Crypto.decrypt(encrypted_password,same_key,same_iv)

Categories : Ruby On Rails

To transfer data from sql server database to another copy of the same database
My suggestion would be to setup a linked server and then create stored procedure that make use of MERGE SQL command. Note this is semi pseudo code example MERGE DB2 AS target USING DB1 AS source ON <Primary Keys> WHEN MATCHED THEN UPDATE SET Key = source.Value WHEN NOT MATCHED THEN INSERT (<Columns>) VALUES (source.values) OUTPUT deleted.*, $action, inserted.* INTO #MyTempTable; Then you can create a SqlConnection/SqlCommand and then call the stored procedure. This code you can ultimatelt host in a windows service or normal .Net event i.e. button click, OnLoad as example.

Categories : C#

How to import data via post deployment script from SQL Server CE into a SQL Server DB freshly created using VS database project
1) Is it possible to reference a SQL Server Compact database (sdfDB) in T-SQL script? If you are thinking to something like this, INSERT INTO [SQL SERVER Db].Table (Values) SELECT (Values) FROM [Sql Server Compact Db].Table unfortunately no, this is not possible. 2) If not, what is the best practice to import data into a freshly created DB from an embedded datasource which can be deployed by build script in a remote machine. You can use the SQL Server Compact Toolbox, that contains features to generate scripts from a Sql server compact file, that you can use to populate the SqlServer database. Features: Script! Migrate a SQL Server Compact database directly to SQL Server (LocalDB/Express) Migrate from SQL Server Compact to SQL Server, SQL Azure and SQL

Categories : Visual Studio 2012

Web API controller for uploading a file on the server and save it in my sql server database
This now really becomes a sql server question. You need to store the binary data in a varbinary(max) column. More help here.

Categories : C#

Detect if browser supports WebP format? (server side)
The "proper" way is to check the accept header which is sent, but a bug in Chrome means that it won't list image/webp even though it does support it. This is a relevant forum thread: https://groups.google.com/a/webmproject.org/forum/#!topic/webp-discuss/6nYUpcSAORs which links to this bugtracker: https://code.google.com/p/chromium/issues/detail?id=169182 which in turn links to this one: https://code.google.com/p/chromium/issues/detail?id=267212 End result? While it isn't implemented just yet, soon Google Chrome will explicitly list image/webp as an accepted type for both image and non-image requests. So your script which serves the HTML can check for that. Opera already sends image/webp as part of its standard accept header (again regardless of whether it is an image request or not). S

Categories : PHP

Is there a way to detect 'Aw Snap' pages in Chrome and report to server side?
"Aw Snap" happens when a Chrome process crashes. The page can't find out about that. It is possible to do this in an extension, though. The onExited event in the experimental processes API provides exitType, which can indicate when a process crashed. Currently, this API is only available in the dev channel of Chrome.

Categories : Javascript

How to Restore Database in Server's sql server Database?
db_backupoperator can BACKUP databases only. They cannot RESTORE. http://msdn.microsoft.com/en-us/library/ms189041(v=SQL.90).aspx

Categories : Sql Server

How to connect from a linux server with php to a database that is in a windows server?
Where the database is doesn't matter for connecting. As long as you use the correct credentials and functions, it will connect. If you see any connection method( PDO, mysqli etc ), it doesn't show the operating system anywhere. Database is running on top of the operating system. check for errors in each step. Example: $link = mysqli_connect("myhost","myuser","mypassw","mybd") or die("Error " . mysqli_error($link)); See http://www.php.net/manual/en/function.mysqli-connect.php.

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.