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