Stephen West
Forum Replies Created
-
AuthorPosts
-
November 9, 2015 at 7:53 am in reply to: How to delete all tables in SQL Server database? #886 Score: 0
Can I delete it form command prompt ?
November 2, 2015 at 6:41 am in reply to: How can I get the query history in SQL Server? #879 Score: 0Run this:
SELECT d.plan_handle , d.sql_handle , e.text FROM sys.dm_exec_query_stats d CROSS APPLY sys.dm_exec_sql_text(d.plan_handle) AS e
And filter output with
WHERE text like '%something%'
October 29, 2015 at 7:29 am in reply to: How to rebuild indexes in SQL Server Database #874 Score: 0No this query is only to rebuild a defragmented index. But you can rebuild all indexes in a table by using the following query
USE AdventureWorks2012; GO ALTER INDEX ALL ON Production.Product REBUILD WITH (FILLFACTOR = 80, SORT_IN_TEMPDB = ON, STATISTICS_NORECOMPUTE = ON); GO
October 26, 2015 at 6:10 am in reply to: How to rebuild indexes in SQL Server Database #862 Score: 0Execute the below query
USE AdventureWorks2012; GO ALTER INDEX PK_Employee_BusinessEntityID ON HumanResources.Employee REBUILD; GO
October 23, 2015 at 11:11 am in reply to: How to rebuild indexes in SQL Server Database #858 Score: 0Yes, you can do it by using SQL Server Management Studio or using T-SQL.
have you checked the permissions to do it?
October 8, 2015 at 11:53 am in reply to: how to fix error 9001 (“DatabaseName” is not available) ? #817 Score: 0Yes I did run the DBCC CHECKDB but it shows the below message:
CHECKDB found 0 allocation errors and 0 consistency errors in database ‘DB’.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.Try to restore a backup to another server and do some disk checks on your primary machine.
October 3, 2015 at 10:29 am in reply to: How to Detect Modified Pages In SQL Server Tables? #775 Score: 0run the following query to find the last update
SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName, last_user_update,* FROM sys.dm_db_index_usage_stats WHERE database_id = DB_ID( 'AdventureWorks') AND OBJECT_ID=OBJECT_ID('test')
use the following query:
BACKUP DATABASE [AdventureWorks2012] TO DISK = N'F:\Backup\AW12.bak' WITH CHECKSUM;
September 29, 2015 at 7:23 am in reply to: How to Create Chrome Extension With SQLite Database? #764 Score: 0You can use
Web SQL API
which is an ordinary SQLite database in your browser and you can open/modify it like any other SQLite databasesSeptember 24, 2015 at 12:01 pm in reply to: How to change authentication mode in SQL Server 2008? #727 Score: 0Try the following steps:
1. Open SQL Server Management Studio and connect to your database server.
2. Right Click on Database Server and click Properties.
3. Set the Server Authentication to SQL Server and Windows Authentication Mode.September 21, 2015 at 12:35 pm in reply to: SQL Server log file not accessible, dbcc not really useful, how to analyze? #702 Score: 0not sure, I know when stored proc was called, from my webserver log, now trying to track it down on db logs.
For a binary blob? That would be in violation of the SQLite documentation which says blobs are treated as text and as such length() is accurate only until it finds a \0 character
You should avoid directly manipulating the database and use migrations instead. If you forgot to add a column then you should create a new migration using add_column to add the column to the table.
Alternativly if the previous migration was the one that created the table with the missing column and you’ve not distributed this migration yet you can do rake db:rollback, editing the migration and run rake db:migrate again.
Your lack of tables when running the sqlite command is most likely because you forgot to specify the sqlite file to load: sqlite3 <db_name>
You can use the date created property from the file system to choose the youngest backup. This was the solution I wanted.
When the SQLCommand.CommandTimeout is set to zero, you expect an infinite timeout. However, versions 1.1 and 1.0 of the SqlClient provider incorrectly timeout when a response from SQL Server is broken into two packets. Immediately upon receipt of the second packet, versions 1.1 and 1.0 of the provider incorrectly timeout. The fix that is included in this article fixes this issue so that the command will have an infinite timeout.
Did you create the table originally via a migration?
Can you make the below verification to see whether your encryption and decryption works correctly or not..
In Old Server
OPEN SYMMETRIC KEY [key_name] DECRYPTION BY CERTIFICATE key_cert; GO SELECT encryptbykey(key_guid('key_name'), 'TestData') GO
In New Server
OPEN SYMMETRIC KEY [key_name] DECRYPTION BY CERTIFICATE key_cert; GO DECLARE @blob varbinary(8000); SET @blob = 'output from earlier select statement' SELECT CONVERT(varchar(8000), decryptbykey(@blob)); GO
Close symmetric keys in both servers
CLOSE SYMMETRIC KEY [key_name]; GO
September 3, 2015 at 12:30 pm in reply to: How to view an MDF file for archive purposes? #560 Score: 0That’s right the SQL Server is not shown as a running service.
Now how do I overcome this?
-
AuthorPosts