Lincoln Burrows
Forum Replies Created
-
AuthorPosts
-
August 18, 2015 at 12:16 pm in reply to: How to Search all Tables and Columns in SQLite Database? #481 Score: 0
try this “SELECT name FROM sqlite_master WHERE type=’table'” to search all tables and columns in SQLite database.
For Example:
import sqlite3
import os
filename = …
with sqlite3.connect(filename) as conn:
conn.row_factory = sqlite3.Row
cursor = conn.cursor()
cursor.execute(“SELECT name FROM sqlite_master WHERE type=’table'”)
for tablerow in cursor.fetchall():
table = tablerow[0]
cursor.execute(“SELECT * FROM {t}”.format(t = table))
for row in cursor:
for field in row.keys():
print(table, field, row[field])Change the DATABASE_NAME to an absolute path: /var/www/apps/apps.db.
On a windows machine, backslash should be escaped like: C:\\path\\to\\database\\database_name.db.
August 7, 2015 at 9:59 am in reply to: How to Detect Modified Pages In SQL Server Tables? #435 Score: 0I am Using SQL Server Version 2005
August 4, 2015 at 10:38 am in reply to: Does tempdb.mdf Size Get Affected By the Recovery Model Of a Database? #423 Score: 0The tempdb is a ‘processing’ part of the database in SQL Server which includes: static cursors, table variables, temp tables, sort operations and other worktable backed query operators, large variables and parameters. So the recovery mode doesn’t affect to the tempdb.
Try this query:
RESTORE DATABASE mydb
FROM DISK = ‘C:\Backupmydb.bak’
WITH MOVE ‘mydb_Data’ TO ‘C:\Data’,
MOVE ‘mydb_Log’ TO ‘C:\Data’May this works perfectly with SQL Server 2012.
Which SQL Server Version you are using right now?
You must run the DBCC CHECKDB and find the causes of the error in the error log file otherwise restore from full backup.
In such situation you must restore it from backup
July 3, 2015 at 10:12 am in reply to: SQL Server log file does not match the primary file #313 Score: 0Please posts your errors message from the SQL Server Error Log to analyze your error in more sophisticated way.
-
AuthorPosts