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

update openquery remote table with join

Hi All,I have a problem with OPENQUERY update on remote table. I've googled for days, and can't solve the problem. Here is the problem:Local server MS SQL 2005.Remote server: MySQL.The linked server is...

View Article


reorganize records in table?

PartyID PartyFunctionTypeID Surname FirstName MiddleName MiddleName2 DisplayName 1 4 Yudin Michael NULL NULL Michael Yudin 2 4 Diggins Ben NULL NULL Ben Diggins 3 4 Strait Derrick NULL NULL Derrick...

View Article


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

  Hi, When I run a aggregate query, the null values are eliminated , is there a way to get the all values including NULLs as well? Thanks, below is my sample script SELECTDISTINCTTF.LEAD_ID,MAX(DT.)...

View Article

avoiding using a temp table in a stored procedure

Can I write a stored procedure that does INSERTs into the resultset of the stored procedure instead of having to use a temp table and then doing a SELECT of the records in that temp table ?...

View Article

Extract min timestamp from string

Hello all,I am trying to query the minimum datetime from a column that is stored as nvarchar(max). There a a few tricky things with this query (at least for me)- There is more than just the date being...

View Article


SQL Query to create a Time Dimension at 15 mins granuality

I need a query to generate Time Hierarchy for Year, Half Year, Qtr, Month, Week, Days, Hours, 15 minutes interval Pls share the query to generate the same or Excel sheet with the data. ThanksAnky

View Article

Pivot or CTE may solve this issue.

This is my first time using pivot or cte I have this in my db.tableFname PhoneTypePhoneNumber1 Roman Work3033331111 2Roman Cell3033332222 3Roman Fax3033333333 4Frank Work3034441111 5Frank...

View Article

How to create Jobs using stored procedure?

Hi All,         I am in somewhat stuck, I am doing migration of DB, i want to move the Jobs  of my server to client serveri want to create one stored procedure through which ill write script for the...

View Article


how many sql server can installed in a server

how many sql server can installed in a server?????

View Article


Storing data in two tables ...

I want to store data in two tables using stored procedure but I've  faced problem , so I've tried to make something like this:CREATE proc [dbo].[store](@TrnId int ,@prdctName nvarchar(50) ,@ordrdQnty...

View Article

Image may be NSFW.
Clik here to view.

Information about creating Index in a table

I have a table : [Carbon].[SampleResult] .Information about the table is mentioned above. There is a clustered index and a non clustered index present for this table. However, This table takes14...

View Article

sp_executesql dynamic sql

 Hello, I am new to sql server . I  try this following code but this gives an error like" Conversion failed when converting the nvarchar value 'update emp1 set gender='m' where id=' to data type...

View Article

Update previous record based on next record

Hi All,I have data like thisOrderid  Orderstatus  startdate            Enddate1            Ordered       2005-01-01       null1            Shipped       2005-02-01       null1            Delivered...

View Article


Combination based on single column

Hi All,I have table like belowTeamAmericaCanadaIrelandI want unique combination of two country at a timeI want the output asAmerica v/s CanadaAmerica v/s IrelandCanada v/s IrelandAny help is very much...

View Article

Must declare the scalar variable error

I am getting the error "Must declare the scalar variable "@Result""  when i execute the below querydeclare @sql nvarchar(max), @tablename varchar(200), @Id int, @Result int set @tablename='xyz' set...

View Article


Msg 213, Level 16, State 1, Line 31

Hello, I´ve got a problem with this database.I have this error here: Msg 213, Level 16, State 1, Line 31 Column name or number of supplied values does not match table definition.Do you know what to do...

View Article

SQL Server 2008 Certification

Hi All,I am preparing for SQL server 2008 Certification. Can anyone advise me if taking this certification is of any value because ofSQL Server 2012 Certification?Thanks,Preetha

View Article


validating check digit for Upc code or inserting 12th digit automatically...

if exists(select 1 from INFORMATION_SCHEMA.ROUTINES where ROUTINE_NAME = 'udf_Calculate_UPCA_CheckDigit' ) begin drop function dbo.udf_Calculate_UPCA_CheckDigit end go create function...

View Article

Function for parsing a string

I have a string of the below formatname1=value1; name2=value2;name 3=value3 ;name4 = value4Can some one please get me ready with a function which gets the above string and name part as input which...

View Article

Image may be NSFW.
Clik here to view.

Need help on logic - stored procedure required

I need a stored procedure - I have put required scripts -I have a requirement to send a notifications who has not acknowledged the email if [nhst].[cas_notify] +7 days.I have to insert values into...

View Article
Browsing all 23857 articles
Browse latest View live


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