Reset Identity Column with sp_IdentReSeed
Getting tired of dropping tables just re-seed the identity column? Remember, TRUNCATE TABLE doesn't work with foreign keys on tables. --EXAMPLE:DELETE FROM MyTablesp_Reseed 'MyTable'
2002-04-22
1,081 reads
Getting tired of dropping tables just re-seed the identity column? Remember, TRUNCATE TABLE doesn't work with foreign keys on tables. --EXAMPLE:DELETE FROM MyTablesp_Reseed 'MyTable'
2002-04-22
1,081 reads
SQL Server 2000 and Windows 2000 Only.Microsoft suggest using CDOSys rather than CDONTS. CDOSys stands for Collaboration Data Objects for Windows 2000 Subsystems. Below is a script that allows you do do just that. NO EXCHANGE REQUIRED!! Sample sends the user HTML Mail!Be sure to change @ServerIPAddr to your SMTP server.
2002-04-22
1,915 reads
Here's a stored procedure version of udf_CharIndex for SQL Server 7.Sample Usage: DECLARE @iPos INT DECLARE @nRet INT EXECUTE @nRet = sp_CharIndex 'W', 'Hello World', @nPos = @iPos OUTPUT IF @iPos > 0 PRINT 'found' ELSE Print 'not found' PRINT @iPos --Only uses on character.
2002-04-22
550 reads
Ever want to display (and edit) ASP code from the original .asp file? (like PHP's PHPInfo() function).To setup: * Just create a .asp with SQL Server connectivity. * Change @IISHostNameWWWPath to match your servername -OR- if SQL Server is on the same machine, use the next line instead. (see […]
2002-04-22
543 reads
User Defined Data Types (UDF) is one of the useful concepts in SQL Server. However UDF can't be modified after they are being used. You would have to remove your User Defined Data Type from each table before you can change it. This will be a big job under certain circumstances.This procedure changes all tables […]
2002-04-19
1,021 reads
This procedure will return useful columns information for VB developers. It shows column name, data type, size, vbtype, checktable (refferenced table) and flags: NoNull, IsIdentity, IsPK.Calling sample: mysp_columns 'customers'
2002-04-19
707 reads
Microsoft missed the code boat on this one. Use this function to find the true index of set of characters.
2002-04-18
586 reads
This script list all the users defined for each database on the server, it give the database name, the login name and the role defined.Its use full to have quick view of witch users are dbo on witch databaseEnsure that you have the result in grid in query analyzer, and just cut and paste the […]
2002-04-18
954 reads
Ever need to write reports out to a folder? I have found that creating output files are SA-WEET! (and easy too) The sample script uses BCP to create an HTML file.This process works well for reports that need to be generated nightly and take too long to run in real time. Use an SMTP mail […]
2002-04-18
4,406 reads
This procedure was written to create an event schedule where the schedule may have non-consecutive days. The input for the procedure is START DATE, END DATE, and DAYMAP The DAYMAP input parameter is a decimal number whose binary representation describes the schedule days over potentially a 4 week period (read from right to left). […]
2002-04-17
306 reads
By Vinay Thakur
Following up on my Part 1 baseline, the journey from 2017 onward changed how...
By Brian Kelley
In cryptography, the RSA and ECC algorithms which we use primarily for asymmetric cryptography...
By Steve Jones
In today’s world, this might mean something different, but in 2010, we had this...
Comments posted to this topic are about the item Dancing Robot Goes Rogue
Hi , i installed winscp on my pc, added it to GAC thru vs...
Comments posted to this topic are about the item Identities and Sequences II
In thinking about the differences between the identity property and a sequence object, which of these two guarantees that there are consecutive numbers (according to the increment) inserted in a single table?
See possible answers