Tag Info

Hot answers tagged

4

As already shown in the comments, I've seen/used the same feature in SSMS 2005 as shown here. But I didn't manage to see what ever editor window setting would be different than in SSMS 2012/2014 where the behavior has changed.


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 ...


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

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


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 ...


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 ...


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 ...



Only top voted, non community-wiki answers of a minimum length are eligible