Tag Info

New answers tagged

1

The last LSN of the FULL BACKUP should match the Last LSN of the log backup. This will be your first log backup and then after that the consecutive log backups will be having A.LAST_LSN = B.FIRST_LSN --> where B = log backup taken immediately after A. From BOL : Now look at the error you are getting : The log in this backup set begins at LSN ...


1

You are trying to apply a Log file that finish with LSN 421814812000000025600001 into a DB restored with LSN 421787067000000013800001 , so, the LSN of the Full Backup (restored) is older than the log file that is trying to apply. So, the log file would not possible to apply , being a change in sequence. So possible cause here being that you are not ...


1

If you need to execute sql file use sqlcmd documented in the MSDN: Run Transact-SQL Script Files Using sqlcmd This did the trick for me: sqlcmd -S serverName\instanceName -i script.sql -o output.txt


0

If you undo (ctrl-Z) after the wrong auto-selection appears, your original entry will be restored.


1

If you don't want to use the Import/Export Wizard, I'm one for using Excel's built in functions to easily create my SQL Scripts to import data from CSV. One way to do this is with the CONCATENATE operator. Imagine you are writing an INSERT....VALUES statement, you need to build up the VALUES part with data in your CSV. This is essentially a comma separated ...


2

The answer is no, you cant speed this up. This is not a good way of dealing with importing data as there is quite a lot of code running in background creating insert scripts for the lines on the clipboard. If you don't want to write the code: SELECT * INTO TABLE FROM OPENROWSET('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};DEFAULTDIR=<PATH W/ ...


2

You don't need to write code. Just use the Data Import/Export Wizard. Right-click on the database in SSMS, go to Tasks and Import Data. Select Flat File Source as your data source (because you're using CSV), and then browse for the file. Click next, select the database and the target table. You'll need to check the mappings for the CSV columns to the table ...


1

I have been troubleshooting an issue within a database that has some serious blocking issues. I am just wondering if there is a way to see what variable is associated with the query. I would suggest, you should use either of below for troubleshooting blocking problems : You can use beta_lockinfo by Erland Sommarskog beta_lockinfo is a stored ...


0

Add the line use master at the bottom of your query window, which will release the connection used by the previous lines. Then you can do whatever you want to your db, regen, move, backup, etc... without needing to close the query window. This is quite useful for testing scenarios where you don't want to reload the query window every single iteration. use ...


0

I found this article that talks about a situation where the DBA received the same error (15151) and determined the issue was related to an open session for that user. He doesn't mention anything about not being able to find the user, but I figured I would pass this on just in case it helps. Link to the article: SQL SERVER – Fix : Msg 15151, Level 16, ...


2

Short intro To connect to the server you have to have a login to access the server. To access a database you have to be a user in that database. All Logins are member of the server role public which can access the master database. So to find users to drop within a database you query sys.database_principals and to find logins sys.server_principals. When you ...


0

To fix this issue: Tools \ Options \ Keyboard. Bring up the command in the "Show commands containing:" list. Then in the "Press shortcut keys:" text box press CTRL+Tab and click Assign. This will re-assign the command back to itself, but fixed the "sticky" window. Just had the same issue. Hope this helps.


0

You should insert the database name: sqlcmd -U ProvideLogin@Server -P ProvidePassword -S ProvideServerName -d ProvideDatabaseName https://msdn.microsoft.com/en-us/library/azure/ee336280.aspx


1

From 2012 onwards this is possible and can be done with help OF sys.dm_exec_describe_first_result_set DMV. This dynamic management function takes a Transact-SQL statement as a parameter and describes the metadata of the first result set for the statement You can refer here for a read on this sys.dm_exec_describe_first_result_set Also, refer to ...



Top 50 recent answers are included