Running Total without using of Cursor
Script for computing Running Total on Table without using Cursors.
2003-04-09
399 reads
Script for computing Running Total on Table without using Cursors.
2003-04-09
399 reads
This script will produce the same output as doing a Copy in enterprise manager and then pasting into Query Analyser.It can handle Clustered and Nonclustered Primary Keys, Multiple Foreign Keys, Defaults, Constraints, Identity Fields. If you are able to improve this script, or find any bugs, please let me know.
2003-04-09
175 reads
This procedure will drop (with care) all user-defined objects: constraints, procedures, functions, triggers, views and tables. Used for re-creating database schema without drop and create database.
2003-04-07
122 reads
Utility Script to assist when you are thinking about expanding a database file. When Used in combination with srvinfo you can know just how far you can expand a file to keep the maximum file sizes from getting over the capacity of the drive.
2003-04-07
219 reads
Use this procedure to get parameters for your stored procedure with data type,length, parameter position and also the mode of parameter (Input or Output). Can be used to populate the dynamic parameters for any procedure. Mohit NayyarMCP (.Net), MCSD, MCDBA
2003-04-06
929 reads
Use this function to get the number of days in a given month.Mohit NayyarMCP (.Net), MCSD, MCDBA
2003-04-06
414 reads
This procedure, sp_AllInputBuffers, uses dynamic T-SQL to generate and execute the DBCC INPUTBUFFER statement for each server process (except yours). Perfect for performance troubleshooting situations, when you want to see what commands are being executed against your server. Also, a great example of the power of dynamic T-SQL.For the @exec parameter, pass 1 or leave […]
2003-04-04
654 reads
2003-04-03
78 reads
This script shows the way, how to remove a time from datetimes.Do not move this code to UDF, it would run at least 6 times slower.
2003-04-03
81 reads
This query will solve problems related to Table structure. Using this query you can have the complete table structure for all the user tables with Table Name, Column Name, Data Type, and Null attributes of a column.You can run this script in Query Analyzer or make use of it in your front-end to give table […]
2003-04-02
5,149 reads
By Chris Yates
The New Arena of Leadership The role of the Chief Data Officer is no...
Presenting you with an updated version of our sp_snapshot procedure, allowing you to easily...
SELECT * feels convenient, but in SQL Server it bloats I/O, burns network bandwidth,...
Comments posted to this topic are about the item Cleaning Up the Cloud
Comments posted to this topic are about the item The Maximum Value in the...
Comments posted to this topic are about the item Oracle Performance Tuning: Practical Techniques...
I have a table with this data:
TravelLogID CityID StartDate EndDate 1 1 2025-01-01 2025-01-06 2 2 2025-01-01 2025-01-06 3 3 2025-01-01 2025-01-06 4 4 2025-01-01 2025-01-06 5 5 2025-01-01 2025-01-06I run this code:
SELECT IDENT_CURRENT('TravelLog')I get the value 5 back. Now I do this:
SET IDENTITY_INSERT dbo.TravelLog ON INSERT dbo.TravelLog ( TravelLogID, CityID, StartDate, EndDate ) VALUES (25, 5, '2025-09-12', '2025-09-17') SET IDENTITY_INSERT dbo.TravelLog OFFI now run this code.
DBCC CHECKIDENT(TravelLog) GO INSERT dbo.TravelLog ( CityID, StartDate, EndDate ) VALUES (4, '2025-10-14', '2025-10-17') GOWhat is the value for TravelLogID for the row I inserted for CityID 4 and dates starting on 14 Oct 2025? See possible answers