skip to main
|
skip to sidebar
MSSQL101
Thursday, December 4, 2008
MSSQL Using a dynamic cursor
Use Pubs
Declare @tblName Varchar(40)
Declare @SQL varchar(2000)
Set @tblName = 'Authors'
SET @SQL = 'DECLARE Dyn_cursor CURSORFOR SELECT * FROM ' + @tblName
Exec(@SQL)
Open Dyn_Cursor
Close Dyn_cursor
Deallocate Dyn_cursor
Till Next Time
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Blog Archive
►
2017
(4)
►
November
(2)
►
September
(2)
►
2014
(3)
►
April
(3)
►
2013
(3)
►
August
(1)
►
January
(2)
►
2010
(4)
►
November
(1)
►
August
(1)
►
June
(2)
►
2009
(6)
►
August
(1)
►
February
(2)
►
January
(3)
▼
2008
(8)
▼
December
(6)
MSSQL Column info
MSSQL Update based on other table
MSSQL Scripted indexes
MSSQL Rowcount + trending
MSSQL Q&D Rowcount
MSSQL Using a dynamic cursor
►
August
(1)
►
February
(1)
About Me
John Minkjan
I'm a senior BI advisor / Lead Data Sceintist at Oktober in the Netherlands.
View my complete profile
Labels
AGENT
(1)
ALL POSTS
(13)
BACKUP
(2)
COLUMN
(1)
CONNECT
(1)
CONVERT
(2)
CURSOR
(2)
DATE
(2)
DRIVE
(1)
DRIVES
(1)
FOREIGN KEY
(1)
FREESPACE
(1)
GRANTS
(1)
INDEX
(1)
JOBAGENT
(1)
LINKED SERVER
(2)
MSSQL
(21)
OUTPUT
(1)
Package Store
(1)
PERMISSIONS
(1)
RESTORE
(3)
ROWCOUNT
(2)
SCHEDULER
(1)
SCRIPT
(4)
SSIS
(1)
SYNONYM
(1)
TSQL
(6)
UPDATE
(1)
VARIABLE
(1)
My Blog List
MDX101
multiple first day of week
-
Nice trick: http://richardlees.blogspot.nl/2015/08/supporting-multiple-first-day-of-week.html
No comments:
Post a Comment