示例#1
0
def _busqueda_tablas():
    ms_cur = sqlserver.cursor()
    ms_cur.execute("SELECT name FROM sysobjects WHERE type='u'"
                   "AND NOT name LIKE 'conflict%' "
                   "AND NOT name LIKE 'MS%' "
                   " ORDER BY name"
                   )
    return [ d['name'] for d in ms_cur.fetchall_asdict() ]
示例#2
0
    ms_cur.execute("SELECT name FROM sysobjects WHERE type='u'"
                   "AND NOT name LIKE 'conflict%' "
                   "AND NOT name LIKE 'MS%' "
                   " ORDER BY name"
                   )
    return [ d['name'] for d in ms_cur.fetchall_asdict() ]

TABLAS_SQL_SERVER = _busqueda_tablas()

#curs = sqlserver.cursor()
#curs.execute("SELECT TOP 1 * FROM %s" % TABLAS_SQL_SERVER[0])
#print curs.fetchone()

prows = lambda tl: "\n".join([",".join(map(unicode, x)) for x in tl ])

curs = sqlserver.cursor()
curs.execute("SELECT  COUNT(*) FROM sysusers")
filas = curs.fetchall()
print prows(filas)
print len(filas)



sys.exit()
from PyQt4.Qt import *
app = QApplication(sys.argv)
win = QWidget()
layout = QVBoxLayout()
lista = QListWidget()
layout.addWidget(lista)