Viewing 15 posts - 10,216 through 10,230 (of 15,381 total)
gsd1 (10/29/2012)
Thanks for the quick response...
I don't know the column type to declare the table variable initially.
I have to query sysColumns table to know the columns and then...
October 29, 2012 at 1:30 pm
Ray M (10/29/2012)
Try the setting the Rowcount.
DECLARE @t INTSET @t = 1
SET ROWCOUNT @t
SELECT *
FROM MyTable
DECLARE @t INT
SET @t = 220
SET ROWCOUNT @t
SELECT *
FROM MyTable
Not the approach I...
October 29, 2012 at 1:16 pm
eugene.pipko (10/29/2012)
Thanks for reply. By fails, I mean, the statement returns an error. Usually timeout error.
You need to handle that in the front end. Your statement needs to complete before...
October 29, 2012 at 1:13 pm
The Dixie Flatline (10/29/2012)
Another solution is dynamic SQL. Write the query to return all rows, and then insert your TOP () and ORDER BY as needed.
I was...
October 29, 2012 at 1:01 pm
eugene.pipko (10/29/2012)
I have the following construct:
select name, value
from
( select name, value from view1
union all
select name, value from...
October 29, 2012 at 12:55 pm
sqlfriends (10/29/2012)
How to grant create table permission to a role or user in SSMS and T_SQL?Thanks
October 29, 2012 at 12:47 pm
Jeff Moden (10/27/2012)
I strongly recommend not using incrementing alpha-numerics for just such a reason...
October 29, 2012 at 12:44 pm
You're welcome. Glad you figured it out and thanks for letting us know. 😀
October 29, 2012 at 11:41 am
prathibha_aviator (10/29/2012)
BriPan (10/28/2012)
select
* -- What ever column you want
,(case when Customer.CustomerID >3 then Order.PO else Order.OrderID end) as 'PO/OrderID'
from
Customer
inner join CustomerOrders on Customer.CustomerID =CustomerOrders.CustomerID
inner join Order...
October 29, 2012 at 11:11 am
komal145 (10/29/2012)
But when I tried to run the Sp by passing @InvestorCode_FROM and @InvestorCode_TO and not giving @Investor_all.
Example
EXEC [dbo].[usp_Get_Investor] 1000 ,2000
It throws...
October 29, 2012 at 10:41 am
webtekkie (10/29/2012)
Yeah, it does sound like a strange request, but I'm working for a bank and we have historic data in all sorts of wierd formats. It's not...
October 29, 2012 at 10:37 am
prathibha_aviator (10/29/2012)
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the nvarchar value 'Verbal' to data...
October 29, 2012 at 10:32 am
Duplicate post. Direct replies here. http://www.sqlservercentral.com/Forums/Topic1378336-148-1.aspx
October 29, 2012 at 10:28 am
komal145 (10/29/2012)
CREATE PROCEDURE [dbo].[usp_Get_Investor]
@InvestorCode_FROM INT
,@InvestorCode_TO INT
,@Investor_all VARCHAR(MAX)
AS
BEGIN
SET NOCOUNT ON
IF(@InvestorCode_FROM AND @InvestorCode_TO IS NOT NULL)
BEGIN
SELECT DISTINCT(OWN.INVESTOR)
FROM dbo.TABLEA...
October 29, 2012 at 10:25 am
webtekkie (10/29/2012)
I've been given the task of creating a single unique numerical value from two composite unique alphanumeric values. It needs to be possible to convert in both directions.
So,...
October 29, 2012 at 10:13 am
Viewing 15 posts - 10,216 through 10,230 (of 15,381 total)