Quantcast
Channel: Transact-SQL forum
Browsing all 23857 articles
Browse latest View live

Using a UDF to decrypt column

I have a table called #encryption Create Table #encryption (EmployeeIDEncrypted varchar(100),EmployeePartialID varchar(10))and I have a function which uses the EmployeeIDEncrypted value and...

View Article


Calculating elapsed time between actions within tasks

I have the following data:TaskID    ActionID    User    ActionDateAndTme   1              11          1       2008-07-02 08:45:00   1              12          1       2008-07-02 08:50:00   1...

View Article


Retrieving document from a table path

Hi All,I have document path in a table Varchar column like this...Column NameGUID/GUID/x.docGUID/y.pdfGUID/GUID/GUID/z.xlsI have not seen this pattern before. Each GUIDS here might be pointing to...

View Article

How to REPLACE in a ntext column

Re: How to REPLACE in a ntext columnI have a ntext column in a table. Say the value is 'xxxxabcxxxxx'. I want to replace the 'abc' with '123'. I have tried several ways but have not been successful....

View Article

Possible issue with protected view when using Openrowset to import data from...

Hi thereI am having a weird issue when trying to import data from an XLSX file into SQL (2008). The data is test data provided by a client. I noted that when I opened it in Excel on my workstation it...

View Article


Output results to text file using T-SQL

I need to create a text file using sql view. let me know how it can be achieved using T-SQL. ANy help appreciated.

View Article

Update Column by "aggregating" text from another table column

Hi,SUPPOSE I HAVE THESE 2 TABLES:IF OBJECT_ID('dbo.HUC824K', 'U') IS NOT NULL DROP TABLE dbo.HUC824K;CREATE TABLE dbo.HUC824K(  FIPS_C [varchar] (254) NULL,  HUC8 [varchar] (8) NULL);  INSERT INTO...

View Article

Generate sql script of a table schema in SQL 2000 through script

I wrote some scripts for correcting my old sql 2000 db schema compared to new sql 2000 db. This is done through a loop operations. First check if any table not found in my old db, then running a table...

View Article


Getting the records which has special characters that has ASCII value greater...

Hello All,I have a table called PipeSummary and has a column called LineName. This column is of varchar data type, size 100. This column has the data which includes special characters. This is the...

View Article


Putting the results of an IF and ELSE in a temp table

Hello all. Im having an issue with a task. I want to write values into a temp table from an if and else condition. However in to into #temptable clause of the else it is saying that the table already...

View Article

CONTAINSTABLE returns empty table

Hello,I am using CONTAINSTABLE with 5 tables join.Now, problem is that when anyone table is empty then It does not check remaining tables and returns empty table.For example,CONTAINSTABLE(tables1,...

View Article

How can Optimize this query . when i try to run this query it take more than...

SELECT x1yzef                    Case When DATEDIFF(dd, CreateDate, GetDate()) >= 120 Then 1 Else 0 End As Over120Flag,                  Sum(Units) As TtlUnits,       Sum(VisitCt) As TtlVisitCt,...

View Article

Getting Return value from a dynamic sql stored procedure SQL Server 2008

As a result of a migration process from SQL Server 2000 to 2008. we have stored procedures that are going to be held on a linked server and thus are building dynamic sql combining the server name in...

View Article


if else

i am using this code for searching against diffrent parameters. but when i enter wrong record error messag is shown "not found" when i enter valid record it populated to datagridview and agin error...

View Article

Duplicate Records for All Fields but One

AllHow would I go about deleting rows from a table which are complete dups except for one field (one row will have a value for FileName and the other will be NULL in FileName - otherwise they are...

View Article


Within SSMS calculated column changes format of name

I have a column "Name" which is the format John Doe .How would I make my new computed column take this name and make it "Doe, John"?I originally had it splitting the column into First and Last, then...

View Article

sql server 2000 data not sorting with index on table columns used in join...

Hi,SQL server 2000 query results not showing data properly. Previously it was showing proper data but from some days it showing random result set.Again when we backup the sql database and restores on...

View Article


Resetting IDENTITY Seed in Table Variable

How can the identity  seed be reset on a column (ID INT IDENTITY(1,1) ) in a table variable (@table) ?  Thanks.Kalman Toth Database & OLAP Architect sqlusa.comNew Book / Kindle: Pass SQL Exam...

View Article

Hint recompile to inner query

If i have sql statement(which is inside dynamic sql) like this:DECLARE @myId intSET @myId=(SELECT TOP 1 myId FROM myTable WHERE myName='myName')The plan for this query is always cached, I have checked....

View Article

Help

select dbo.fnFormatFullName(i.Ind_GUID, 'tblindividual')as [Member Name],        ISNULL(dbo.fnFormatFullName(ii.Ind_GUIDTo, 'tblindividual'),              RTRIM( ft.famt_surname) + ',' +...

View Article
Browsing all 23857 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>