ssms

BCP queryout from Azure VM : SQLState = 37000, NativeError = 40515 Reference to database and/or server name in 'DBName.dbo.TableName' is not supported

天涯浪子 提交于 2021-01-28 06:44:30
问题 I was trying to export a table from database in Azure VM into a text file using BCP in my Local Machine's SSMS. !! bcp "SELECT * FROM DBName.dbo.TableName" queryout D:\tablename.txt -S AzureVM -U userName -P passWord -n But following error was the result Starting copy... SQLState = 37000, NativeError = 40515 Error = [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Reference to database and/or server name in 'DBName.dbo.TableName' is not supported in this version of SQL Server. SQLState =

Cannot create master key for master database in azure sql

孤者浪人 提交于 2021-01-27 21:25:35
问题 i'm using Azure SQL. In Azure Portal, i was create 1 Azure SQL Server (with username login user01 ) and 2 Azure SQL Database ( ExDatabase1 and ExDatabase2 ) inside it. In Microsoft SQL server management studio tool, i'm login success with user user01 . i'm using transparent data encryption (TDE) and try create Database Master Key for master database with command bellow: USE master; Go CREATE MASTER KEY ENCRYPTION by PASSWORD = 'Strongp@ssw0rd'; Go But, i received error: Msg 15247, Level 16,

SSMS: Automatically save multiple result sets from same SQL script into separate tabs in Excel?

北战南征 提交于 2021-01-07 06:50:24
问题 I have a SQL query I'm running in SSMS that generates about 8 different resulting datasets (all with different columns). Is there a way to have each of the result sets get out output to a separate tab in Excel without having to copy/paste and result set table individually from SSMS. I know one approach would be to UNION all the results and patch with fake columns (so that the columns line up) and then generate a single output set. But that would then require manually filtering and separating

MS SQL Server - Export Results To File without “NULL”

痞子三分冷 提交于 2021-01-02 05:43:26
问题 I am using SQL Server Management Studio to export the results of my query to text. I would like to export the results without the character NULL being printed between delimiters. For example, instead of: ,NULL, I would like to export: ,, Thanks for your help 回答1: Just simply use ISNULL(someColumn, '') in our query. This will replace all NULL values with an empty string 回答2: It depends on how you export the data. If you use the Import and Export Wizard, the NULL strings do not show up in the

How do I change “Database default locations” for LocalDB in SQL Server Management Studio?

ぃ、小莉子 提交于 2020-12-30 04:53:23
问题 Connect to LocalDB in SSMS Open Server Properties -> Database Settings Change Data/Log/Backup locations -> click OK When I click OK I get this error: Found some blogpost and changed this in regedit but it didn't help. Anyone got any other ideas I could try? 回答1: I do not believe that these default paths for SQL Server LocalDB are changeable. This is quite unfortunate due to what appears to be a bug with SQL Server Express 2017 LocalDB ** (fixed as of CU 6 for SQL Server 2017) , as per this

How do I change “Database default locations” for LocalDB in SQL Server Management Studio?

梦想的初衷 提交于 2020-12-30 04:52:03
问题 Connect to LocalDB in SSMS Open Server Properties -> Database Settings Change Data/Log/Backup locations -> click OK When I click OK I get this error: Found some blogpost and changed this in regedit but it didn't help. Anyone got any other ideas I could try? 回答1: I do not believe that these default paths for SQL Server LocalDB are changeable. This is quite unfortunate due to what appears to be a bug with SQL Server Express 2017 LocalDB ** (fixed as of CU 6 for SQL Server 2017) , as per this

How to copy and paste script text from SSMS to Outlook or Word without garbling it?

删除回忆录丶 提交于 2020-12-06 13:28:05
问题 Say, I have a script nicely formatted in SSMS and it's annotated with all kinds of comments in different languages. But when I copy and paste this nice thingy into Word with syntax highlighted I will get a syntax-highlighted message with those comments garbled, as if reading the source text with one code page and pasting it using another code page. Very nasty kinda bug. Does anyone know how to solve this issue once and for all? Thank you! [Update] [Solution] Save → Save with Encoding... →

How to copy and paste script text from SSMS to Outlook or Word without garbling it?

馋奶兔 提交于 2020-12-06 13:25:32
问题 Say, I have a script nicely formatted in SSMS and it's annotated with all kinds of comments in different languages. But when I copy and paste this nice thingy into Word with syntax highlighted I will get a syntax-highlighted message with those comments garbled, as if reading the source text with one code page and pasting it using another code page. Very nasty kinda bug. Does anyone know how to solve this issue once and for all? Thank you! [Update] [Solution] Save → Save with Encoding... →

Custom delimiter in SQL Server set in “Results to Text” options doesn't work

无人久伴 提交于 2020-12-06 11:32:10
问题 I am interested in saving the result of a SQL query, like a SELECT statement, as a pipe ( | ) delimited text file in SSMS. I can do that using the Export wizard . However, it seems there's a simpler method by setting a "Custom delimiter" in Tools>Options under Query Results>SQL Server>Results to Text as shown here: Then, if I specify "Results to Text" or "Results to File" , I am supposed to get the pipe delimited result. This is also outlined here:Obtaining Pipe Delimited Results from SQL

Why is SSMS altering my stored procedures (re-formatting, changing exec to EXECUTE, etc.)

余生长醉 提交于 2020-12-05 08:25:29
问题 SSMS is suddenly re-formatting my stored procedure - it has never done this before. Here's an example of what I'm talking about. Here's the start of the stored procedure I created last week: CREATE PROCEDURE [dbo].[usp_LoanDataNames] ( @LoanID varchar(max) = null, @Columns varchar(max) = null, @DataNames NVARCHAR(MAX) = '', @SQL NVARCHAR(MAX) = '' ) AS All the stored procedures I created before today still have that format. But when I create a new stored procedure today, with the same exact