Kita dapat membuat kode incremental tersebut dengan cara :
DECLARE @count AS INT
SET @count = 1
WHILE @count <= 10
BEGIN
SELECT 'A' + REPLACE(Str(@count, 4), ' ', '0')
SET @count = @count + 1
END
Life is not just for today
DECLARE @count AS INT
SET @count = 1
WHILE @count <= 10
BEGIN
SELECT 'A' + REPLACE(Str(@count, 4), ' ', '0')
SET @count = @count + 1
END
SELECT *
FROM sysobjects a,
syscomments b
WHERE a.id = b.id
AND b.TEXT LIKE '%SP_GeAmount%'
SELECT *
FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data Source=C:\test\xltest.xls;Extended Properties=Excel 8.0')...[Customers$]
SELECT *
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test\xltest.xls',
[Customers$])
SELECT *
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test\xltest.xls',
'SELECT * FROM [Customers$]')
SELECT *
FROM sys.configurations
ORDER BY name;
GO
Sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
Sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO
SELECT *
INTO #temp
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Test\data.xls',
'SELECT * FROM [Sheet1$]')