Browse the archive

SQL Server

Load balancing reads SQL Server 2016 AG

Question I'm trying to balance read traffic between two SQL Server 2016 Enterprise Edition instances (Primary and Secondary) using availability groups and the read only routing. Here is my current setup: The servers are in AWS in two different AZ The servers …

Continue reading

Releasing free space in mdf file to OS

Question We have a 120GB database. There was table with 60GB of data which is useless and we have truncated it. Now database size is 120GB with free space 60GB. The database will not grow up to 60GB in at least 3 months. So can we shrink the data file.

Continue reading

SQL Triggers not preventing insert

Question I am having trouble getting a trigger to work. What it needs to do is to prevent any customer with last name Glass from being inserted into the database. This is what I have: CREATE TRIGGER no_last_name_glass_trg ON customer AFTER INSERT,UPDATE AS …

Continue reading

How to add 1100 columns in SQL Server

Question I need 1100 columns in a single table.I already have 928 columns in same table, now I need to add new 150 columns. I know SQL Server allow maximum 1024 columns. Now I will not create new table. If I create new table and join my require table, I need …

Continue reading