issue with merge in output when update
Problem - I put everything in a store procedure.Initially source.efforts=10. When I execute 1st time it is working fine.Later when I updated source.efforts=15 and ran stored procedure update not...
View ArticleQuestion about scripting of foreign keys
When I script FK_SalesOrderHeader_Address_BillToAddressID key from AdventureWorks.[Sales].[SalesOrderHeader] I get this:ALTER TABLE [Sales].[SalesOrderHeader] WITH CHECK ADD CONSTRAINT...
View ArticleCase statement ...
Is there a way to run a select statement from a "then" in the sql server case/when statement? I read that select statment cannot be used inside case but is there a way achieve the below requirement. I...
View ArticleGet the Count for each row
I'm trying to get the count for each row to total count for each monthSomething like thisHardware | JanMonitors | 5Processors | 137Printers | 57etc........How...
View ArticleDatabase Backup to Linked Server
Hi, I have a linked server and every operation such as Select, Insert and Update works perfectly on the Linked Server. I tried to take a backup from one server and to restore at another server say,...
View ArticleSSIS to create a formatted Email Message with
So I know how to concatenate my <Carriage Return> <Line Feed> for my Email message...DECLARE @Temp VARCHAR(MAX), @NewLineCRLF CHAR(6), @EmailMessage VARCHAR(MAX) SET @NewLineCRLF = '[CRLF]'...
View ArticleFind columns that do not match data types throughout the system
How do I locate find columns that do not match data types throughout a database? They have the same name but different data types.
View ArticleLoad data into file for update in MySQL
Hi all, Am learning MySQL now,how to use the load data into file when updating data from csv file.Already I loaded csv file using "load data local infile ...".Now my need is if any change in csv file...
View ArticleT-SQL code to get previous row value based on other columns
Hi All,I have a table with 6 columns, below are the table structures...Create statement:CREATE TABLE [dbo].[TestTable]( [ID] [int] NOT NULL, [NameID] [int] NOT NULL, [FirstName] [varchar](20) NULL,...
View ArticleSub select query Help
I have to do a task of finding records which matches the following logic.My table has PID varchar(15), Amount varchar (50),Status varchar(20) columns.Each PID can go thru changes in a period of time,...
View ArticleHow to update given datas with the existing tables in database, i need some...
I received new excel sheet from business and requirements is update that on existing database?I loaded records to database (above 20,000 records) Table name Peopleorg it contains partyfunctiontype...
View ArticleNeed help with multi database query.
Hello,I am working on a query between multiple databases to be view on a web app. We have multiple web apps and we are integrating some functionality between them all into one page. The data will be...
View ArticleSplitting Formatted Dates
I have Formatted dates like Monday, November 19, 2012 in a single column. I would like to split the date into four columns; Day of week, Month, day, year. I have tried text to colmns with no luck.
View Articlet-sql 20098 R2 locate number value within a string
In t-sql 2008 r2, I would like to know how to select a specific string in a varchar(50) field. The field in question is called 'CalendarId'.This field can contain values like:xxIN187 13-14 W Elem HS321...
View Articledesign question - alternative to CASE statement in JOIN
Hi Experts, I'm hoping someone knows the alternative to a CASE statement in a join. I have a sproc that builds a table that's a cross join of a set of dimension tables. Its purpose is to create a row...
View ArticleCannot alter column because it is 'enabled for Replication or Change Data...
I have a database that I had enabled Change Data Capture (CDC) on. I went to update one of the fields in a table in that database and got the following error.'tblName' table- Unable to rename column...
View ArticleOK - this shouldn't be so difficult
Hello Everyone:All I want to do is update one field in the Personnel_Tbl, from another field in List_JobRanks. Following is my UPDATE statement:UPDATE Personnel_Tbl SET Personnel_Tbl.RankClr =...
View ArticleBetter way than multiple JOINs to same table?
I am looking for a better way to write this query. The query uses the results from a CTE created previously which has these columns: ( TravelerID ,FirstName ,LastName ,Company ,PlacementID...
View Articlehow many sql server can installed in a server
how many sql server can installed in a server?????
View ArticleHow do I convert UTC to specified time zone in T-SQL (SQL Server 2008 R2)?
Question: How do I convert UTC time to specified time zone using SQL in SQL Server 2008 R2?---------------------------------------------------Scenario: I have a database/ASP.NET application that I use...
View Article