I have had an issue with our replication process and would like to salvage some data. I have a process in place where I will connect to each subscriber before flagging them for reinitialization and I will run the below to pull any data they may have entered in during the “dark time”. I am […]
I have 2 tables as follows (sample data shown): TableName: A ID Type 1 Bug 2 Requirement 3 Task 4 Specification 5 Bug 6 Specification 7 Production Issue 8 Production Issue 9 Bug 10 Task Tablename: B ID RelatedID 1 2 1 7 5 8 5 4 9 6 9 10 I want to fetch […]
I have a date parameter so the date and time can always change. For this example the datetime is ‘2010-07-06 14:46:37.577’ I need to see how much time is between this date paramter and the time of ’17:00:00.000′ The time of 5PM will never change but as I said the date paramter can change.
Command line or library “compare tables” utility for SQL server with comprehensive diff output to a file in .Net I can’t find anything like that. Commercial or free ( XSQL Lite is suitable for my case and ) tools show diffs in grids with possibility to export to CSV. Also they generate sync SQL scripts […]
I want to call a web service from my SQL code, but it cannot be using CLR code. Can this even be done?
I have this SP USE [Test] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[UsersInsert](@UpdatedProdData XML) AS INSERT INTO dbo.UserTable(UserId,UserName,LicenseId,Password,PasswordSalt,Email,IsApproved,IsLockedOut,CreateDate, LastLoginDate,LastLockOutDate,FailedPasswordAttempts,RoleId) SELECT @UpdatedProdData.value(‘(/ArrayOfUsers/Users/UserId)’, ‘uniqueidentifier’), @UpdatedProdData.value(‘(/ArrayOfUsers/Users/UserName)’, ‘varchar(20)’), @UpdatedProdData.value(‘(/ArrayOfUsers/Users/LicenseId)’, ‘varchar(50)’), @UpdatedProdData.value(‘(/ArrayOfUsers/Users/Password)’, ‘varchar(128)’), @UpdatedProdData.value(‘(/ArrayOfUsers/Users/PasswordSalt)’, ‘varchar(128)’), @UpdatedProdData.value(‘(/ArrayOfUsers/Users/Email)’, ‘varchar(50)’), @UpdatedProdData.value(‘(/ArrayOfUsers/Users/IsApproved)’, ‘bit’), @UpdatedProdData.value(‘(/ArrayOfUsers/Users/IsLockedOut)’, ‘bit’), @UpdatedProdData.value(‘(/ArrayOfUsers/Users/CreateDate)’, ‘datetime’), @UpdatedProdData.value(‘(/ArrayOfUsers/Users/LastLoginDate)’, ‘datetime’), @UpdatedProdData.value(‘(/ArrayOfUsers/Users/LastLockOutDate)’, ‘datetime’), @UpdatedProdData.value(‘(/ArrayOfUsers/Users/FailedPasswordAttempts)’, ‘int’), @UpdatedProdData.value(‘(/ArrayOfUsers/Users/RoleId)’, ‘int’) Now this SP creates […]
What do you guys think would be the best approach here? I have about 30 SQL tables that is basically referenced by a [lookup] table. I have to do an insert in another table [FinalTable] for each row in the [lookup] table. Now the [lookup] table looks something like this. ID, Zipcode, tableID 1, 60453, […]
I have a Constraint on a table with IGNORE_DUP_KEY. This allows bulk inserts to partially work where some records are dupes and some are not (only inserting the non-dupes). However, it does not allow updates to partially work, where I only want those records updated where dupes will not be created. Does anyone know how […]
I have a scenario in which i receive files from a source and i blindly dump the data in the files to a staging area DB into number of tables. Now i need to translate the data in the Raw Data tables to a format that my Primary database model would understand and eventually do […]
How can I debug TSQL on SQL Server 2005 instance? Thanks.