Solved

Help me decipher this SQL query

Posted on 2010-11-30
1
245 Views
Last Modified: 2012-05-10
Select name into ##TestFields from syscolumns where Id = object_id('" + @tablename + "') and xtype in (167,231)
0
Comment
Question by:spirose
1 Comment
 
LVL 6

Accepted Solution

by:
hyphenpipe earned 50 total points
ID: 34242419
It appears to be part of a stored procedure where you supply the name of a table (@tablename) and it will insert into a global temporary table, hence the ##, the name of every varchar (167) and nvarchar(231) column in that table.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now