I have a table for my game called monsterClass. It’s a pretty simple table with these columns: And here’s sample data: etc Well, foolish me was quickly trying to update a certain set of monsters, a mix of monsters with various names, with a new monsterMapYear (7000). I did set the needed set of monsters to the have a monsterMapYear
Tag: sql-server-2008
How to select duplicate records for a column having Data/NULL values in other columns?
I have a table in SQL server with 2.5 M records and I want to select the unique records as in image below. Can someone help me write a select query for this? Original table and requested data:
Building an Employee Date Matrix
I have a list of employees, along with list of cities they’ve worked in. I need to build a matrix (in SQL Server) of start/end dates by city to determine where they were at any given period in time. The “end date” would be exactly the date before they appeared at a new location. I’ve included an example of the
Finding double bookings
I have two tables which when linked by a booking ID from table 1 and ID from table 2 Therefore Im trying to flag double bookings where the same member id has booked twice within a time frame (StartDateTime and EndDateTime). Then remove the booking that has the latest BookedDate. Can someone help me with a sql script for this?
Pass a table variable using table type into a stored procedure?
I have a table employee with around 1000 entries, I have to create a stored procedure which accepts a parameter. The parameter will most likely be of the type which I created ‘AS Table’. Upon passing …
I have multiple entry and exit status of a person. how do i get the last status of single person
I have a table in sql in following format Output required Answer In_Time should be the first instead of the last status. Then your result should be instead Userid IN_TIME OUT_TIME Code like below, live demo here Updated If you want to get the last status for In_Time, just adjust slightly condition from Min to Max like below, live demo
How to search for separated values in cloumns from a merged values column
I have a database where the data I need to work with is stored into two different columns. I also need to import an excel file and the data in this excel file is all together only separated by a dash. …
Assign default values in SQL Server dynamic pivot
Below is pivot query for my requirement. Below is my script for table creation scripts with data. Table_TraineeInfo is candidate registration details table, Table_Batch_Lookup is batch detail when batch start date and end date base on filling in pivot, Table_Attendance_Log is candidate attendance log. My current output I want below output if date is less than or equal to today
Sort a VARCHAR column in SQL Server that contains numbers?
I have a column in which data has letters with numbers. For example: When sorting this data, it is not sorted correctly, how can I fix this? I made a request but it doesn’t sort correctly. Answer This should work
How to reduce SQL log file size
SQL log file size is very big in our production database and hard disk space left only 2G. Is it safe to delete .ldf file? Answer Check out this post In the interim, this should at least allow you to kill the log file: Perform a full backup of your database. Don’t skip this. Really. Change the backup method of