Sp help doubles the lenght of nchar and nvarchar...why?
Hi guys, anyone can explain me why if I create:CREATE TABLE [dbo].[DimProductxforum]([ProductKey] [int] IDENTITY(1,1) NOT NULL,[ProductAlternateKey] [nvarchar](25) NULL,[ProductSubcategoryKey] [int]...
View ArticleConversion failed when converting the varchar value 'total' to data type int.
Hi,I have the query below which runs fine with the set parameters Declare @Region AS varchar(max) Declare @District AS varchar(max) Declare @Location AS varchar(max) Declare @Date AS Varchar(max) Set...
View Articlehow to separate a string by comma using substring every 16 digits
I am trying to separate a string that consists of integers by comma. For example, @string = '22222222222222223333333333333333', I want to convert it to @string ='2222222222222222,33333333333333'For...
View ArticleBulk Insert Help Needed
Please help.... Thanks in advanceI know all the text qualifiers can be solved in XML, here is the link...but this is not resolving the last record of my csv file, which is...
View ArticleT-SQL: Using CASE Statement in WHERE Clause (Multiple conditions)
I trying to use a Case Statement in the Where Clause and I'm having difficulties.The Where Clause has three conditions. Condition1 AND either Condition2 or Condtion3 must be met. I use @Variable1 to...
View ArticleSelect particular values from the data inside a row.
Hi,I have the following data in the row,"Backup ran on 20110224 12:00:02 with the following parameters "from which i wanna select the date and time alone and insert it to a row in another table.Also...
View Articlehow to get last update date from bulk data in sql server 2008
hi...just i m using select command to display the table data..now view all the data but "NANDA"(dbempname)show only once the data based on fixed date is latest date...My stored procedures .....Create...
View ArticleSelect em linha especifica
Olá,Tenho um arquivo de texto, que não é separado, logo ao inclui -lo na tabela SQL, fica tudo em uma linha.ex: Fabricante do sistema: Microsoft CorporationModelo do sistema:...
View Articleselect in operator problem
Hi, when I use this code, it gave empty columndeclare @EmployeeID nvarchar(max)='' set @EmployeeID = '295847284,974026903' select FirstName, LastName,Title,HireDate,Birthdate,EmailAddress AS Contact...
View ArticleRollback using table value parameter to insert data which fires an insert...
I am using a table value parameter in a stored proc to insert data to table1. The insert fires a trigger to insert data to table2. When one or more of the rows that is attempting to be inserted to...
View ArticleDividing one query by another query
Hi,I have this query:SELECT [Org Level Dept],SUM([Direct Labor Hours]) AS [Direct Labor Hours] FROM ( SELECT pehCurHrs AS [Direct Labor Hours], pehOrgLvl1 AS [Org Level 1], pehOrgLvl2 AS [Org Level 2],...
View ArticleAlternate of materialized/Indexed views to avoid excessive table reads where...
Hi,I have a similar situation as in the following code where i want to materialize future due orders to avoid excessive reads in the procedure which at the moment i am handling using co-related...
View ArticleFraction data type
Hi,How can I insert a fraction data (for example 7/8)? What kind of Data type it is?I need it to to be a number and not a text in order to do calculations on it later on.
View ArticleOne is to Many Transaction Best Practice
Hi Guys, I have here an illustration of the scenario. I needed to select query using Table1 to get details of the other tables because it has key for the other tables.Table1 - | Key1 | Key2 | Key3 |...
View ArticleTsql reverse string with regard to a substring
I have a string that I want to reverse it with regard to a substring like this ; A-to-B-to-C-to-D result D-to-C-to-B-to-A Any idea ? yhx
View ArticleReg : An unhandled exception occurred during the execution of the current web...
Dear All, When one of my client was connecting to website which is re-directed to a database from one of his WEBSERVER, then after multiple hits it is throwing an error...
View Articleopening & closing stock like in tally
hii am using sql server and my table is CREATE TABLE #x ( TransactionDate SMALLDATETIME, Item CHAR(1), RecQty INT, RecRate INT, IssueQty INT, IssueRate INT, ); INSERT #x SELECT...
View ArticleXML node to table
Hi,I need following XML node to be in table format.<Proofs><Proof><ProfDesc> This Is proof1 </ProfDesc><ProofName> ProofName1...
View ArticleHow to use SEQUENCE in SQL 2012
Hi,I have a fact table that is loaded with some 1 million of data) Now I want to add one new "FactKey" column in this fact table so can u suggest whether to go for SEQUENCE creation will be helpful for...
View ArticleExtarcting the more that 100 million records from Linked Sever to local sever...
Hi All,Give you ideas optimized way in the transactions, performance to extract the data from linked server by using looping and minimized way the size of tempDB growth. The source have more than 100...
View Article