Skip to content

Instantly share code, notes, and snippets.

SET NOCOUNT ON;
declare @tbl varchar(50);
set @tbl='[Users]';
SELECT * INTO #temp_table_for_script FROM (
-- select query sql
select * from [Users] where UserID in (985)
@cairabbit
cairabbit / 0_reuse_code.js
Created November 11, 2016 04:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cairabbit
cairabbit / cte.sqlalchemy.py
Last active September 16, 2024 21:49
SqlAlchemy CTE recursive sample
from sqlalchemy.orm import sessionmaker, relationship, aliased
from sqlalchemy import cast, Integer, Text, Column, ForeignKey, literal, null
from sqlalchemy.sql import column, label
class Catalog(Base):
__tablename__ = 'catalog'
id = Column(String, primary_key=True)
parentid = Column(String, ForeignKey('catalog.id'))
name = Column(String)
parent = relationship("Catalog", remote_side=[id])