Tag: ssms

Using SQL Stored Procedure to encrypt password in SHA2_512 affects 0 rows

I’m currently working on a database as a student, I’m quite new to SQL and I’ve been trying to avoid saving passwords in plain text in my DB so I looked through the internet and ended up using CREATE PROCEDURE uspAddUser @pAcctID char(8), @pLogin NVARCHAR(50), @pPassword NVARCHAR(50), @pLName NVARCHAR(40) = NULL, @pFName NVARCHAR(40) = NULL, […]

SSMS print on same screen on while loop

I have a basic select script should be running every 3 seconds and print out results on SSMS. But during while loop, this script prints results on different views (keeps creating vertical separated tabs). Is there any way to clear historical results and only keep latest select output? while 1=1 begin select top 100 DATEDIFF(minute, […]

Cloning a SQL Server database to another collation

I’m not sure if this is the best way to migrate data to another collation but I’ve done the following: 1) Scripted the source database and changed the collation in the script to my required one 2) Ran the script and created the new database with the wanted collation (along with all the tables,triggers,indexes etc. […]

Server level Admin Rights not working?

I created a server on Microsoft Azure, and a SQL database on it. I downloaded SQL Server Management Studio, and I am able to connect to the server fine using the Server Admin Id and password I created when creating the server. But when I try and run a bulk load query to insert a […]

SQL Server – Why doesn't column show full string?

I have a table in SQL Server 2008 with the following column: Column Name|Data Type |Allow Nulls FullName |nvarchar(250)|Yes When I try to insert a new Full Name longer then 10 characters it cuts off anything after the 10 characters. For example: INSERT INTO ..(FullName) VALUES (‘Apple EnPearSSSS’) Results in the database: FullName | Apple […]

Changing maintenance plan in SQL Server Management Studio

I have a maintenance plan that is set up to back up all of my 5 DB’s every day. I do not need to backup them all, only part of them. I don’t want to create a new job as my website is old and I don’t want to make significant changes (moreover, I am […]

How to see if values in a column changed across multiple dates

I have a table below that I need to see if interest rates changed for any loan number within a given period. Below is just sample data, I need to find this information across 2 million rows. How can this be done? Sample data +————+————-+—————+ | DATE | LOAN_NUMBER | INTEREST_RATE | +————+————-+—————+ | 04/01/2010 […]

Import xml file into SQL Server without database (tables)

I have a database which is in XML format contains both structure and data but I don’t have database to import the data from XML. Is there any way to import the XML file into SQL Server, so that SQL Server will read the XML file and subsequently create table structures and insert the data […]

How to disable immediate autocomplete in SQL Assistant for SSMS

It’s a bit annoying that SQL Assistant shows “autocomplete” window on each , or . button press. Actually I don’t need it’s assistance in most of cases but still would like to have it’s features enabled. So I don’t want to switch it off (suspend), but’d like it to show me autocomplete window only when […]

Is there a way to retrieve a list of existing savepoints that have been defined in a transaction in MS SQL Server Management studio

Say, I have a huge transaction with multiple save points defined at different intervals. Is there a command or tool that I can use that will provide me a list of the names of the savepoints that I have defined in my script.

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.