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

what is the data type that accepts 1,000,000 characters in one cell ?

help solution ????

View Article


Alerting the DBA on New DB Creation and the same should be backed up.

Hello,I am not good at t-sql and hence need your suggestions here. I have a requirement like, whenever the new Database got created, the database should get backup in next sec/min. Do we have any ways...

View Article


Need to Split a Date Column into 2 solumn as Start Date and End Date

Question Removed

View Article

how to know which query hampering performance in stored procedure?

hi,      i have thousand lines of code how do i know which query is causing slow performancecould any one suggest please?

View Article

T-SQL: Manual Backup of Multiple Databases

I am looking to change the way I do manual backups of multiple databases on the same instance of SQL Server 2008 R2.Currently I have T-SQL scripts for each database that look like this:BACKUP DATABASE...

View Article


trying to convert SELECT query to Update query with INNER JOINS

Assalam O Alaikum!I've tried to convert this query of mine but failed.I wish to use it for update datasource in data GridView. I'm fetching data with it but converting it to update is not helping...

View Article

Database Mail problem

Hi all,I have searched and tried every solution possible but none of them worked.May be I didn't apply well the steps, and that's why I'm here.My problem is with "Database Mail", when I try to start it...

View Article

Using Merge Update and Insert One table to another

Hi, I have a source and destination table. Using merge statement i want to update and insert all data only specific columns from source to destination. For Example Source Table:          Destination...

View Article


Weird behaviour with Variables of a Stored Procedure

Hello All,   I'm writing following stored procedure and it is failing with following error"Conversion failed when converting from a character string to uniqueidentifier" What's Happening?  I've...

View Article


Lost with conversion of nvarchar to decimal and date

I am totally stuggeling with the the conversion from nvarchar datatype to decimal and date.I extracted data from SAP with SE16 imported the flat file to SQL server. All fields have the datatype...

View Article

How do Excute the following Query?

select 1 where 1 =1

View Article

Stored Procedure- Multil level employee hierarchy in the same row

I have an employee table where I have employee details  which includes the following properties:EmployeeID, EmployeeName, ManagerID, DesignationCode.ManagerID maps to EmployeeID in the Emp table....

View Article

Table value parameters Question

I would like to use a table valued parameter to create an invoice. It will insert into the invoice header data table the header and then it will insert the invoice detail all with different tables. The...

View Article


what is better max() or scope_identity()

 I need to retrieve identity value for inserted record in a stored procedure.  The value is then used to insert a record in a related table to establish relationship. The stored procedure called from...

View Article

t-sql 2008 r2 use 2 ctes

In existing t-sql 2008 r2 that I need to modify, there  is already an existing cte that looks like the following: ;WITH rCust AS (         SELECT           [UserSK]...

View Article


datediff in minutes in request_history table

I have a request_history table as follows.How can I get the datediff in minutes for time between when rid 104 was in QA Ready status and then Sign Off...

View Article

Image may be NSFW.
Clik here to view.

how to count and calculate total percentage for Every product in field?

hi all,i have two tables as follow:i have a inner join as follow :SELECT distinct dbo.Motor_Story.Name, dbo.Goods.kala, dbo.Goods.type, dbo.Goods.id_story FROM dbo.Goods INNER JOIN dbo.Motor_Story ON...

View Article


Scan count VS logical Reads

I have two versions of a query.1.  Scan count 136, logical reads 2776907,CPU time = 230848 ms,  elapsed time = 55753 ms.2. Scan count 0, logical reads 89225788, CPU time = 437696 ms,  elapsed time =...

View Article

Naming Convention - Sql Objects

Hi, Can you please advice me on Naming Convention of Sql Objects.lets say1.Table,2.Stored Procedure,3.View,4.User Defined Function,4.Trigger etc..Please advice me on this same for please give me one...

View Article

DDL trigger not capturing previous schema for ALTER SCHEMA TRANSFER

Hi,I have a DDL trigger which captures ALTER SCHEMA TRANSFER queries. The EVENTDATA() shows the following:<EVENT_INSTANCE>  <EventType>ALTER_SCHEMA</EventType>...

View Article
Browsing all 23857 articles
Browse latest View live


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