Viewing 15 posts - 31 through 45 (of 86 total)
offtop
The performant alternative:
Create a Tally or Numbers Table
create table dbo.Tally(i int identity(1,1))
go
insert into dbo.Tally DEFAULT VALUES
go 1000000
February 17, 2012 at 1:59 am
I have a table containg a large number
DECLARE @int INT;
SET @int = 1;
WHILE @int <=1000
BEGIN
INSERT INTO TestTable (id, col)
VALUES (@int, 'name' + CAST(@int AS VARCHAR(100)));
SET @int += 1;
February 17, 2012 at 1:43 am
exec('BULK INSERT ctbs FROM '''+@caminhoexacto+'''
with (FIRSTROW =2,FIELDTERMINATOR =''|'' ,ROWTERMINATOR =''|/r/n'', tablock)')
?
change "/" to "\" for ROWTERMINATOR
November 16, 2011 at 11:14 pm
declare @t table(Unit nvarchar(100))
insert into @t(Unit) values
('Unit3'),
('Unit 4'),
('Shop2'),
('Shop 5'),
('Villa 7'),
('Villa11')
select
t.unit
, left(t.unit, patindex('%[0-9]%', t.unit)-1)
, substring(t.unit, patindex('%[0-9]%', t.unit), 100)
from
@t t
?
October 26, 2011 at 11:38 pm
Use Alert?
October 21, 2011 at 2:00 am
exec sp_MSforeachdb @command1 = 'use [?]; SELECT COUNT(*) FROM MyLeads WHERE active = 1'
October 20, 2011 at 11:45 pm
Select dividend/t.price as dividendYield, t.price/Bookvalue as PriceToBookValue, t.price/Earnings as PERatio From SecurityDetails
cross apply (select GetPrice(SecurityId) price) t
October 11, 2011 at 8:37 am
Select
dividend/t.price as dividendYield,
t.price/Bookvalue as PriceToBookValue,
t.price/Earnings as PERatio
From SecurityDetails, (select GetPrice() price) t
October 11, 2011 at 8:05 am
turn on logging in the package
October 11, 2011 at 8:00 am
October 11, 2011 at 3:49 am
declare @t table(id int, Name varchar(100), Mark1 varchar(100), Mark2 varchar(100), Mark3 varchar(100), Mark4 varchar(100), mark5 varchar(100))
insert into @t values(1, 'AAAA', '75', '85', '45', '65', '85')
select
id
, Details
from
@t t
unpivot...
October 11, 2011 at 3:39 am
Right click on any DB -> All Tasks -> Generate SQL Script
goto tab "options" and check "Script SQL Server logins (Windows Ans SQL Server logins)"
October 10, 2011 at 11:52 pm
try change
set @sql = 'SELECT TABLE_NAME = NAME FROM ' + @dbname + '..SYSOBJECTS WHERE XTYPE =' + '''' + 'U' + ''''
with
set @sql = 'SELECT...
October 10, 2011 at 11:05 pm
Viewing 15 posts - 31 through 45 (of 86 total)