Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2017 - Development |
how can i see the last 100 select statements that were run by any user - how can i see the last 100 select statements that were run by any user against a particular table? |
Identity column as Primary Key - good or bad? - I'm building a web app to maintain some data, which is mostly flat but will benefit from having some static look-up tables. Typically these look-up tables with have at most a dozen rows and are unlikely to change over time. Consider the two different DDL scripts. The first creates a look-up table CustomerType with an […] |
SQL Server 2016 - Administration |
DB goes into not sync / suspect after a manual failover - After the patching, one of the database goes into Not synchronizing / suspect state. I resumed a data movement manually. It goes into recovery pending to suspect. This is from the log file 'DB has been suspended for the following reason: "system" (Source ID 2; Source string: 'SUSPEND_FROM_REDO'). To resume data movement on the database, […] |
SQL Server 2016 - Development and T-SQL |
One table or two? - I have an outside company that will be sending me 2 files each month. File 1 has approx. 280 columns, File 2 has around 330. The first 150 column names on each table are exactly the same. The remaining columns on each file are unique to that file(no overlapping column names). There is no one-to-one […] |
How to apply rank when fetching data from table using sql query? - Hi Everyone, I need your help to get the required results. I want to get a machine status every 5 minutes. here how to apply rank as the sequence number for given resultset. the Rank should be a mentioned snapshot. Thanks in advance for your support Sample Script select Starttime, Endtime,Status as machineStatus,datediff(minute,starttime,Endtime)as diff […] |
list to table, versus delimitedsplit8k - Dear reader The list to table is build around a while loop, one item is taken of the list and put in a table, the list is shortened and the while loop is repeated. On seeing this construction I thought this would be a good candidate to be replaced with the delimitedsplit8k function. So to […] |
Development - SQL Server 2014 |
repeating block of records - I want to look for blocks of records repeating in a table. pattern is unknown...to keep it simple - table X can have up to 100 records in the example below: The block: A,B and C is repeated 2 times I don't care about (A and B) or (B and C) repeated twice...I […] |
SQL 2012 - General |
Compare two databases - Hi , What are the parameters to compare two databases if migrated from source to destination . |
Need of database - In order to structure and layout 50GB of data which includes pdf files, videos, images, etc, which is the better way to implement? Using sql or not? Please can you tell me the pros and cons of it. Thank you. This is for an intranet site development! |
SQL Server 2008 - General |
Backup file size 3X after shrinking the log file? - Here's a head scratcher - I've not seen anything like this in 20+ years of DBA life! I received a SQL Server 2008 R2 backup file to restore. There wasn't enough disk space on the server so I moved the file to my workstation to look at it. After restoring the database, the transaction log […] |
Using crypt_gen_random to generate unique Serial Numbers - Trying to generate unique serial numbers with alphanumerics (A-Z,a-z,0-9) and no special characters.Used below code where sLength was min 10 and max 12 as defined in front end. declare @sLength tinyint declare @randomString varchar(50) declare @counter tinyint declare @nextChar char(1) declare @rnd as float set @sLength = 3 set @counter = 1 set @randomString = […] |
OPENQUERY is not inserting identical rows - Hi, Thanks in advance for any help. I am trying to insert into a sql table using data from an oracle server using a linked server. I have noticed it ignores any lines which are identical. However I do not want to ignore these and would like the query to insert the rows. I have […] |
SQL Azure - Development |
Azure file copy creating a directory to hold the renamed file - Hi All, I'm pretty new to azure and am hitting the following problem. I've got a notebook that creates an output csv file. The file gets named to the default Part-0000-tid and I want to rename it to something more sensible. The code below shows what I've done. The problem is it creates a subfolder […] |
SQL Azure - Administration |
Metric CPU show 100% , but Query Performance Insight show only 60% same period - Hi, I am investigation DTU spike for period specific period of time In my case time period in question between 08:00 PM and 11:00 UTC Azure portal ->db ->metric -> Cpu % avg show that I have 100% usage of CPU (db DTU = 1750) between 08:15 PM and 08:45 PM Azure portal->db-Query Performance Insight-> […] |
Integration Services |
Dynamically execute SSIS package. - I am trying to figure out how to dynamically execute SSIS package based on file path that are stored in the table. I found some examples online, it won’t work for me for some reason. The path could be something like this \\ServerName\\SubFolder\Name.DTSX. Most examples I found online has something to do with SQL Server […] |