Quantcast
Channel: Transact-SQL forum
Browsing index pages (23857 articles)

T-SQL to Update duplicate records

Ok Im not sure this can even be done but I have a table that has a field with duplicates in it, 970 of them to be exact.What Id like to do is within this field, find duplicate entries and replace one...

View Article


"SELECT * INTO table FROM" a stored procedure? Possible?

I did a search and read a few solutions but they just don't make too much sense to me. Forgive my newbie-ness but I'm still pretty new when it comes to stored procedures. I'm still learning every...

View Article


creating tables in a database by using proper ANSI SQL syntax 98-364 database...

Hi We are working on 98-364 exam guide and one of the requirements is "creating tables in a database by using proper ANSI SQL syntax"Is someone able to give me T-SQL CREATE TABLE statement that is NOT...

View Article

One time history load into dimension table

I have a slowly changing dimension table that keeps track record of our current patient from the patients current location.There is also a history table.I want to load the history table into the...

View Article

EXEC sp_tables_ex random fail

Hi I installed ACE driver 2010 64 bits on my SQL 2017 64bitsI created a Linked Server to an Excel fileSELECT * FROM  myExcelLinkedServer...[Sheet1$]   -- Works 100% of the timebutEXEC sp_tables_ex...

View Article


RTRIM Not working

Hi guys,I have a strange issue when trying to trim some trailing spaces off a string.When I do select RTRIM([ErrorDescription])from [employer].[T_BulkUpLoadNewStarters_Errors]I get (note the two extra...

View Article

Can SQL Server graph query d orecursive?

SQL Server support graph table start from version 2017,I am wondering if graph query support recursive?below is the example:CREATE TABLE Person (  ID INTEGER PRIMARY KEY,  name VARCHAR(100) ) ;CREATE...

View Article

Warning: Null value is eliminated by an aggregate or other SET operation ?

I working on SQL server 2012 I face issue I can't solve this warning Warning: Null value is eliminated by an aggregate or other SET operation so How to solve this warning and not display again my query...

View Article


OPENROWSET EXCEL WITH AZURE FILE SHARE EXAMPLE

hi,Can anyone please give me a example to read specific range of data of excel which is stored in FILE share specific folder.I have tried to search online but i only found blob related link.It would be...

View Article


Send Email when a new order is entered

I made this little job to check every 15 minutes to see if there is a new job and send out an email with the job number in the header, nothing in the body. A person could easily see in the inbox new...

View Article

Sales revenue by country

I have three tablesmotorcyle_model: id, name, pricecountry: id, nameSales: model_id, country_id, quantity, sales_date All the country wise sale records of its motorcycles in table sales, storing...

View Article

Sql Server 2019 Standard 64bit Slow Performance Vs Sql Server 2012 Express...

Hello, I try to migrate my database from Sql Server 2012 Express (Sp1) to Sql Server 2019 Standard 64bit and I getting very bad query performance results .Same DB , Same Table, Same Data , same query...

View Article

Scripting

I don't know what the "scripting" means in SQL Server.(I have experience in T-SQL but not familiar with this term)Does it mean general T-SQL statement?Can anybody give me some idea and example for me...

View Article


Hello Friends, In below given query i want the Aging column's outputs in...

Select Work_Order_ID,summary,ISNULL(Request_Assignee, 'Unassigned') as Request_Assignee, CAST(DATEADD(s, Submit_Date, 'Jan 1, 1970') as nvarchar) as Submit_Date , CAST(DATEADD(s, Last_Modified_Date,...

View Article

How to write SQL Query and running in parallel within stored procedure ?

I read a bunch of articles and still, can't really know how optimizer determine to run in parallel or not. Here is my simple story, I have a stored procedure used to calculate a formula then return the...

View Article


Image may be NSFW.
Clik here to view.

Parse data from a table row and output the values formatted

I have a table that has multiple values (and sometimes no values) in the column: ReptDesc. I want to extract those values in the following way: If a value is followed by a colon : that is to be...

View Article

Best Practice filtering a Datetime Data Column by a provided StartDate and...

So I'm sure this has been beaten to death...I think even I myself have beaten this to death.We are wondering what the SQL Server Best Practice is when it comes to creating a SQL Server Stored Procedure...

View Article


How to update status to wrong numeric if at least on character exist ?

I work on SQL server 2012 I have keyValue field I need when user write on it any character except 0 to 9 then update status to Not valid number only and if field key value have all numbers only then...

View Article

Take one cell's value and convert it into a string for display in a label.

Hi,I know this is probably simple but...I want to select one value from a cell in our MSSQL database, and turn it into a string and put it in a label on our asp.net website.myEmailTemplateCommand = New...

View Article

Updating a uniqueidenfier column

Hi everyone, I have a SQL table with a column of a uniqueideitifer data type, this field allows NULL. I have a couple of records in the table that is NULL.When I tried to update one of the records with...

View Article
Browsing index pages (23857 articles)


Latest Images