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

how do I send to more than 1 dynamic mails?

Hi,I want to be able to send mails to specific mails.For example that works perfectly sending to only one mail:DECLARE @recipients VARCHAR(4000)SELECT    @recipients = [user] + '@skyvision.net'...

View Article


Triggers and stored procedures - life cycle and multiple instances

I'm working on a project developed by someone else (who is no longer available), and I have some questions about how the current design operates.SQL Server 2008 R2, in case that's relevant.There's a...

View Article


Include weekends in date range

Hello, I have a query that aggregates a value based on a date range and excludes business hours. I need to INCLUDE Saturday and Sunday based on the date range. I am stuck and I think I am at that time...

View Article

T-SQL 2008 R2 date filter between StartDate and EndDate

Hi I have below SQL 2008 R2 table where user input data for a given account code with date-ranhe i.e. StartDate and EndDateAccountCode     StartDate       EndDate        Amount ACC1...

View Article

IP address or computer name

I am importing data, I am using IP address to connect to shared folder in different server. Business wants me to use server name instead of IP address. Can we use computer name in tsql statement...

View Article


Format Specifier in a String Messsage with different Collation

Our product is creating a  message with a format specifier {%s}.  where ever we are using the message ,we are  using  a local variable to supply the message text for RAISE error. Here is the Raiseerror...

View Article

Last 6 months of data based on date feild that is an integer data type

Hi FolksI have a date column called 'YYYYMM' that is an Integer data type in YYYYMM format (eg. 201309). I want to return records from the last 6 months. If the column was in a date format I could use...

View Article

Join

Hi Everyone,Just want to output my result in a better way. Below is the query I am using where I am a doing a join and a union. I am compiling all purchases and issues for all items during a specific...

View Article


Image may be NSFW.
Clik here to view.

speical chars in xml (not the ones that belongs to to escaped chars)

i got text with the char for example(marked in red)i try to parse the content that inside the xml select cast(XMLMessage as XML).query('MSG/MESSAGE').value('.', 'nvarchar(MAX)') as Content from table1...

View Article


Please help me to write a function for this requirement!

Hi,    I have created a stored procedure which accepts 2 input parameters (param1 & param2 ) and its output is 'Score'Eg: Exec uspScorecalculation StudentID,DeptID  output: 85 Now, My requirement...

View Article

t-sql required - select statement stored in a table

I want to generate 'duedate' in '#emp' table based on rules (ruleid) that are stored as sql statements in '#rule' table. I put only 3 empid's. In real time, I will have more than that. I need a stored...

View Article

Creating a total result set from a query

I am having an issue trying to come up with a solution to return a table with the following stored procedure and then at the bottom being able to have a table row that shows the totals.  Do I need to...

View Article

Combine 2 SQL Query's to One DataSet

I am running these two query's they each work fine independently.  Now I need to combine them so that they are in one dataset.The only stipulation of combining them is the 1st query, I only need a...

View Article


Iterative Calculation - Help !

I have been handed over a code which needs some performance tuning and then a front end built on. According to the current developer, the iterative section for calculating the growth could be enhanced...

View Article

how to sort against last qty added in sql server 2005 table

i am using sql select query to select record and show in gridview  but I am facing sorting problem. I want to select query must be sort DESC (means last inserted record or against last edited row)here...

View Article


Number to Decimal

Hi All,This is easy but I'm posting because of time issue. This is my excel formula IF(LEN(O6)>3,CONCATENATE(LEFT(O6,3),".",RIGHT(O6,LEN(O6)-3)),O6) This just check the length and if length is...

View Article

sending an email

I would like help on how to send an email to a particular user whenever a row is added to the table in the database.

View Article


Previous month dates

Using a datetime field, how do I SELECT the first and last day of the previous month?

View Article

Restore Database .ndf files

I have a backup (.BAK file) which has bunch of .ndf files. I want to restore it on a database which has only .mdf and .ldf files. How to restore it? I am new to Sql server 2008 R2 and never restored...

View Article

Querys test

Hi there,I have two tableTable Name Employee employeeId first name last name manager dob siteIdTable Name :Site site id Site nameQ1;How to calculate age of each each employe and find the oldest and...

View Article
Browsing all 23857 articles
Browse latest View live


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