ssms

Unexpected EOF encountered in BCP data-file

此生再无相见时 提交于 2019-12-02 17:43:32
问题 I was trying copy data from a table to another table in another database using bcp. First a format file was created using !! bcp dbName1.dbo.tableName1 format nul -S serverName1 -T -f D:\tableName1_fmt.txt -n Then the data file was created using !! bcp dbName1.dbo.tableName1 out D:\tableName1.txt -S serverName1 -T -c Now I tried to import the data-file to another table in another database present in another server using the format file !! bcp dbName2.dbo.tableName2 in D:\tableName1.txt -f D:

Easy way to convert exec sp_executesql to a normal query?

岁酱吖の 提交于 2019-12-02 17:32:06
When dealing with debugging queries using Profiler and SSMS, its pretty common for me to copy a query from Profiler and test them in SSMS. Because I use parameterized sql, my queries are all sent as exec sp_executesql queries. exec sp_executesql N'/*some query here*/', N'@someParameter tinyint', @ someParameter =2 I'll take this and convert it into a normal query for ease of editing (intellisense, error checking, line numbers, etc): DECLARE @someParameter tinyint SET @someParameter = 2 /*some query here*/ Of course, the bigger and more complex the query, the harder to do this. And when you're

SQL Server Management Studio - find stored procedure by name over multiple databases

为君一笑 提交于 2019-12-02 17:19:15
问题 I have recently joined a software project that has approximately 20-40 databases. Each database has at least 200 stored procedures, some of them have many more, so it is very slow for me to search for a particular procedure manually. I know that there is a stored procedure which I need to look at to fix a bug, somewhere in the entire project, it is called XYZ_procedure How do I search for this procedure over all of my databases in SQL Server Management Studio? 回答1: You can use dynamic SQL to

How to use git as source control provider for SQL Server Management Studio [closed]

一笑奈何 提交于 2019-12-02 17:00:17
Can we use GIT as the source control for sql management studio? for Database source control within SSMS Agent SVN - SCC Subversion Plug-in. http://www.zeusedit.com/agent/ssms/ms_ssms.html or http://www.red-gate.com/products/sql-development/sql-source-control/ I’ve found out that ApexSQL has a tool that natively supports Git as a source control system. It comes as a SSMS add-in, and offers a wizard you can use to map database objects with the source control systems. To do that: Download and install ApexSQL Source Control Start SSMS and in Object explorer select the database you want to be

Cannot connect to (LocalDB)\\MSSQLLocalDB -> Login failed for user 'User-PC\\User'

冷暖自知 提交于 2019-12-02 15:52:39
I am getting an error, While I am trying to connect (LocalDB)\MSSQLLocalDB through SQL Server management studio. I also tried to login with default database as master the error is same. Here is the Server details. The following command through sqllocaldb utility works for me. sqllocaldb stop mssqllocaldb sqllocaldb delete mssqllocaldb sqllocaldb start "MSSQLLocalDB" After that I restarted the sql server management studio, and it is successfully established connection through (LocalDB)\MSSQLLocalDB Right click your server and go to Properties, the select the Security Under Server Authetication

SQL Repeating Character String

廉价感情. 提交于 2019-12-02 14:42:59
问题 Is there a way to evaluate a field if it has repeating values in a cell. For example if someone holds down a number key and it returns some variation of '00000' or '222222222' or '333' or something of the sort, the value can only be numeric in this field. I am looking for a way to query on a field where a pattern like this may occur. 回答1: The following finds patterns i.e. 333... or 123... or 987... Think of it like Rummy 500... Runs and groups of 3's or more. Declare @Table table (col int)

Keyboard shortcut to automatically wrap selected text in IsNull([text], 0) in SSMS

China☆狼群 提交于 2019-12-02 13:13:35
问题 Is there some way to have a shortcut in SQL Server Management Studio (SSMS) that when text is selected, it wraps that text in an IsNull() statement? For example, I highlight the text below: My_column_name and when I click the keyboard shortcut, what was highlighted turns into: IsNull(My_column_name, 0) I am using SSMS v17.4 回答1: You can get this done using snippets. It's not exactly a simple shortcut, but a few keystrokes will get you there. First you need to create a snippet like this: <?xml

SQL Repeating Character String

老子叫甜甜 提交于 2019-12-02 12:57:35
Is there a way to evaluate a field if it has repeating values in a cell. For example if someone holds down a number key and it returns some variation of '00000' or '222222222' or '333' or something of the sort, the value can only be numeric in this field. I am looking for a way to query on a field where a pattern like this may occur. The following finds patterns i.e. 333... or 123... or 987... Think of it like Rummy 500... Runs and groups of 3's or more. Declare @Table table (col int) Insert into @Table values (4141243),(4290577),(98765432),(78635389),(4141243),(22222),(4290046),(55555555),

SSRS Records Not Showing Up When (Select All) Is Used But Is When Selecting A Particular Value

强颜欢笑 提交于 2019-12-02 12:16:05
问题 I have a report that is has a multiple value parameter. It has available values (1, 2, 3, 4, 5, and blank). The blank value isn't NULL it is just an empty cell. For testing purposes, there should only be one record showing up. The record has a blank value in the cell that I am using to filter on in my stored procedure. In the parameter drop down, I see all of the options. If I choose the (Select All) option, I don't get the record I am wanting. However, if I choose just the blank value, I get

SQL Server Management Studio - find stored procedure by name over multiple databases

China☆狼群 提交于 2019-12-02 11:48:26
I have recently joined a software project that has approximately 20-40 databases. Each database has at least 200 stored procedures, some of them have many more, so it is very slow for me to search for a particular procedure manually. I know that there is a stored procedure which I need to look at to fix a bug, somewhere in the entire project, it is called XYZ_procedure How do I search for this procedure over all of my databases in SQL Server Management Studio? Alfaiz Ahmed You can use dynamic SQL to check procedure over all of databases in SQL Server Management Studio USE MASTER GO BEGIN TRAN