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

Convert UPC-E to UPC-A upon insert with UDF

I have the function but I need this function to insert on the PosCode in my Products Table:CREATE TABLE [Pricebook].[Products] ( [PosCode] [dbo].[posCode] NOT NULL, [PosCodeFormat] AS...

View Article


Join on Sparse column

I have LEFT JOIN on column which has null value in 95% (in second, joined table). On first table it is clustered key. Is it ok to mark this column as sparse in second table? I will savesome space, but...

View Article


How can I get the first and last day of a week from YYYYWK

Hi,How can I get the first and last full date of a week from YYYYWK in T SQL?Thanks in advance,Kieran.Kieran Patrick Wood http://www.innovativebusinessintelligence.com...

View Article

SSRS - Stored procedure with Dynamic SQL Query

Am calling stored procedure in SSRS report.  I have used Dynamic SQL query in stored procedure as I don't know the column name and column count.  And I have used like below at end of the stored...

View Article

Square brackets in T-SQL

Could someone please explain the difference between, these two commands:SELECT * FROM [DB_NAME].[SCHEMA_NAME].[TABLE_NAME]SELECT * FROM [DB_NAME.SCHEMA_NAME.TABLE_NAME]Thanks, Abhi

View Article


Functions and stored Procedure not working

This is the ScriptUSE [RLC_University] GO /****** Object:  UserDefinedFunction [dbo].[fn_GetIsRequired]    Script Date: 5/14/2014 5:37:08 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO  --...

View Article

Using ODBC to read SQL server view in SAS 9.3: dates read as text

Hello,Is there anything I can do in SQL server that ensures the dates read in as SAS dates.I have also asked this question in SAS forums.Someone who has actually done this might know. Thanks in...

View Article

sp_refreshsqlmodule Error

  I get the following errors when using sp_freshsqlmodule on following stored...

View Article


Count consecutive month reset if gap in months

I have been hitting a road block on a report I have been trying to create.  I am looking to find the most recent consecutive months for a specific ID.  If there is a break in the months the counter...

View Article


Virtually attribute

Need calculative field but that should be virtually attributes , how to use ?

View Article

MS SQL Linked Server

Dear ALL,I have 2 servers and i want to link both using the linked server option. First Server Name is IT64 and 2nd server name is IT65. Kindly help me, how to link the server step by step. I want to...

View Article

The conversion of the nvarchar value ' 2012 ' overflowed an INT1 column. Use...

Hi Gurus,Need a urgent reply. I have select..into statement like belowselect number, trannum into new from tran inner join base on tran.id=base.id. When i ran this query it is throwing error"The...

View Article

DATES between

I have a table1 like this...IDEntry CodeDate123E9/3/13123W9/9/13123E10/28/13123W12/11/13123E2/12/14123W2/19/14123E2/25/14I have another table2 with many number of dates for the same ID. I need to...

View Article


Insert bulk data throug a insert statement

Insert bulk data through a inset statement ?

View Article

Email Body

I am using sp_send_dbmail. And for @body, I have a simple varchar value. Now I want to make the message content a bit more professional looking. I believe this involves constructing an HTLM string.For...

View Article


Manage SQL Agent Job

I need to check a table for a flag and send out an email when its 1 and need to stop checking later for that day and need to check for the same flag next day in 30min interval. Can some one suggest me...

View Article

How to return efficiently filtered data

Dear all,I have a database ( SQL server 2012) which is based from AW sample db where I took some sample table design to cover my issues.My database will host a big list of product organized in category...

View Article


Assign empty string '' if datetime is null

 hi all, may i know how to assign '' (empty string) for a varible is null which type is datetime? example:select EnterTime from LoginTable if the EnterTime is null, this query will return  NULL but...

View Article

How to take more the 3 times login employee details

Hi I want to take who are login more then 3 fridays , i have a script but it comes all  please find the scriptSELECT distinct left(b.Name,2) MachinID,a.nFingerPrintID EmpId,dtpunchedFROM...

View Article

Execution time of sql query differing a lot between two computer

hiexecution time of a query in my computer and more than 30 different computer is less than one second but on one of our customers' computers, execution time is more than ten minute. databases and data...

View Article
Browsing all 23857 articles
Browse latest View live


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