Questions tagged as 'ssms'

3
answers

How to access the code behind a Stored Procedure?

How can I access the code behind a stored procedure ? Home I am using Microsoft SQL Server Management Studio .     
asked by 30.06.2017 / 21:47
4
answers

How to perform SQL concatenation

I need to concatenate year and month. How could I do that? select cast(year(orderdate) as int) + ' ' + cast(month(OrderDate)as int) as Year_Month From sales.SalesOrderHeader     
asked by 14.08.2017 / 18:15
2
answers

Add field in position I want in sql server

Whenever I make a ALTER TABLE and add a column, that field goes to the end. In design mode, using the graphical tool of Sql Management, there is the option of Insert Column in any position, but it happens that I can not save. I have...
asked by 30.01.2015 / 12:12
1
answer

Sql Server Management Studio can handle any database?

I'm asking this question because I find this DBMS simply fantastic, so I'd like to use it with another database (not because I want to, but because most of the databases I have are in Mysql). Is there any adapter, plugin, or any feature that...
asked by 04.03.2016 / 15:33
2
answers

I have this query and I am not able to group by month

DECLARE @Year INT = 2005, @Month INT = 7 SELECT --SequenceNo = ROW_NUMBER() OVER(ORDER BY OrderDate), Year = Year(convert(int,OrderDate,111)), case Month(convert(int,OrderDate,111)) when 1 then 'Janeiro' when...
asked by 10.08.2017 / 23:19
1
answer

Delete all records from a database except a user

I have a database that I need to delete all the records that exist in it, except a user who is in the User table with a link to another table ( AspNetUsers ). I have already made a few attempts at SSMS , but I always encounter references and...
asked by 26.11.2018 / 16:50
2
answers

Is it possible to know where a sql execution originated from SQL SERVER?

There is a situation that I believe will be of great importance to me, which is to know the origin of a sql command in SQL SERVER. Suppose that a user accidentally ran any command. So I need to know who ran the command. Is there any way to...
asked by 16.02.2016 / 17:27
3
answers

I have this cursor and the 'between' where it gives error. I would like to select the years from 2005 to 2008

DECLARE @Year int DECLARE db_cursor CURSOR FOR Select distinct Year(OrderDate) as Year From Sales.SalesOrderHeader Order by Year(OrderDate) OPEN db_cursor FETCH NEXT FROM db_cursor INTO @Year WHILE @@FETCH_STATUS = 0 BEGIN --INSERT INTO xxxx...
asked by 11.08.2017 / 18:47
1
answer

Check triggers linked to a given table

I use the database Sql Server 2012 And the tool SQL Server Management Studio 2012 How can I check the triggers that are bound to certain tables without having to go through the object browser? Is there any select or so...
asked by 13.06.2017 / 21:51
2
answers

How to create a database in SQL Server?

I installed SQL Server, and here comes Magnament Studio, how do I create my bank? I already tried going there, and I had to authenticate for Windows but it gives an error. How do I create my bank?     
asked by 02.02.2015 / 04:42